FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
board Namespace Reference

Defines all types and constants specific to support Arduino MEGA board (ATmega644 MCU target). More...

Enumerations

enum  Port : uint8_t {
  Port::PORT_A = 0,
  Port::PORT_B,
  Port::PORT_C,
  Port::PORT_D,
  NONE = UINT8_MAX
}
 Defines all available ports of ATmega644. More...
 
enum  DigitalPin : uint8_t {
  DigitalPin::D0_PA0 = 0,
  DigitalPin::D1_PA1,
  DigitalPin::D2_PA2,
  DigitalPin::D3_PA3,
  DigitalPin::D4_PA4,
  DigitalPin::D5_PA5,
  DigitalPin::D6_PA6,
  DigitalPin::D7_PA7,
  DigitalPin::D8_PB0,
  DigitalPin::D9_PB1,
  DigitalPin::D10_PB2,
  DigitalPin::D11_PB3,
  DigitalPin::D12_PB4,
  DigitalPin::D13_PB5,
  DigitalPin::D14_PB6,
  DigitalPin::D15_PB7,
  DigitalPin::D16_PC0,
  DigitalPin::D17_PC1,
  DigitalPin::D18_PC2,
  DigitalPin::D19_PC3,
  DigitalPin::D20_PC4,
  DigitalPin::D21_PC5,
  DigitalPin::D22_PC6,
  DigitalPin::D23_PC7,
  DigitalPin::D24_PD0,
  DigitalPin::D25_PD1,
  DigitalPin::D26_PD2,
  DigitalPin::D27_PD3,
  DigitalPin::D28_PD4,
  DigitalPin::D29_PD5,
  DigitalPin::D30_PD6,
  DigitalPin::D31_PD7,
  DigitalPin::LED = D8_PB0,
  NONE = 0XFF
}
 Defines all available digital input/output pins of ATmega644, with reference to Arduino MEGA pins. More...
 
enum  AnalogClock : uint8_t {
  MAX_FREQ_50KHz = 0,
  MAX_FREQ_100KHz,
  MAX_FREQ_200KHz,
  MAX_FREQ_500KHz,
  MAX_FREQ_1MHz
}
 Defines available clocks of ATmega644, used for analog input.
 
enum  AnalogReference : uint8_t {
  AnalogReference::AREF = 0,
  AnalogReference::AVCC,
  AnalogReference::INTERNAL_1_1V,
  AnalogReference::INTERNAL_2_56V
}
 Defines available voltage references of ATmega644, used for analog input. More...
 
enum  AnalogPin : uint8_t {
  AnalogPin::A0 = 0,
  AnalogPin::A1,
  AnalogPin::A2,
  AnalogPin::A3,
  AnalogPin::A4,
  AnalogPin::A5,
  AnalogPin::A6,
  AnalogPin::A7,
  AnalogPin::BANDGAP,
  NONE = UINT8_MAX
}
 Defines all available analog input pins of ATmega644, with reference to Arduino MEGA pins. More...
 
enum  PWMPin : uint8_t {
  D11_PB3_OC0A = 0,
  D12_PB4_OC0B,
  D28_PD4_OC1B,
  D29_PD5_OC1A,
  D30_PD6_OC2B,
  D31_PD7_OC2A,
  NONE = UINT8_MAX
}
 Defines all digital output pins of ATmega644, capable of PWM output. More...
 
enum  ExternalInterruptPin : uint8_t {
  D26_PD2_EXT0 = 0,
  D27_PD3_EXT1,
  D10_PB2_EXT2
}
 Defines all digital output pins of ATmega644, usable as direct external interrupt pins. More...
 
enum  InterruptPin : uint8_t {
  D0_PA0_PCI0 = uint8_t(DigitalPin::D0_PA0),
  D1_PA1_PCI0 = uint8_t(DigitalPin::D1_PA1),
  D2_PA2_PCI0 = uint8_t(DigitalPin::D2_PA2),
  D3_PA3_PCI0 = uint8_t(DigitalPin::D3_PA3),
  D4_PA4_PCI0 = uint8_t(DigitalPin::D4_PA4),
  D5_PA5_PCI0 = uint8_t(DigitalPin::D5_PA5),
  D6_PA6_PCI0 = uint8_t(DigitalPin::D6_PA6),
  D7_PA7_PCI0 = uint8_t(DigitalPin::D7_PA7),
  D8_PB0_PCI1 = uint8_t(DigitalPin::D8_PB0),
  D9_PB1_PCI1 = uint8_t(DigitalPin::D9_PB1),
  D10_PB2_PCI1 = uint8_t(DigitalPin::D10_PB2),
  D11_PB3_PCI1 = uint8_t(DigitalPin::D11_PB3),
  D12_PB4_PCI1 = uint8_t(DigitalPin::D12_PB4),
  D13_PB5_PCI1 = uint8_t(DigitalPin::D13_PB5),
  D14_PB6_PCI1 = uint8_t(DigitalPin::D14_PB6),
  D15_PB7_PCI1 = uint8_t(DigitalPin::D15_PB7),
  D16_PC0_PCI2 = uint8_t(DigitalPin::D16_PC0),
  D17_PC1_PCI2 = uint8_t(DigitalPin::D17_PC1),
  D18_PC2_PCI2 = uint8_t(DigitalPin::D18_PC2),
  D19_PC3_PCI2 = uint8_t(DigitalPin::D19_PC3),
  D20_PC4_PCI2 = uint8_t(DigitalPin::D20_PC4),
  D21_PC5_PCI2 = uint8_t(DigitalPin::D21_PC5),
  D22_PC6_PCI2 = uint8_t(DigitalPin::D22_PC6),
  D23_PC7_PCI2 = uint8_t(DigitalPin::D23_PC7),
  D24_PD0_PCI3 = uint8_t(DigitalPin::D24_PD0),
  D25_PD1_PCI3 = uint8_t(DigitalPin::D25_PD1),
  D26_PD2_PCI3 = uint8_t(DigitalPin::D26_PD2),
  D27_PD3_PCI3 = uint8_t(DigitalPin::D27_PD3),
  D28_PD4_PCI3 = uint8_t(DigitalPin::D28_PD4),
  D29_PD5_PCI3 = uint8_t(DigitalPin::D29_PD5),
  D30_PD6_PCI3 = uint8_t(DigitalPin::D30_PD6),
  D31_PD7_PCI3 = uint8_t(DigitalPin::D31_PD7)
}
 Defines all digital output pins of ATmega644, usable as pin change interrupt (PCI) pins. More...
 
enum  USART : uint8_t {
  USART::USART0 = 0,
  USART::USART1 = 1
}
 Defines all USART modules of ATmega644. More...
 
enum  Timer : uint8_t {
  Timer::TIMER0 = 0,
  Timer::TIMER1 = 1,
  Timer::TIMER2 = 2
}
 Defines all timers available for ATmega644. More...
 
enum  SleepMode : uint8_t {
  SleepMode::IDLE = SLEEP_MODE_IDLE,
  SleepMode::ADC_NOISE_REDUCTION = SLEEP_MODE_ADC,
  SleepMode::POWER_DOWN = SLEEP_MODE_PWR_DOWN,
  SleepMode::POWER_SAVE = SLEEP_MODE_PWR_SAVE,
  SleepMode::STANDBY = SLEEP_MODE_STANDBY,
  SleepMode::EXTENDED_STANDBY = SLEEP_MODE_EXT_STANDBY
}
 Defines all available sleep modes for ATmega644. More...
 
enum  Port : uint8_t {
  Port::PORT_A = 0,
  Port::PORT_B,
  Port::PORT_C,
  Port::PORT_D,
  NONE = UINT8_MAX
}
 Defines all available ports of the target MCU. More...
 
enum  DigitalPin : uint8_t {
  DigitalPin::D0_PA0 = 0,
  DigitalPin::D1_PA1,
  DigitalPin::D2_PA2,
  DigitalPin::D3_PA3,
  DigitalPin::D4_PA4,
  DigitalPin::D5_PA5,
  DigitalPin::D6_PA6,
  DigitalPin::D7_PA7,
  DigitalPin::D8_PB0,
  DigitalPin::D9_PB1,
  DigitalPin::D10_PB2,
  DigitalPin::D11_PB3,
  DigitalPin::D12_PB4,
  DigitalPin::D13_PB5,
  DigitalPin::D14_PB6,
  DigitalPin::D15_PB7,
  DigitalPin::D16_PC0,
  DigitalPin::D17_PC1,
  DigitalPin::D18_PC2,
  DigitalPin::D19_PC3,
  DigitalPin::D20_PC4,
  DigitalPin::D21_PC5,
  DigitalPin::D22_PC6,
  DigitalPin::D23_PC7,
  DigitalPin::D24_PD0,
  DigitalPin::D25_PD1,
  DigitalPin::D26_PD2,
  DigitalPin::D27_PD3,
  DigitalPin::D28_PD4,
  DigitalPin::D29_PD5,
  DigitalPin::D30_PD6,
  DigitalPin::D31_PD7,
  DigitalPin::LED = D8_PB0,
  NONE = 0XFF
}
 Defines all available digital input/output pins of the target MCU. More...
 
enum  AnalogClock : uint8_t {
  MAX_FREQ_50KHz = 0,
  MAX_FREQ_100KHz,
  MAX_FREQ_200KHz,
  MAX_FREQ_500KHz,
  MAX_FREQ_1MHz
}
 Defines available clocks of the target MCU, used for analog input.
 
enum  AnalogReference : uint8_t {
  AnalogReference::AREF = 0,
  AnalogReference::AVCC,
  AnalogReference::INTERNAL_1_1V,
  AnalogReference::INTERNAL_2_56V
}
 Defines available voltage references of the target MCU, used for analog input. More...
 
enum  AnalogPin : uint8_t {
  AnalogPin::A0 = 0,
  AnalogPin::A1,
  AnalogPin::A2,
  AnalogPin::A3,
  AnalogPin::A4,
  AnalogPin::A5,
  AnalogPin::A6,
  AnalogPin::A7,
  AnalogPin::BANDGAP,
  NONE = UINT8_MAX
}
 Defines all available analog input pins of the target MCU. More...
 
enum  PWMPin : uint8_t {
  D11_PB3_OC0A = 0,
  D12_PB4_OC0B,
  D28_PD4_OC1B,
  D29_PD5_OC1A,
  D30_PD6_OC2B,
  D31_PD7_OC2A,
  NONE = UINT8_MAX
}
 Defines all digital output pins of target MCU, capable of PWM output.
 
enum  ExternalInterruptPin : uint8_t {
  D26_PD2_EXT0 = 0,
  D27_PD3_EXT1,
  D10_PB2_EXT2
}
 Defines all digital output pins of target MCU, usable as direct external interrupt pins.
 
enum  InterruptPin : uint8_t {
  D0_PA0_PCI0 = uint8_t(DigitalPin::D0_PA0),
  D1_PA1_PCI0 = uint8_t(DigitalPin::D1_PA1),
  D2_PA2_PCI0 = uint8_t(DigitalPin::D2_PA2),
  D3_PA3_PCI0 = uint8_t(DigitalPin::D3_PA3),
  D4_PA4_PCI0 = uint8_t(DigitalPin::D4_PA4),
  D5_PA5_PCI0 = uint8_t(DigitalPin::D5_PA5),
  D6_PA6_PCI0 = uint8_t(DigitalPin::D6_PA6),
  D7_PA7_PCI0 = uint8_t(DigitalPin::D7_PA7),
  D8_PB0_PCI1 = uint8_t(DigitalPin::D8_PB0),
  D9_PB1_PCI1 = uint8_t(DigitalPin::D9_PB1),
  D10_PB2_PCI1 = uint8_t(DigitalPin::D10_PB2),
  D11_PB3_PCI1 = uint8_t(DigitalPin::D11_PB3),
  D12_PB4_PCI1 = uint8_t(DigitalPin::D12_PB4),
  D13_PB5_PCI1 = uint8_t(DigitalPin::D13_PB5),
  D14_PB6_PCI1 = uint8_t(DigitalPin::D14_PB6),
  D15_PB7_PCI1 = uint8_t(DigitalPin::D15_PB7),
  D16_PC0_PCI2 = uint8_t(DigitalPin::D16_PC0),
  D17_PC1_PCI2 = uint8_t(DigitalPin::D17_PC1),
  D18_PC2_PCI2 = uint8_t(DigitalPin::D18_PC2),
  D19_PC3_PCI2 = uint8_t(DigitalPin::D19_PC3),
  D20_PC4_PCI2 = uint8_t(DigitalPin::D20_PC4),
  D21_PC5_PCI2 = uint8_t(DigitalPin::D21_PC5),
  D22_PC6_PCI2 = uint8_t(DigitalPin::D22_PC6),
  D23_PC7_PCI2 = uint8_t(DigitalPin::D23_PC7),
  D24_PD0_PCI3 = uint8_t(DigitalPin::D24_PD0),
  D25_PD1_PCI3 = uint8_t(DigitalPin::D25_PD1),
  D26_PD2_PCI3 = uint8_t(DigitalPin::D26_PD2),
  D27_PD3_PCI3 = uint8_t(DigitalPin::D27_PD3),
  D28_PD4_PCI3 = uint8_t(DigitalPin::D28_PD4),
  D29_PD5_PCI3 = uint8_t(DigitalPin::D29_PD5),
  D30_PD6_PCI3 = uint8_t(DigitalPin::D30_PD6),
  D31_PD7_PCI3 = uint8_t(DigitalPin::D31_PD7)
}
 Defines all digital output pins of target MCU, usable as pin change interrupt (PCI) pins.
 
enum  USART : uint8_t {
  USART::USART0 = 0,
  USART::USART1 = 1
}
 Defines all USART modules of target MCU. More...
 
enum  Timer : uint8_t {
  Timer::TIMER0 = 0,
  Timer::TIMER1 = 1,
  Timer::TIMER2 = 2
}
 Defines all timers available for target MCU. More...
 
enum  SleepMode : uint8_t {
  SleepMode::IDLE = SLEEP_MODE_IDLE,
  SleepMode::ADC_NOISE_REDUCTION = SLEEP_MODE_ADC,
  SleepMode::POWER_DOWN = SLEEP_MODE_PWR_DOWN,
  SleepMode::POWER_SAVE = SLEEP_MODE_PWR_SAVE,
  SleepMode::STANDBY = SLEEP_MODE_STANDBY,
  SleepMode::EXTENDED_STANDBY = SLEEP_MODE_EXT_STANDBY
}
 Defines all available sleep modes for target MCU. More...
 

Functions

static void init ()
 Performs special initialization for ATmega644, actually nothing at all. More...
 
static void init ()
 Performs special initialization for the target MCU. More...
 
template<DigitalPin PIN>
constexpr uint8_t BIT ()
 Determine the bit position, inside its IO port, of the given DigitalPin.
 
template<DigitalPin PIN>
constexpr uint8_t MASK ()
 Determine the bit mask representing the given DigitalPin inside its port.
 
template<ExternalInterruptPin EXT>
constexpr DigitalPin EXT_PIN ()
 Convert an ExternalInterruptPin to the matching DigitalPin.
 
template<InterruptPin PCI>
constexpr DigitalPin PCI_PIN ()
 Convert an InterruptPin to the matching DigitalPin.
 
template<PWMPin PWM>
constexpr DigitalPin PWM_PIN ()
 Convert an PWMPin to the matching DigitalPin.
 

Detailed Description

Defines all types and constants specific to support Arduino MEGA board (ATmega644 MCU target).

Defines all types and constants specific to support a specific MCU target.

This serves only as an example here; for actual targets, refer to proper header files in board directory, or refer refer to specific targets support section.

Enumeration Type Documentation

◆ Port [1/2]

enum board::Port : uint8_t
strong

Defines all available ports of ATmega644.

Enumerator
PORT_A 

Port A (8 IO)

PORT_B 

Port B (8 IO)

PORT_C 

Port C (8 IO)

PORT_D 

Port D (8 IO)

Definition at line 54 of file atmega_xx4.h.

◆ DigitalPin [1/2]

enum board::DigitalPin : uint8_t
strong

Defines all available digital input/output pins of ATmega644, with reference to Arduino MEGA pins.

Only Arduino MEGA pins are listed here. Each symbol is in the form Dxx_Pyz, where xx is the pin number on Arduino, y is the port letter and z is the bit number for that pin within its port.

Enumerator
D0_PA0 

Pin PA0 (ADC0/PCINT0)

D1_PA1 

Pin PA1 (ADC1/PCINT1)

D2_PA2 

Pin PA2 (ADC2/PCINT2)

D3_PA3 

Pin PA3 (ADC3/PCINT3)

D4_PA4 

Pin PA4 (ADC4/PCINT4)

D5_PA5 

Pin PA5 (ADC5/PCINT5)

D6_PA6 

Pin PA6 (ADC6/PCINT6)

D7_PA7 

Pin PA7 (ADC7/PCINT7)

D8_PB0 

Pin PB0 (PCINT8)

D9_PB1 

Pin PB1 (PCINT9)

D10_PB2 

Pin PB2 (PCINT10/INT2)

D11_PB3 

Pin PB3 (PCINT11/OC0A)

D12_PB4 

Pin PB4 (PCINT12/OC0B/SS)

D13_PB5 

Pin PB5 (PCINT13/MOSI)

D14_PB6 

Pin PB6 (PCINT14/MISO)

D15_PB7 

Pin PB7 (PCINT15/SCK)

D16_PC0 

Pin PC0 (PCINT16/SCL)

D17_PC1 

Pin PC1 (PCINT17/SDA)

D18_PC2 

Pin PC2 (PCINT18)

D19_PC3 

Pin PC3 (PCINT19)

D20_PC4 

Pin PC4 (PCINT20)

D21_PC5 

Pin PC5 (PCINT21)

D22_PC6 

Pin PC6 (PCINT22)

D23_PC7 

Pin PC7 (PCINT23)

D24_PD0 

Pin PD0 (PCINT24/RX0)

D25_PD1 

Pin PD1 (PCINT25/TX0)

D26_PD2 

Pin PD2 (PCINT26/RX1/INT0)

D27_PD3 

Pin PD3 (PCINT27/TX1/INT1)

D28_PD4 

Pin PD4 (PCINT28/OC1B)

D29_PD5 

Pin PD5 (PCINT29/OC1A)

D30_PD6 

Pin PD6 (PCINT30/OC2B/ICP)

D31_PD7 

Pin PD7 (PCINT31/OC2A)

LED 

Shortcut for LED pin (PB0 on pin 1 for ATmega644 PDIP)

Definition at line 75 of file atmega_xx4.h.

◆ AnalogReference [1/2]

enum board::AnalogReference : uint8_t
strong

Defines available voltage references of ATmega644, used for analog input.

Enumerator
AREF 

Voltage reference is given by the AREF pin.

AVCC 

Voltage reference is given by the AVcc pin.

INTERNAL_1_1V 

Voltage reference is internal 1.1V reference, generated from the internal bandgap reference.

INTERNAL_2_56V 

Voltage reference is internal 2.56V reference, generated from the internal bandgap reference.

Definition at line 166 of file atmega_xx4.h.

◆ AnalogPin [1/2]

enum board::AnalogPin : uint8_t
strong

Defines all available analog input pins of ATmega644, with reference to Arduino MEGA pins.

Note that this includes also other sources than pin, e.g. the internal bandgap reference.

Enumerator
A0 

Pin ADC0 (PA0)

A1 

Pin ADC1 (PA1)

A2 

Pin ADC2 (PA2)

A3 

Pin ADC3 (PA3)

A4 

Pin ADC4 (PA4)

A5 

Pin ADC5 (PA5)

A6 

Pin ADC6 (PA6)

A7 

Pin ADC7 (PA7)

BANDGAP 

Bandgap reference.

Definition at line 186 of file atmega_xx4.h.

◆ PWMPin

enum board::PWMPin : uint8_t
strong

Defines all digital output pins of ATmega644, capable of PWM output.

Each symbol is in the form Dxx_Pyz_OCuv, where xx is the pin number on Arduino, y is the port letter, z is the bit number for that pin within its port, u is the number of the timer used by this PWM pin and v the letter indicating which compare register of the timer this PWM pin is mapped to.

Definition at line 218 of file atmega_xx4.h.

◆ ExternalInterruptPin

enum board::ExternalInterruptPin : uint8_t
strong

Defines all digital output pins of ATmega644, usable as direct external interrupt pins.

Each symbol is in the form Dxx_Pyz_EXTu, where xx is the pin number on Arduino, y is the port letter, z is the bit number for that pin within its port and u is the number of the interrupt for that pin.

Definition at line 243 of file atmega_xx4.h.

◆ InterruptPin

enum board::InterruptPin : uint8_t
strong

Defines all digital output pins of ATmega644, usable as pin change interrupt (PCI) pins.

Each symbol is in the form Dxx_Pyz_PCIu, where xx is the pin number on Arduino, y is the port letter, z is the bit number for that pin within its port and u is the number of the PCI vector for that pin.

Definition at line 258 of file atmega_xx4.h.

◆ USART [1/2]

enum board::USART : uint8_t
strong

Defines all USART modules of ATmega644.

Enumerator
USART0 

USART0 is connected to pins D24_PD0 (RX0) and D25_PD1 (TX0).

USART1 

USART1 is connected to pins D26_PD2 (RX1) and D27_PD3 (TX1).

Definition at line 304 of file atmega_xx4.h.

◆ Timer [1/2]

enum board::Timer : uint8_t
strong

Defines all timers available for ATmega644.

Enumerator
TIMER0 

Timer0 (8 bits)

TIMER1 

Timer1 (16 bits)

TIMER2 

Timer2 (8 bits)

Definition at line 315 of file atmega_xx4.h.

◆ SleepMode [1/2]

enum board::SleepMode : uint8_t
strong

Defines all available sleep modes for ATmega644.

Enumerator
IDLE 

In this mode, CPU is stopped but all other peripherals and interrupts work normally.

In this mode, current consumption is reduced to about 25% of active mode consumption.

ADC_NOISE_REDUCTION 

In this mode, CPU is stopped but other peripherals and interrupts work normally, except IO.

This mode is actually very similar to IDLE.

POWER_DOWN 

In this mode, everything is stopped (including oscillator) but external interrupts, I2C slave (if enabled) and Watchdog Timer (if enabled).

This is lowest current consumption mode, typically a few uA, depending on other factors (voltage, watchdog enabled or not). Waking up from this mode may take significant time until internal oscillator is restarted and stabilized; refer to datasheet for more detailed data (look for Start-up times).

POWER_SAVE 

This mode is similar to POWER_DOWN, except Timer2 is still running if enabled.

Waking up from this mode may take significant time until internal oscillator is restarted and stabilized; refer to datasheet for more detailed data (look for Start-up times).

STANDBY 

This mode is similar to POWER_DOWN, except the oscillator is kept running, hence waking up from this mode takes only 6 clock cycles.

EXTENDED_STANDBY 

This mode is similar to POWER_SAVE, except the oscillator is kept running, hence waking up from this mode takes only 6 clock cycles.

Definition at line 332 of file atmega_xx4.h.

◆ Port [2/2]

enum board::Port : uint8_t
strong

Defines all available ports of the target MCU.

Enumerator
PORT_A 

Port A (8 IO)

PORT_B 

Port B (8 IO)

PORT_C 

Port C (8 IO)

PORT_D 

Port D (8 IO)

Definition at line 48 of file empty.h.

◆ DigitalPin [2/2]

enum board::DigitalPin : uint8_t
strong

Defines all available digital input/output pins of the target MCU.

Enumerator
D0_PA0 

Pin PA0 (ADC0/PCINT0)

D1_PA1 

Pin PA1 (ADC1/PCINT1)

D2_PA2 

Pin PA2 (ADC2/PCINT2)

D3_PA3 

Pin PA3 (ADC3/PCINT3)

D4_PA4 

Pin PA4 (ADC4/PCINT4)

D5_PA5 

Pin PA5 (ADC5/PCINT5)

D6_PA6 

Pin PA6 (ADC6/PCINT6)

D7_PA7 

Pin PA7 (ADC7/PCINT7)

D8_PB0 

Pin PB0 (PCINT8)

D9_PB1 

Pin PB1 (PCINT9)

D10_PB2 

Pin PB2 (PCINT10/INT2)

D11_PB3 

Pin PB3 (PCINT11/OC0A)

D12_PB4 

Pin PB4 (PCINT12/OC0B/SS)

D13_PB5 

Pin PB5 (PCINT13/MOSI)

D14_PB6 

Pin PB6 (PCINT14/MISO)

D15_PB7 

Pin PB7 (PCINT15/SCK)

D16_PC0 

Pin PC0 (PCINT16/SCL)

D17_PC1 

Pin PC1 (PCINT17/SDA)

D18_PC2 

Pin PC2 (PCINT18)

D19_PC3 

Pin PC3 (PCINT19)

D20_PC4 

Pin PC4 (PCINT20)

D21_PC5 

Pin PC5 (PCINT21)

D22_PC6 

Pin PC6 (PCINT22)

D23_PC7 

Pin PC7 (PCINT23)

D24_PD0 

Pin PD0 (PCINT24/RX0)

D25_PD1 

Pin PD1 (PCINT25/TX0)

D26_PD2 

Pin PD2 (PCINT26/RX1/INT0)

D27_PD3 

Pin PD3 (PCINT27/TX1/INT1)

D28_PD4 

Pin PD4 (PCINT28/OC1B)

D29_PD5 

Pin PD5 (PCINT29/OC1A)

D30_PD6 

Pin PD6 (PCINT30/OC2B/ICP)

D31_PD7 

Pin PD7 (PCINT31/OC2A)

LED 

Shortcut for LED pin (PB0 on pin 1 for ATmega644 PDIP)

Definition at line 55 of file empty.h.

◆ AnalogReference [2/2]

enum board::AnalogReference : uint8_t
strong

Defines available voltage references of the target MCU, used for analog input.

Enumerator
AREF 

Voltage reference is given by the AREF pin.

AVCC 

Voltage reference is given by the AVcc pin.

INTERNAL_1_1V 

Voltage reference is internal 1.1V reference, generated from the internal bandgap reference.

INTERNAL_2_56V 

Voltage reference is internal 2.56V reference, generated from the internal bandgap reference.

Definition at line 69 of file empty.h.

◆ AnalogPin [2/2]

enum board::AnalogPin : uint8_t
strong

Defines all available analog input pins of the target MCU.

Enumerator
A0 

Pin ADC0 (PA0)

A1 

Pin ADC1 (PA1)

A2 

Pin ADC2 (PA2)

A3 

Pin ADC3 (PA3)

A4 

Pin ADC4 (PA4)

A5 

Pin ADC5 (PA5)

A6 

Pin ADC6 (PA6)

A7 

Pin ADC7 (PA7)

BANDGAP 

Bandgap reference.

Definition at line 76 of file empty.h.

◆ USART [2/2]

enum board::USART : uint8_t
strong

Defines all USART modules of target MCU.

This may be empty e.g. for ATtiny MCU.

Enumerator
USART0 

USART0 is connected to pins D24_PD0 (RX0) and D25_PD1 (TX0).

USART1 

USART1 is connected to pins D26_PD2 (RX1) and D27_PD3 (TX1).

Definition at line 104 of file empty.h.

◆ Timer [2/2]

enum board::Timer : uint8_t
strong

Defines all timers available for target MCU.

Enumerator
TIMER0 

Timer0 (8 bits)

TIMER1 

Timer1 (16 bits)

TIMER2 

Timer2 (8 bits)

Definition at line 111 of file empty.h.

◆ SleepMode [2/2]

enum board::SleepMode : uint8_t
strong

Defines all available sleep modes for target MCU.

Enumerator
IDLE 

In this mode, CPU is stopped but all other peripherals and interrupts work normally.

In this mode, current consumption is reduced to about 25% of active mode consumption.

ADC_NOISE_REDUCTION 

In this mode, CPU is stopped but other peripherals and interrupts work normally, except IO.

This mode is actually very similar to IDLE.

POWER_DOWN 

In this mode, everything is stopped (including oscillator) but external interrupts, I2C slave (if enabled) and Watchdog Timer (if enabled).

This is lowest current consumption mode, typically a few uA, depending on other factors (voltage, watchdog enabled or not). Waking up from this mode may take significant time until internal oscillator is restarted and stabilized; refer to datasheet for more detailed data (look for Start-up times).

POWER_SAVE 

This mode is similar to POWER_DOWN, except Timer2 is still running if enabled.

Waking up from this mode may take significant time until internal oscillator is restarted and stabilized; refer to datasheet for more detailed data (look for Start-up times).

STANDBY 

This mode is similar to POWER_DOWN, except the oscillator is kept running, hence waking up from this mode takes only 6 clock cycles.

EXTENDED_STANDBY 

This mode is similar to POWER_SAVE, except the oscillator is kept running, hence waking up from this mode takes only 6 clock cycles.

Definition at line 118 of file empty.h.

Function Documentation

◆ init() [1/2]

static void board::init ( )
inlinestatic

Performs special initialization for ATmega644, actually nothing at all.

This must be called first in your main() function, even before sei(). In general you should ALWAYS call this function at the beginning of your main() even if you know it will not do anything; this will prevent strange behaviors when you want to port your code to another MCU target for which init() does perform important initialization, e.g. ATmega32u4 (Arduino LEONARDO).

Definition at line 49 of file atmega_xx4.h.

◆ init() [2/2]

static void board::init ( )
inlinestatic

Performs special initialization for the target MCU.

This must be called first in your main() function, even sei().

Definition at line 43 of file empty.h.