diff options
Diffstat (limited to 'variants')
-rw-r--r-- | variants/leonardo/pins_arduino.h | 94 |
1 files changed, 22 insertions, 72 deletions
diff --git a/variants/leonardo/pins_arduino.h b/variants/leonardo/pins_arduino.h index cfb4579..e2253ea 100644 --- a/variants/leonardo/pins_arduino.h +++ b/variants/leonardo/pins_arduino.h @@ -56,6 +56,7 @@ const static uint8_t A7 = 21; const static uint8_t A8 = 22; const static uint8_t A9 = 23; const static uint8_t A10 = 24; +const static uint8_t A11 = 25; // __AVR_ATmega32U4__ has an unusual mapping of pins to channels extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; @@ -67,41 +68,6 @@ extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; // for the analog output (software PWM). Analog input // pins are a separate set. -// ATMEL ATMEGA8 & 168 / ARDUINO -// -// +-\/-+ -// PC6 1| |28 PC5 (AI 5) -// (D 0) PD0 2| |27 PC4 (AI 4) -// (D 1) PD1 3| |26 PC3 (AI 3) -// (D 2) PD2 4| |25 PC2 (AI 2) -// PWM+ (D 3) PD3 5| |24 PC1 (AI 1) -// (D 4) PD4 6| |23 PC0 (AI 0) -// VCC 7| |22 GND -// GND 8| |21 AREF -// PB6 9| |20 AVCC -// PB7 10| |19 PB5 (D 13) -// PWM+ (D 5) PD5 11| |18 PB4 (D 12) -// PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM -// (D 7) PD7 13| |16 PB2 (D 10) PWM -// (D 8) PB0 14| |15 PB1 (D 9) PWM -// +----+ -// -// (PWM+ indicates the additional PWM pins on the ATmega168.) - -// ATMEL ATMEGA1280 / ARDUINO -// -// 0-7 PE0-PE7 works -// 8-13 PB0-PB5 works -// 14-21 PA0-PA7 works -// 22-29 PH0-PH7 works -// 30-35 PG5-PG0 works -// 36-43 PC7-PC0 works -// 44-51 PJ7-PJ0 works -// 52-59 PL7-PL0 works -// 60-67 PD7-PD0 works -// A0-A7 PF0-PF7 -// A8-A15 PK0-PK7 - // ATMEL ATMEGA32U4 / ARDUINO LEONARDO // // D0 PD2 RXD1/INT2 @@ -110,14 +76,14 @@ extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; // D3# PD0 PWM8/SCL OC0B/SCL/INT0 // D4 A6 PD4 ADC8 // D5# PC6 ??? OC3A/#OC4A -// D6# A7 PD7 FastPWM #OC4D/ADC10 -// D7 PE6 INT6/AIN0 +// D6# A8 PD7 FastPWM #OC4D/ADC10 +// D7 Ain0 PE6 INT6/AIN0 // -// D8 PB4 ADC11/PCINT4 -// D9# A8 PB5 PWM16 OC1A/#OC4B/ADC13/PCINT5 -// D10# A9 PB6 PWM16 OC1B/0c4B/ADC12/PCINT6 +// D8 A9 PB4 ADC11/PCINT4 +// D9# A10 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 +// D10# A11 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 // D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 -// D12 A10 PD6 T1/#OC4D/ADC9 +// D12 A7 PD6 T1/#OC4D/ADC9 // D13# PC7 PWM10 CLK0/OC4A // // A0 PF7 ADC7 @@ -138,7 +104,6 @@ extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; // RXLED PB0 // HWB PE2 HWB - // these arrays map port names (e.g. port B) to the // appropriate addresses for various functions (e.g. reading // and writing) @@ -242,35 +207,20 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[18] = { NOT_ON_TIMER, }; -const uint8_t PROGMEM analog_pin_to_channel_PGM[11] = { - /* - A0 PF7 ADC7 - A1 PF6 ADC6 - A2 PF5 ADC5 - A3 PF4 ADC4 - A4 PF1 ADC1 - A5 PF0 ADC0 - D4 A6 PD4 ADC8 - D6 A7 PD7 FastPWM #OC4D/ADC10 - D9 A8 PB5 PWM16 OC1A/#OC4B/ADC13/PCINT5 - D10 A9 PB6 PWM16 OC1B/0c4B/ADC12/PCINT6 - D12 A10 PD6 T1/#OC4D/ADC9 - */ - - 7, - 6, - 5, - 4, - 1, - 0, - 8, - 10, - - 13, - 12, - 9 +const uint8_t PROGMEM analog_pin_to_channel_PGM[12] = { + 7, // A0 PF7 ADC7 + 6, // A1 PF6 ADC6 + 5, // A2 PF5 ADC5 + 4, // A3 PF4 ADC4 + 1, // A4 PF1 ADC1 + 0, // A5 PF0 ADC0 + 8, // D4 A6 PD4 ADC8 + 9, // D12 A7 PD6 T1/#OC4D/ADC9 + 10, // D6# A8 PD7 FastPWM #OC4D/ADC10 + 11, // D8 A9 PB4 ADC11/PCINT4 + 12, // D9# A10 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 + 13 // D10# A11 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 }; -#endif - -#endif
\ No newline at end of file +#endif /* ARDUINO_MAIN */ +#endif /* Pins_Arduino_h */ |