FastArduino - Arduino MEGA Support v1.10
C++ library to build fast but small Arduino/AVR projects
|
Defines all types and constants specific to support Arduino MEGA board (ATmega2560 MCU target). More...
Enumerations | |
enum class | Port : uint8_t { PORT_A = 0 , PORT_B , PORT_C , PORT_D , PORT_E , PORT_F , PORT_G , PORT_H , PORT_J , PORT_K , PORT_L , NONE = UINT8_MAX } |
Defines all available ports of ATmega2560. More... | |
enum class | DigitalPin : uint8_t { D0_PE0 = 0 , D0 = D0_PE0 , D1_PE1 , D1 = D1_PE1 , D2_PE4 , D2 = D2_PE4 , D3_PE5 , D3 = D3_PE5 , D4_PG5 , D4 = D4_PG5 , D5_PE3 , D5 = D5_PE3 , D6_PH3 , D6 = D6_PH3 , D7_PH4 , D7 = D7_PH4 , D8_PH5 , D8 = D8_PH5 , D9_PH6 , D9 = D9_PH6 , D10_PB4 , D10 = D10_PB4 , D11_PB5 , D11 = D11_PB5 , D12_PB6 , D12 = D12_PB6 , D13_PB7 , D13 = D13_PB7 , D14_PJ1 , D14 = D14_PJ1 , D15_PJ0 , D15 = D15_PJ0 , D16_PH1 , D16 = D16_PH1 , D17_PH0 , D17 = D17_PH0 , D18_PD3 , D18 = D18_PD3 , D19_PD2 , D19 = D19_PD2 , D20_PD1 , D20 = D20_PD1 , D21_PD0 , D21 = D21_PD0 , D22_PA0 , D22 = D22_PA0 , D23_PA1 , D23 = D23_PA1 , D24_PA2 , D24 = D24_PA2 , D25_PA3 , D25 = D25_PA3 , D26_PA4 , D26 = D26_PA4 , D27_PA5 , D27 = D27_PA5 , D28_PA6 , D28 = D28_PA6 , D29_PA7 , D29 = D29_PA7 , D30_PC7 , D30 = D30_PC7 , D31_PC6 , D31 = D31_PC6 , D32_PC5 , D32 = D32_PC5 , D33_PC4 , D33 = D33_PC4 , D34_PC3 , D34 = D34_PC3 , D35_PC2 , D35 = D35_PC2 , D36_PC1 , D36 = D36_PC1 , D37_PC0 , D37 = D37_PC0 , D38_PD7 , D38 = D38_PD7 , D39_PG2 , D39 = D39_PG2 , D40_PG1 , D40 = D40_PG1 , D41_PG0 , D41 = D41_PG0 , D42_PL7 , D42 = D42_PL7 , D43_PL6 , D43 = D43_PL6 , D44_PL5 , D44 = D44_PL5 , D45_PL4 , D45 = D45_PL4 , D46_PL3 , D46 = D46_PL3 , D47_PL2 , D47 = D47_PL2 , D48_PL1 , D48 = D48_PL1 , D49_PL0 , D49 = D49_PL0 , D50_PB3 , D50 = D50_PB3 , D51_PB2 , D51 = D51_PB2 , D52_PB1 , D52 = D52_PB1 , D53_PB0 , D53 = D53_PB0 , D54_PF0 , A0 = D54_PF0 , D55_PF1 , A1 = D55_PF1 , D56_PF2 , A2 = D56_PF2 , D57_PF3 , A3 = D57_PF3 , D58_PF4 , A4 = D58_PF4 , D59_PF5 , A5 = D59_PF5 , D60_PF6 , A6 = D60_PF6 , D61_PF7 , A7 = D61_PF7 , D62_PK0 , A8 = D62_PK0 , D63_PK1 , A9 = D63_PK1 , D64_PK2 , A10 = D64_PK2 , D65_PK3 , A11 = D65_PK3 , D66_PK4 , A12 = D66_PK4 , D67_PK5 , A13 = D67_PK5 , D68_PK6 , A14 = D68_PK6 , D69_PK7 , A15 = D69_PK7 , LED = D13_PB7 , NONE = 0XFF } |
Defines all available digital input/output pins of ATmega2560, with reference to Arduino MEGA pins. More... | |
enum class | AnalogClock : uint8_t { MAX_FREQ_50KHz = 0 , MAX_FREQ_100KHz , MAX_FREQ_200KHz , MAX_FREQ_500KHz , MAX_FREQ_1MHz } |
Defines available clocks of ATmega2560, used for analog input. More... | |
enum class | AnalogReference : uint8_t { AREF = 0 , AVCC , INTERNAL_1_1V , INTERNAL_2_56V } |
Defines available voltage references of ATmega2560, used for analog input. More... | |
enum class | AnalogPin : uint8_t { A0 = 0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 , A10 , A11 , A12 , A13 , A14 , A15 , BANDGAP , NONE = UINT8_MAX } |
Defines all available analog input pins of ATmega2560, with reference to Arduino MEGA pins. More... | |
enum class | PWMPin : uint8_t { D13_PB7_OC0A = 0 , D4_PG5_OC0B , D11_PB5_OC1A , D12_PB6_OC1B , D13_PB7_OC1C , D10_PB4_OC2A , D9_PH6_OC2B , D5_PE3_OC3A , D2_PE4_OC3B , D3_PE5_OC3C , D6_PH3_OC4A , D7_PH4_OC4B , D8_PH5_OC4C , D46_PL3_OC5A , D45_PL4_OC5B , D44_PL5_OC5C , D2 = D2_PE4_OC3B , D3 = D3_PE5_OC3C , D4 = D4_PG5_OC0B , D5 = D5_PE3_OC3A , D6 = D6_PH3_OC4A , D7 = D7_PH4_OC4B , D8 = D8_PH5_OC4C , D9 = D9_PH6_OC2B , D10 = D10_PB4_OC2A , D11 = D11_PB5_OC1A , D12 = D12_PB6_OC1B , D44 = D44_PL5_OC5C , D45 = D45_PL4_OC5B , D46 = D46_PL3_OC5A , NONE = UINT8_MAX } |
Defines all digital output pins of ATmega2560, capable of PWM output. More... | |
enum class | ExternalInterruptPin : uint8_t { D21_PD0_EXT0 = 0 , D20_PD1_EXT1 , D19_PD2_EXT2 , D18_PD3_EXT3 , D2_PE4_EXT4 , D3_PE5_EXT5 , D21 = D21_PD0_EXT0 , D20 = D20_PD1_EXT1 , D19 = D19_PD2_EXT2 , D18 = D18_PD3_EXT3 , D2 = D2_PE4_EXT4 , D3 = D3_PE5_EXT5 } |
Defines all digital output pins of ATmega2560, usable as direct external interrupt pins. More... | |
enum class | InterruptPin : uint8_t { D53_PB0_PCI0 = uint8_t(DigitalPin::D53_PB0) , D52_PB1_PCI0 = uint8_t(DigitalPin::D52_PB1) , D51_PB2_PCI0 = uint8_t(DigitalPin::D51_PB2) , D50_PB3_PCI0 = uint8_t(DigitalPin::D50_PB3) , D10_PB4_PCI0 = uint8_t(DigitalPin::D10_PB4) , D11_PB5_PCI0 = uint8_t(DigitalPin::D11_PB5) , D12_PB6_PCI0 = uint8_t(DigitalPin::D12_PB6) , D13_PB7_PCI0 = uint8_t(DigitalPin::D13_PB7) , D0_PE0_PCI1 = uint8_t(DigitalPin::D0_PE0) , D15_PJ0_PCI1 = uint8_t(DigitalPin::D15_PJ0) , D14_PJ1_PCI1 = uint8_t(DigitalPin::D14_PJ1) , D62_PK0_PCI2 = uint8_t(DigitalPin::D62_PK0) , D63_PK1_PCI2 = uint8_t(DigitalPin::D63_PK1) , D64_PK2_PCI2 = uint8_t(DigitalPin::D64_PK2) , D65_PK3_PCI2 = uint8_t(DigitalPin::D65_PK3) , D66_PK4_PCI2 = uint8_t(DigitalPin::D66_PK4) , D67_PK5_PCI2 = uint8_t(DigitalPin::D67_PK5) , D68_PK6_PCI2 = uint8_t(DigitalPin::D68_PK6) , D69_PK7_PCI2 = uint8_t(DigitalPin::D69_PK7) , D53 = uint8_t(DigitalPin::D53_PB0) , D52 = uint8_t(DigitalPin::D52_PB1) , D51 = uint8_t(DigitalPin::D51_PB2) , D50 = uint8_t(DigitalPin::D50_PB3) , D10 = uint8_t(DigitalPin::D10_PB4) , D11 = uint8_t(DigitalPin::D11_PB5) , D12 = uint8_t(DigitalPin::D12_PB6) , D13 = uint8_t(DigitalPin::D13_PB7) , D15 = uint8_t(DigitalPin::D15_PJ0) , D14 = uint8_t(DigitalPin::D14_PJ1) , A8 = uint8_t(DigitalPin::D62_PK0) , A9 = uint8_t(DigitalPin::D63_PK1) , A10 = uint8_t(DigitalPin::D64_PK2) , A11 = uint8_t(DigitalPin::D65_PK3) , A12 = uint8_t(DigitalPin::D66_PK4) , A13 = uint8_t(DigitalPin::D67_PK5) , A14 = uint8_t(DigitalPin::D68_PK6) , A15 = uint8_t(DigitalPin::D69_PK7) } |
Defines all digital output pins of ATmega2560, usable as pin change interrupt (PCI) pins. More... | |
enum class | USART : uint8_t { USART0 = 0 , USART1 = 1 , USART2 = 2 , USART3 = 3 } |
Defines all USART modules of ATmega2560. More... | |
enum class | Timer : uint8_t { TIMER0 = 0 , TIMER1 = 1 , TIMER2 = 2 , TIMER3 = 3 , TIMER4 = 4 , TIMER5 = 5 } |
Defines all timers available for ATmega2560. More... | |
enum class | SleepMode : uint8_t { IDLE = SLEEP_MODE_IDLE , ADC_NOISE_REDUCTION = SLEEP_MODE_ADC , POWER_DOWN = SLEEP_MODE_PWR_DOWN , POWER_SAVE = SLEEP_MODE_PWR_SAVE , STANDBY = SLEEP_MODE_STANDBY , EXTENDED_STANDBY = SLEEP_MODE_EXT_STANDBY } |
Defines all available sleep modes for ATmega2560. More... | |
Functions | |
static void | init () |
Performs special initialization for ATmega2560, actually nothing at all. More... | |
Defines all types and constants specific to support Arduino MEGA board (ATmega2560 MCU target).
|
strong |
Defines all available ports of ATmega2560.
|
strong |
Defines all available digital input/output pins of ATmega2560, 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.
|
strong |
|
strong |
Defines available voltage references of ATmega2560, used for analog input.
|
strong |
Defines all available analog input pins of ATmega2560, with reference to Arduino MEGA pins.
Note that this includes also other sources than pin, e.g. the internal bandgap reference.
|
strong |
Defines all digital output pins of ATmega2560, 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.
Note that ATmega2560 has pins that can be linked to several timers (e.g. pin PB7 is connected to OC0A and OC1C) but FastArduino is currently limited to pins linked to only one timer, hence for each pin, a choice had to be made: the main principles for this choice were to take timer comparison channels A and B first. In the future, support for pins with multiple timers linked may be added.
|
strong |
Defines all digital output pins of ATmega2560, 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.
|
strong |
Defines all digital output pins of ATmega2560, 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.
|
strong |
Defines all USART modules of ATmega2560.
|
strong |
|
strong |
Defines all available sleep modes for ATmega2560.
|
inlinestatic |
Performs special initialization for ATmega2560, 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).