FastArduino - Arduino MEGA Support v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
mega.h
Go to the documentation of this file.
1// Copyright 2016-2023 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
16
22#ifndef BOARDS_MEGA_HH
23#define BOARDS_MEGA_HH
24
25#include "io.h"
26#include "../defines.h"
27#include <avr/sleep.h>
28
30/* This board is based on ATmega2560 (older MEGA boards embedding an ATmega1280
31 are not supported. */
32#define BOARD_ATMEGA2560
34
39namespace board
40{
50 inline static void init() {}
51
55 enum class Port: uint8_t
56 {
58 PORT_A = 0,
60 PORT_B,
62 PORT_C,
64 PORT_D,
66 PORT_E,
68 PORT_F,
70 PORT_G,
72 PORT_H,
74 PORT_J,
76 PORT_K,
78 PORT_L,
79 // FastArduino internal: DO NOT USE
80 NONE = UINT8_MAX
81 };
82
90 enum class DigitalPin: uint8_t
91 {
93 D0_PE0 = 0,
95 D0 = D0_PE0,
97 D1_PE1,
99 D1 = D1_PE1,
101 D2_PE4,
103 D2 = D2_PE4,
105 D3_PE5,
107 D3 = D3_PE5,
109 D4_PG5,
111 D4 = D4_PG5,
113 D5_PE3,
115 D5 = D5_PE3,
117 D6_PH3,
119 D6 = D6_PH3,
121 D7_PH4,
123 D7 = D7_PH4,
125 D8_PH5,
127 D8 = D8_PH5,
129 D9_PH6,
131 D9 = D9_PH6,
133 D10_PB4,
135 D10 = D10_PB4,
137 D11_PB5,
139 D11 = D11_PB5,
141 D12_PB6,
143 D12 = D12_PB6,
145 D13_PB7,
147 D13 = D13_PB7,
149 D14_PJ1,
151 D14 = D14_PJ1,
153 D15_PJ0,
155 D15 = D15_PJ0,
157 D16_PH1,
159 D16 = D16_PH1,
161 D17_PH0,
163 D17 = D17_PH0,
165 D18_PD3,
167 D18 = D18_PD3,
169 D19_PD2,
171 D19 = D19_PD2,
173 D20_PD1,
175 D20 = D20_PD1,
177 D21_PD0,
179 D21 = D21_PD0,
181 D22_PA0,
183 D22 = D22_PA0,
185 D23_PA1,
187 D23 = D23_PA1,
189 D24_PA2,
191 D24 = D24_PA2,
193 D25_PA3,
195 D25 = D25_PA3,
197 D26_PA4,
199 D26 = D26_PA4,
201 D27_PA5,
203 D27 = D27_PA5,
205 D28_PA6,
207 D28 = D28_PA6,
209 D29_PA7,
211 D29 = D29_PA7,
213 D30_PC7,
215 D30 = D30_PC7,
217 D31_PC6,
219 D31 = D31_PC6,
221 D32_PC5,
223 D32 = D32_PC5,
225 D33_PC4,
227 D33 = D33_PC4,
229 D34_PC3,
231 D34 = D34_PC3,
233 D35_PC2,
235 D35 = D35_PC2,
237 D36_PC1,
239 D36 = D36_PC1,
241 D37_PC0,
243 D37 = D37_PC0,
245 D38_PD7,
247 D38 = D38_PD7,
249 D39_PG2,
251 D39 = D39_PG2,
253 D40_PG1,
255 D40 = D40_PG1,
257 D41_PG0,
259 D41 = D41_PG0,
261 D42_PL7,
263 D42 = D42_PL7,
265 D43_PL6,
267 D43 = D43_PL6,
269 D44_PL5,
271 D44 = D44_PL5,
273 D45_PL4,
275 D45 = D45_PL4,
277 D46_PL3,
279 D46 = D46_PL3,
281 D47_PL2,
283 D47 = D47_PL2,
285 D48_PL1,
287 D48 = D48_PL1,
289 D49_PL0,
291 D49 = D49_PL0,
293 D50_PB3,
295 D50 = D50_PB3,
297 D51_PB2,
299 D51 = D51_PB2,
301 D52_PB1,
303 D52 = D52_PB1,
305 D53_PB0,
307 D53 = D53_PB0,
309 D54_PF0,
311 A0 = D54_PF0,
313 D55_PF1,
315 A1 = D55_PF1,
317 D56_PF2,
319 A2 = D56_PF2,
321 D57_PF3,
323 A3 = D57_PF3,
325 D58_PF4,
327 A4 = D58_PF4,
329 D59_PF5,
331 A5 = D59_PF5,
333 D60_PF6,
335 A6 = D60_PF6,
337 D61_PF7,
339 A7 = D61_PF7,
341 D62_PK0,
343 A8 = D62_PK0,
345 D63_PK1,
347 A9 = D63_PK1,
349 D64_PK2,
351 A10 = D64_PK2,
353 D65_PK3,
355 A11 = D65_PK3,
357 D66_PK4,
359 A12 = D66_PK4,
361 D67_PK5,
363 A13 = D67_PK5,
365 D68_PK6,
367 A14 = D68_PK6,
369 D69_PK7,
371 A15 = D69_PK7,
373 LED = D13_PB7,
374 // FastArduino internal: DO NOT USE
375 NONE = 0XFF
376 };
377
381 enum class AnalogClock: uint8_t
382 {
383 MAX_FREQ_50KHz = 0,
384 MAX_FREQ_100KHz,
385 MAX_FREQ_200KHz,
386 MAX_FREQ_500KHz,
387 MAX_FREQ_1MHz
388 };
389
393 enum class AnalogReference: uint8_t
394 {
396 AREF = 0,
398 AVCC,
405 };
406
413 enum class AnalogPin: uint8_t
414 {
416 A0 = 0,
418 A1,
420 A2,
422 A3,
424 A4,
426 A5,
428 A6,
430 A7,
432 A8,
434 A9,
436 A10,
438 A11,
440 A12,
442 A13,
444 A14,
446 A15,
448 BANDGAP,
449 // FastArduino internal: DO NOT USE
450 NONE = UINT8_MAX
451 };
452
468 enum class PWMPin : uint8_t
469 {
470 // This pin is also OC1C! We can handle only one timer for one pin!
471 D13_PB7_OC0A = 0,
472 D4_PG5_OC0B,
473 D11_PB5_OC1A,
474 D12_PB6_OC1B,
475 D13_PB7_OC1C,
476 D10_PB4_OC2A,
477 D9_PH6_OC2B,
478 D5_PE3_OC3A,
479 D2_PE4_OC3B,
480 D3_PE5_OC3C,
481 D6_PH3_OC4A,
482 D7_PH4_OC4B,
483 D8_PH5_OC4C,
484 D46_PL3_OC5A,
485 D45_PL4_OC5B,
486 D44_PL5_OC5C,
487
488 D2 = D2_PE4_OC3B,
489 D3 = D3_PE5_OC3C,
490 D4 = D4_PG5_OC0B,
491 D5 = D5_PE3_OC3A,
492 D6 = D6_PH3_OC4A,
493 D7 = D7_PH4_OC4B,
494 D8 = D8_PH5_OC4C,
495 D9 = D9_PH6_OC2B,
496 D10 = D10_PB4_OC2A,
497 D11 = D11_PB5_OC1A,
498 D12 = D12_PB6_OC1B,
499 D44 = D44_PL5_OC5C,
500 D45 = D45_PL4_OC5B,
501 D46 = D46_PL3_OC5A,
502 // FastArduino internal: DO NOT USE
503 NONE = UINT8_MAX
504 };
505
514 enum class ExternalInterruptPin : uint8_t
515 {
516 D21_PD0_EXT0 = 0,
517 D20_PD1_EXT1,
518 D19_PD2_EXT2,
519 D18_PD3_EXT3,
520 D2_PE4_EXT4,
521 D3_PE5_EXT5,
522
523 D21 = D21_PD0_EXT0,
524 D20 = D20_PD1_EXT1,
525 D19 = D19_PD2_EXT2,
526 D18 = D18_PD3_EXT3,
527 D2 = D2_PE4_EXT4,
528 D3 = D3_PE5_EXT5
529 };
530
539 enum class InterruptPin : uint8_t
540 {
541 // PB0-7
542 D53_PB0_PCI0 = uint8_t(DigitalPin::D53_PB0),
543 D52_PB1_PCI0 = uint8_t(DigitalPin::D52_PB1),
544 D51_PB2_PCI0 = uint8_t(DigitalPin::D51_PB2),
545 D50_PB3_PCI0 = uint8_t(DigitalPin::D50_PB3),
546 D10_PB4_PCI0 = uint8_t(DigitalPin::D10_PB4),
547 D11_PB5_PCI0 = uint8_t(DigitalPin::D11_PB5),
548 D12_PB6_PCI0 = uint8_t(DigitalPin::D12_PB6),
549 D13_PB7_PCI0 = uint8_t(DigitalPin::D13_PB7),
550
551 // PE0
552 D0_PE0_PCI1 = uint8_t(DigitalPin::D0_PE0),
553
554 // PJ0-1
555 D15_PJ0_PCI1 = uint8_t(DigitalPin::D15_PJ0),
556 D14_PJ1_PCI1 = uint8_t(DigitalPin::D14_PJ1),
557
558 // PK0-7
559 D62_PK0_PCI2 = uint8_t(DigitalPin::D62_PK0),
560 D63_PK1_PCI2 = uint8_t(DigitalPin::D63_PK1),
561 D64_PK2_PCI2 = uint8_t(DigitalPin::D64_PK2),
562 D65_PK3_PCI2 = uint8_t(DigitalPin::D65_PK3),
563 D66_PK4_PCI2 = uint8_t(DigitalPin::D66_PK4),
564 D67_PK5_PCI2 = uint8_t(DigitalPin::D67_PK5),
565 D68_PK6_PCI2 = uint8_t(DigitalPin::D68_PK6),
566 D69_PK7_PCI2 = uint8_t(DigitalPin::D69_PK7),
567
568 // PB0-7
569 D53 = uint8_t(DigitalPin::D53_PB0),
570 D52 = uint8_t(DigitalPin::D52_PB1),
571 D51 = uint8_t(DigitalPin::D51_PB2),
572 D50 = uint8_t(DigitalPin::D50_PB3),
573 D10 = uint8_t(DigitalPin::D10_PB4),
574 D11 = uint8_t(DigitalPin::D11_PB5),
575 D12 = uint8_t(DigitalPin::D12_PB6),
576 D13 = uint8_t(DigitalPin::D13_PB7),
577
578 // PJ0-1
579 D15 = uint8_t(DigitalPin::D15_PJ0),
580 D14 = uint8_t(DigitalPin::D14_PJ1),
581
582 // PK0-7
583 A8 = uint8_t(DigitalPin::D62_PK0),
584 A9 = uint8_t(DigitalPin::D63_PK1),
585 A10 = uint8_t(DigitalPin::D64_PK2),
586 A11 = uint8_t(DigitalPin::D65_PK3),
587 A12 = uint8_t(DigitalPin::D66_PK4),
588 A13 = uint8_t(DigitalPin::D67_PK5),
589 A14 = uint8_t(DigitalPin::D68_PK6),
590 A15 = uint8_t(DigitalPin::D69_PK7)
591 };
592
596 enum class USART: uint8_t
597 {
602 USART0 = 0,
604 USART1 = 1,
606 USART2 = 2,
608 USART3 = 3
609 };
610
614 enum class Timer: uint8_t
615 {
617 TIMER0 = 0,
619 TIMER1 = 1,
621 TIMER2 = 2,
623 TIMER3 = 3,
625 TIMER4 = 4,
627 TIMER5 = 5
628 };
629
633 enum class SleepMode: uint8_t
634 {
640 IDLE = SLEEP_MODE_IDLE,
645 ADC_NOISE_REDUCTION = SLEEP_MODE_ADC,
655 POWER_DOWN = SLEEP_MODE_PWR_DOWN,
663 POWER_SAVE = SLEEP_MODE_PWR_SAVE,
668 STANDBY = SLEEP_MODE_STANDBY,
673 EXTENDED_STANDBY = SLEEP_MODE_EXT_STANDBY
674 };
675};
676
678// Forward declare interrupt service routines to allow them as friends.
679extern "C" {
680 void ADC_vect(void) SIGNAL_HANDLER;
681 void ANALOG_COMP_vect(void) SIGNAL_HANDLER;
682 void INT0_vect(void) SIGNAL_HANDLER;
683 void INT1_vect(void) SIGNAL_HANDLER;
684 void INT2_vect(void) SIGNAL_HANDLER;
685 void INT3_vect(void) SIGNAL_HANDLER;
686 void INT4_vect(void) SIGNAL_HANDLER;
687 void INT5_vect(void) SIGNAL_HANDLER;
688 void INT6_vect(void) SIGNAL_HANDLER;
689 void INT7_vect(void) SIGNAL_HANDLER;
690 void PCINT0_vect(void) SIGNAL_HANDLER;
691 void PCINT1_vect(void) SIGNAL_HANDLER;
692 void PCINT2_vect(void) SIGNAL_HANDLER;
693 void SPI_STC_vect(void) SIGNAL_HANDLER;
694 void TIMER0_COMPA_vect(void) SIGNAL_HANDLER;
695 void TIMER0_COMPB_vect(void) SIGNAL_HANDLER;
696 void TIMER0_OVF_vect(void) SIGNAL_HANDLER;
697 void TIMER1_COMPA_vect(void) SIGNAL_HANDLER;
698 void TIMER1_COMPB_vect(void) SIGNAL_HANDLER;
699 void TIMER1_COMPC_vect(void) SIGNAL_HANDLER;
700 void TIMER1_OVF_vect(void) SIGNAL_HANDLER;
701 void TIMER1_CAPT_vect(void) SIGNAL_HANDLER;
702 void TIMER2_COMPA_vect(void) SIGNAL_HANDLER;
703 void TIMER2_COMPB_vect(void) SIGNAL_HANDLER;
704 void TIMER2_OVF_vect(void) SIGNAL_HANDLER;
705 void TIMER3_COMPA_vect(void) SIGNAL_HANDLER;
706 void TIMER3_COMPB_vect(void) SIGNAL_HANDLER;
707 void TIMER3_COMPC_vect(void) SIGNAL_HANDLER;
708 void TIMER3_OVF_vect(void) SIGNAL_HANDLER;
709 void TIMER3_CAPT_vect(void) SIGNAL_HANDLER;
710 void TIMER4_COMPA_vect(void) SIGNAL_HANDLER;
711 void TIMER4_COMPB_vect(void) SIGNAL_HANDLER;
712 void TIMER4_COMPC_vect(void) SIGNAL_HANDLER;
713 void TIMER4_OVF_vect(void) SIGNAL_HANDLER;
714 void TIMER4_CAPT_vect(void) SIGNAL_HANDLER;
715 void TIMER5_COMPA_vect(void) SIGNAL_HANDLER;
716 void TIMER5_COMPB_vect(void) SIGNAL_HANDLER;
717 void TIMER5_COMPC_vect(void) SIGNAL_HANDLER;
718 void TIMER5_OVF_vect(void) SIGNAL_HANDLER;
719 void TIMER5_CAPT_vect(void) SIGNAL_HANDLER;
720 void TWI_vect(void) SIGNAL_HANDLER;
721 void WDT_vect(void) SIGNAL_HANDLER;
722 void USART0_UDRE_vect(void) SIGNAL_HANDLER;
723 void USART0_RX_vect(void) SIGNAL_HANDLER;
724 void USART0_TX_vect(void) SIGNAL_HANDLER;
725 void USART1_UDRE_vect(void) SIGNAL_HANDLER;
726 void USART1_RX_vect(void) SIGNAL_HANDLER;
727 void USART1_TX_vect(void) SIGNAL_HANDLER;
728 void USART2_UDRE_vect(void) SIGNAL_HANDLER;
729 void USART2_RX_vect(void) SIGNAL_HANDLER;
730 void USART2_TX_vect(void) SIGNAL_HANDLER;
731 void USART3_UDRE_vect(void) SIGNAL_HANDLER;
732 void USART3_RX_vect(void) SIGNAL_HANDLER;
733 void USART3_TX_vect(void) SIGNAL_HANDLER;
734 void EE_READY_vect(void) SIGNAL_HANDLER;
735}
737#endif /* BOARDS_MEGA_HH */
Defines all types and constants specific to support Arduino MEGA board (ATmega2560 MCU target).
Definition: mega.h:40
PWMPin
Defines all digital output pins of ATmega2560, capable of PWM output.
Definition: mega.h:469
Port
Defines all available ports of ATmega2560.
Definition: mega.h:56
@ PORT_L
Port L (8 IO)
@ PORT_G
Port G (6 IO, only 4 available on Arduino MEGA)
@ PORT_F
Port F (8 IO)
@ PORT_D
Port D (8 IO, only 5 available on Arduino MEGA)
@ PORT_C
Port C (8 IO)
@ PORT_E
Port E (8 IO, only 5 available on Arduino MEGA)
@ PORT_A
Port A (8 IO)
@ PORT_B
Port B (8 IO)
@ PORT_J
Port J (8 IO, only 2 available on Arduino MEGA)
@ PORT_H
Port H (8 IO, only 6 available on Arduino MEGA)
@ PORT_K
Port K (8 IO)
static void init()
Performs special initialization for ATmega2560, actually nothing at all.
Definition: mega.h:50
DigitalPin
Defines all available digital input/output pins of ATmega2560, with reference to Arduino MEGA pins.
Definition: mega.h:91
@ D40
Pin PG1 (D40 on Arduino MEGA)
@ D21
Pin PD0 (D21 /SCL on Arduino MEGA)
@ D19_PD2
Pin PD2 (D19 /RX1 on Arduino MEGA)
@ D42
Pin PL7 (D42 on Arduino MEGA)
@ D41
Pin PG0 (D41 on Arduino MEGA)
@ D48_PL1
Pin PL1 (D48 on Arduino MEGA)
@ A6
Pin PF6 (D60/A6 on Arduino MEGA)
@ A12
Pin PK4 (D66/A12 on Arduino MEGA)
@ A4
Pin PF4 (D58/A4 on Arduino MEGA)
@ D15
Pin PJ0 (D15/RX3 on Arduino MEGA)
@ D0
Pin PE0 (D0/RX0 on Arduino MEGA)
@ D42_PL7
Pin PL7 (D42 on Arduino MEGA)
@ D64_PK2
Pin PK2 (D64/A10 on Arduino MEGA)
@ D35
Pin PC2 (D35 on Arduino MEGA)
@ D12_PB6
Pin PB6 (D12 on Arduino MEGA)
@ D2_PE4
Pin PE4 (D3 on Arduino MEGA)
@ D14_PJ1
Pin PJ1 (D14/TX3 on Arduino MEGA)
@ D11_PB5
Pin PB5 (D11 on Arduino MEGA)
@ D29
Pin PA7 (D29 on Arduino MEGA)
@ D18
Pin PD3 (D18 /TX1 on Arduino MEGA)
@ D62_PK0
Pin PK0 (D62/A8 on Arduino MEGA)
@ D0_PE0
Pin PE0 (D0/RX0 on Arduino MEGA)
@ D10_PB4
Pin PB4 (D10 on Arduino MEGA)
@ D4
Pin PG5 (D4 on Arduino MEGA)
@ D47_PL2
Pin PL2 (D47 on Arduino MEGA)
@ A1
Pin PF1 (D55/A1 on Arduino MEGA)
@ D61_PF7
Pin PF7 (D61/A7 on Arduino MEGA)
@ D45_PL4
Pin PL4 (D45 on Arduino MEGA)
@ D22_PA0
Pin PA0 (D22 on Arduino MEGA)
@ D17
Pin PH0 (D17 /RX2 on Arduino MEGA)
@ D25_PA3
Pin PA3 (D25 on Arduino MEGA)
@ D30
Pin PC7 (D30 on Arduino MEGA)
@ D65_PK3
Pin PK3 (D65/A11 on Arduino MEGA)
@ D49_PL0
Pin PL0 (D49 on Arduino MEGA)
@ D56_PF2
Pin PF2 (D56/A2 on Arduino MEGA)
@ D3_PE5
Pin PE5 (D3 on Arduino MEGA)
@ D13_PB7
Pin PB7 (D13 on Arduino MEGA)
@ D54_PF0
Pin PF0 (D54/A0 on Arduino MEGA)
@ D9_PH6
Pin PH6 (D9 on Arduino MEGA)
@ A14
Pin PK6 (D68/A14 on Arduino MEGA)
@ A10
Pin PK2 (D64/A10 on Arduino MEGA)
@ D49
Pin PL0 (D49 on Arduino MEGA)
@ D43
Pin PL6 (D43 on Arduino MEGA)
@ D1
Pin PE1 (D1/TX0 on Arduino MEGA)
@ D58_PF4
Pin PF4 (D58/A4 on Arduino MEGA)
@ D38_PD7
Pin PD7 (D38 on Arduino MEGA)
@ D38
Pin PD7 (D38 on Arduino MEGA)
@ D19
Pin PD2 (D19 /RX1 on Arduino MEGA)
@ D22
Pin PA0 (D22 on Arduino MEGA)
@ LED
Shortcut for LED pin on Arduino.
@ D66_PK4
Pin PK4 (D66/A12 on Arduino MEGA)
@ D60_PF6
Pin PF6 (D60/A6 on Arduino MEGA)
@ D41_PG0
Pin PG0 (D41 on Arduino MEGA)
@ D53_PB0
Pin PB0 (D53/SS on Arduino MEGA)
@ A3
Pin PF3 (D57/A3 on Arduino MEGA)
@ D6_PH3
Pin PH3 (D6 on Arduino MEGA)
@ D34_PC3
Pin PC3 (D34 on Arduino MEGA)
@ D39_PG2
Pin PG2 (D39 on Arduino MEGA)
@ D44_PL5
Pin PL5 (D44 on Arduino MEGA)
@ D16
Pin PH1 (D16 /TX2 on Arduino MEGA)
@ D34
Pin PC3 (D34 on Arduino MEGA)
@ D33
Pin PC4 (D33 on Arduino MEGA)
@ D1_PE1
Pin PE1 (D1/TX0 on Arduino MEGA)
@ D31
Pin PC6 (D31 on Arduino MEGA)
@ D50
Pin PB3 (D50/MISO on Arduino MEGA)
@ D39
Pin PG2 (D39 on Arduino MEGA)
@ D12
Pin PB6 (D12 on Arduino MEGA)
@ D10
Pin PB4 (D10 on Arduino MEGA)
@ D27
Pin PA5 (D27 on Arduino MEGA)
@ D25
Pin PA3 (D25 on Arduino MEGA)
@ D24_PA2
Pin PA2 (D24 on Arduino MEGA)
@ D5_PE3
Pin PE3 (D5 on Arduino MEGA)
@ D27_PA5
Pin PA5 (D27 on Arduino MEGA)
@ D29_PA7
Pin PA7 (D29 on Arduino MEGA)
@ A9
Pin PK1 (D63/A9 on Arduino MEGA)
@ D47
Pin PL2 (D47 on Arduino MEGA)
@ D55_PF1
Pin PF1 (D55/A1 on Arduino MEGA)
@ D37_PC0
Pin PC0 (D37 on Arduino MEGA)
@ D7
Pin PH4 (D7 on Arduino MEGA)
@ D28_PA6
Pin PA6 (D28 on Arduino MEGA)
@ D68_PK6
Pin PK6 (D68/A14 on Arduino MEGA)
@ D59_PF5
Pin PF5 (D59/A5 on Arduino MEGA)
@ D35_PC2
Pin PC2 (D35 on Arduino MEGA)
@ D7_PH4
Pin PH4 (D7 on Arduino MEGA)
@ D3
Pin PE5 (D3 on Arduino MEGA)
@ D32
Pin PC5 (D32 on Arduino MEGA)
@ D36
Pin PC1 (D36 on Arduino MEGA)
@ D51
Pin PB2 (D51/MOSI on Arduino MEGA)
@ D52
Pin PB1 (D52/SCK on Arduino MEGA)
@ D45
Pin PL4 (D45 on Arduino MEGA)
@ D24
Pin PA2 (D24 on Arduino MEGA)
@ D53
Pin PB0 (D53/SS on Arduino MEGA)
@ D23
Pin PA1 (D23 on Arduino MEGA)
@ D9
Pin PH6 (D9 on Arduino MEGA)
@ D37
Pin PC0 (D37 on Arduino MEGA)
@ D46
Pin PL3 (D46 on Arduino MEGA)
@ D8
Pin PH5 (D8 on Arduino MEGA)
@ D28
Pin PA6 (D28 on Arduino MEGA)
@ D20_PD1
Pin PD1 (D20 /SDA on Arduino MEGA)
@ D14
Pin PJ1 (D14/TX3 on Arduino MEGA)
@ D8_PH5
Pin PH5 (D8 on Arduino MEGA)
@ D13
Pin PB7 (D13 on Arduino MEGA)
@ A7
Pin PF7 (D61/A7 on Arduino MEGA)
@ D52_PB1
Pin PB1 (D52/SCK on Arduino MEGA)
@ D11
Pin PB5 (D11 on Arduino MEGA)
@ D17_PH0
Pin PH0 (D17 /RX2 on Arduino MEGA)
@ D2
Pin PE4 (D3 on Arduino MEGA)
@ D48
Pin PL1 (D48 on Arduino MEGA)
@ D30_PC7
Pin PC7 (D30 on Arduino MEGA)
@ A2
Pin PF2 (D56/A2 on Arduino MEGA)
@ A5
Pin PF5 (D59/A5 on Arduino MEGA)
@ D21_PD0
Pin PD0 (D21 /SCL on Arduino MEGA)
@ A15
Pin PK7 (D69/A15 on Arduino MEGA)
@ D36_PC1
Pin PC1 (D36 on Arduino MEGA)
@ D63_PK1
Pin PK1 (D63/A9 on Arduino MEGA)
@ D26
Pin PA4 (D26 on Arduino MEGA)
@ D69_PK7
Pin PK7 (D69/A15 on Arduino MEGA)
@ D43_PL6
Pin PL6 (D43 on Arduino MEGA)
@ D16_PH1
Pin PH1 (D16 /TX2 on Arduino MEGA)
@ D23_PA1
Pin PA1 (D23 on Arduino MEGA)
@ A0
Pin PF0 (D54/A0 on Arduino MEGA)
@ D57_PF3
Pin PF3 (D57/A3 on Arduino MEGA)
@ D15_PJ0
Pin PJ0 (D15/RX3 on Arduino MEGA)
@ D6
Pin PH3 (D6 on Arduino MEGA)
@ D4_PG5
Pin PG5 (D4 on Arduino MEGA)
@ D44
Pin PL5 (D44 on Arduino MEGA)
@ D50_PB3
Pin PB3 (D50/MISO on Arduino MEGA)
@ D46_PL3
Pin PL3 (D46 on Arduino MEGA)
@ D5
Pin PE3 (D5 on Arduino MEGA)
@ D26_PA4
Pin PA4 (D26 on Arduino MEGA)
@ D20
Pin PD1 (D20 /SDA on Arduino MEGA)
@ D32_PC5
Pin PC5 (D32 on Arduino MEGA)
@ A13
Pin PK5 (D67/A13 on Arduino MEGA)
@ A11
Pin PK3 (D65/A11 on Arduino MEGA)
@ D67_PK5
Pin PK5 (D67/A13 on Arduino MEGA)
@ D40_PG1
Pin PG1 (D40 on Arduino MEGA)
@ D51_PB2
Pin PB2 (D51/MOSI on Arduino MEGA)
@ D31_PC6
Pin PC6 (D31 on Arduino MEGA)
@ A8
Pin PK0 (D62/A8 on Arduino MEGA)
@ D18_PD3
Pin PD3 (D18 /TX1 on Arduino MEGA)
@ D33_PC4
Pin PC4 (D33 on Arduino MEGA)
AnalogClock
Defines available clocks of ATmega2560, used for analog input.
Definition: mega.h:382
AnalogPin
Defines all available analog input pins of ATmega2560, with reference to Arduino MEGA pins.
Definition: mega.h:414
@ BANDGAP
Bandgap reference.
InterruptPin
Defines all digital output pins of ATmega2560, usable as pin change interrupt (PCI) pins.
Definition: mega.h:540
USART
Defines all USART modules of ATmega2560.
Definition: mega.h:597
@ USART1
USART1 is connected to pins D18_PD3 (TX1) and D19_PD2 (RX1).
@ USART3
USART3 is connected to pins D14_PJ1 (TX3) and D15_PJ0 (RX3).
@ USART2
USART2 is connected to pins D16_PH1 (TX2) and D17_PH0 (RX2).
@ USART0
On Arduino MEGA, USART0 is connected to USB, ans is also connected to pins D1_PE1 (TX0) and D0_PE0 (R...
Timer
Defines all timers available for ATmega2560.
Definition: mega.h:615
@ TIMER3
Timer3 (16 bits)
@ TIMER1
Timer1 (16 bits)
@ TIMER0
Timer0 (8 bits)
@ TIMER4
Timer4 (16 bits)
@ TIMER2
Timer2 (8 bits)
@ TIMER5
Timer5 (16 bits)
ExternalInterruptPin
Defines all digital output pins of ATmega2560, usable as direct external interrupt pins.
Definition: mega.h:515
SleepMode
Defines all available sleep modes for ATmega2560.
Definition: mega.h:634
@ EXTENDED_STANDBY
This mode is similar to POWER_SAVE, except the oscillator is kept running, hence waking up from this ...
@ ADC_NOISE_REDUCTION
In this mode, CPU is stopped but other peripherals and interrupts work normally, except IO.
@ POWER_DOWN
In this mode, everything is stopped (including oscillator) but external interrupts,...
@ IDLE
In this mode, CPU is stopped but all other peripherals and interrupts work normally.
@ STANDBY
This mode is similar to POWER_DOWN, except the oscillator is kept running, hence waking up from this ...
@ POWER_SAVE
This mode is similar to POWER_DOWN, except Timer2 is still running if enabled.
AnalogReference
Defines available voltage references of ATmega2560, used for analog input.
Definition: mega.h:394
@ INTERNAL_2_56V
Voltage reference is internal 2.56V reference, generated from the internal bandgap reference.
@ INTERNAL_1_1V
Voltage reference is internal 1.1V reference, generated from the internal bandgap reference.
@ AREF
Voltage reference is given by the AREF pin.
@ AVCC
Voltage reference is given by the AVcc pin.