aboutsummaryrefslogtreecommitdiff
path: root/variants/leonardo
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-11-16 11:20:38 -0500
committerZach Eveland <zeveland@blacklabel-development.com>2011-11-16 11:20:38 -0500
commit21a81fba93250ce39e21e426e06681bef46d21c7 (patch)
treec072030e4d40f1ed571428e2f69720dc8b776bad /variants/leonardo
parent8dffa6755b184893693a0fa7e5ad839fc72320f0 (diff)
Updated digital pin and port mapping constants in pins_arduino.h for Leonardo.
Changed digital_pin_to_port_PGM[] and digital_pin_to_bit_mask_PGM[] to reflect changes to constants for SPI and analog pins
Diffstat (limited to 'variants/leonardo')
-rw-r--r--variants/leonardo/pins_arduino.h102
1 files changed, 64 insertions, 38 deletions
diff --git a/variants/leonardo/pins_arduino.h b/variants/leonardo/pins_arduino.h
index 6bbc9d8..f8cbce7 100644
--- a/variants/leonardo/pins_arduino.h
+++ b/variants/leonardo/pins_arduino.h
@@ -94,7 +94,7 @@ extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
// A4 D22 PF1 ADC1
// A5 D23 PF0 ADC0
//
-// New pins D14..D17 to map SPI port to digitial pins
+// New pins D14..D17 to map SPI port to digital pins
//
// MISO D14 PB3 MISO,PCINT3
// SCK D15 PB1 SCK,PCINT1
@@ -138,52 +138,78 @@ const uint16_t PROGMEM port_to_input_PGM[] = {
(uint16_t) &PINF,
};
-const uint8_t PROGMEM digital_pin_to_port_PGM[18] = {
- PD, /* 0 */
- PD,
- PD,
- PD,
- PD,
- PC, /* 5 */
- PD, /* 6 */
- PE, /* 7 */
+const uint8_t PROGMEM digital_pin_to_port_PGM[30] = {
+ PD, // D0 - PD2
+ PD, // D1 - PD3
+ PD, // D2 - PD1
+ PD, // D3 - PD0
+ PD, // D4 - PD4
+ PC, // D5 - PC6
+ PD, // D6 - PD7
+ PE, // D7 - PE6
- PB, /* 8 */
- PB,
- PB,
- PB,
+ PB, // D8 - PB4
+ PB, // D9 - PB5
+ PB, // D10 - PB6
+ PB, // D11 - PB7
+ PD, // D12 - PD6
+ PC, // D13 - PC7
- PD, /* 12 */
- PC, /* 13 */
+ PB, // D14 - MISO - PB3
+ PB, // D15 - SCK - PB1
+ PB, // D16 - MOSI - PB2
+ PB, // D17 - SS - PB0
- PB, /* 14 */
- PB, /* 15 */
- PB, /* 16 */
- PB, /* 17 */
+ PF, // D18 - A0 - PF7
+ PF, // D19 - A1 - PF6
+ PF, // D20 - A2 - PF5
+ PF, // D21 - A3 - PF4
+ PF, // D22 - A4 - PF1
+ PF, // D23 - A5 - PF0
+
+ PD, // D24 / D4 - A6 - PD4
+ PD, // D25 / D6 - A7 - PD7
+ PB, // D26 / D8 - A8 - PB4
+ PB, // D27 / D9 - A9 - PB5
+ PB, // D28 / D10 - A10 - PB6
+ PD, // D29 / D12 - A11 - PD6
};
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[18] = {
- _BV(2), /* 0, port D */
- _BV(3),
- _BV(1),
- _BV(0),
- _BV(4),
- _BV(6), /* 5, port C */
- _BV(7), /* 6, port D */
- _BV(6), /* 7, port E */
+ _BV(2), // D0 - PD2
+ _BV(3), // D1 - PD3
+ _BV(1), // D2 - PD1
+ _BV(0), // D3 - PD0
+ _BV(4), // D4 - PD4
+ _BV(6), // D5 - PC6
+ _BV(7), // D6 - PD7
+ _BV(6), // D7 - PE6
+
+ _BV(4), // D8 - PB4
+ _BV(5), // D9 - PB5
+ _BV(6), // D10 - PB6
+ _BV(7), // D11 - PB7
+ _BV(6), // D12 - PD6
+ _BV(7), // D13 - PC7
- _BV(4), /* 8, port B */
- _BV(5),
- _BV(6),
- _BV(7),
+ _BV(3), // D14 - MISO - PB3
+ _BV(1), // D15 - SCK - PB1
+ _BV(2), // D16 - MOSI - PB2
+ _BV(0), // D17 - SS - PB0
- _BV(6), /* 12 port D */
- _BV(7),
+ _BV(7), // D18 - A0 - PF7
+ _BV(6), // D19 - A1 - PF6
+ _BV(5), // D20 - A2 - PF5
+ _BV(4), // D21 - A3 - PF4
+ _BV(1), // D22 - A4 - PF1
+ _BV(0), // D23 - A5 - PF0
- _BV(0), /* 14, port B */
- _BV(1),
- _BV(2),
- _BV(3),
+ _BV(4), // D24 / D4 - A6 - PD4
+ _BV(7), // D25 / D6 - A7 - PD7
+ _BV(4), // D26 / D8 - A8 - PB4
+ _BV(5), // D27 / D9 - A9 - PB5
+ _BV(6), // D28 / D10 - A10 - PB6
+ _BV(6), // D29 / D12 - A11 - PD6
};
const uint8_t PROGMEM digital_pin_to_timer_PGM[18] = {