aboutsummaryrefslogtreecommitdiff
path: root/protocol/usb_hid/arduino-1.0.1/variants
diff options
context:
space:
mode:
Diffstat (limited to 'protocol/usb_hid/arduino-1.0.1/variants')
-rw-r--r--protocol/usb_hid/arduino-1.0.1/variants/eightanaloginputs/pins_arduino.h27
-rw-r--r--protocol/usb_hid/arduino-1.0.1/variants/leonardo/pins_arduino.h256
-rw-r--r--protocol/usb_hid/arduino-1.0.1/variants/mega/pins_arduino.h363
-rw-r--r--protocol/usb_hid/arduino-1.0.1/variants/standard/pins_arduino.h218
4 files changed, 864 insertions, 0 deletions
diff --git a/protocol/usb_hid/arduino-1.0.1/variants/eightanaloginputs/pins_arduino.h b/protocol/usb_hid/arduino-1.0.1/variants/eightanaloginputs/pins_arduino.h
new file mode 100644
index 000000000..52b37efc4
--- /dev/null
+++ b/protocol/usb_hid/arduino-1.0.1/variants/eightanaloginputs/pins_arduino.h
@@ -0,0 +1,27 @@
1/*
2 pins_arduino.h - Pin definition functions for Arduino
3 Part of Arduino - http://www.arduino.cc/
4
5 Copyright (c) 2007 David A. Mellis
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General
18 Public License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 Boston, MA 02111-1307 USA
21
22 $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
23*/
24
25#include "../standard/pins_arduino.h"
26#undef NUM_ANALOG_INPUTS
27#define NUM_ANALOG_INPUTS 8
diff --git a/protocol/usb_hid/arduino-1.0.1/variants/leonardo/pins_arduino.h b/protocol/usb_hid/arduino-1.0.1/variants/leonardo/pins_arduino.h
new file mode 100644
index 000000000..9f770d6ce
--- /dev/null
+++ b/protocol/usb_hid/arduino-1.0.1/variants/leonardo/pins_arduino.h
@@ -0,0 +1,256 @@
1/*
2 pins_arduino.h - Pin definition functions for Arduino
3 Part of Arduino - http://www.arduino.cc/
4
5 Copyright (c) 2007 David A. Mellis
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General
18 Public License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 Boston, MA 02111-1307 USA
21
22 $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
23*/
24
25#ifndef Pins_Arduino_h
26#define Pins_Arduino_h
27
28#include <avr/pgmspace.h>
29
30#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
31#define TXLED0 PORTD |= (1<<5)
32#define TXLED1 PORTD &= ~(1<<5)
33#define RXLED0 PORTB |= (1<<0)
34#define RXLED1 PORTB &= ~(1<<0)
35
36static const uint8_t SDA = 2;
37static const uint8_t SCL = 3;
38
39// Map SPI port to 'new' pins D14..D17
40static const uint8_t SS = 17;
41static const uint8_t MOSI = 16;
42static const uint8_t MISO = 14;
43static const uint8_t SCK = 15;
44
45// Mapping of analog pins as digital I/O
46// A6-A11 share with digital pins
47static const uint8_t A0 = 18;
48static const uint8_t A1 = 19;
49static const uint8_t A2 = 20;
50static const uint8_t A3 = 21;
51static const uint8_t A4 = 22;
52static const uint8_t A5 = 23;
53static const uint8_t A6 = 24; // D4
54static const uint8_t A7 = 25; // D6
55static const uint8_t A8 = 26; // D8
56static const uint8_t A9 = 27; // D9
57static const uint8_t A10 = 28; // D10
58static const uint8_t A11 = 29; // D12
59
60#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
61#define digitalPinToPCICRbit(p) 0
62#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
63#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))
64
65// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
66extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
67#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )
68
69#ifdef ARDUINO_MAIN
70
71// On the Arduino board, digital pins are also used
72// for the analog output (software PWM). Analog input
73// pins are a separate set.
74
75// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
76//
77// D0 PD2 RXD1/INT2
78// D1 PD3 TXD1/INT3
79// D2 PD1 SDA SDA/INT1
80// D3# PD0 PWM8/SCL OC0B/SCL/INT0
81// D4 A6 PD4 ADC8
82// D5# PC6 ??? OC3A/#OC4A
83// D6# A7 PD7 FastPWM #OC4D/ADC10
84// D7 PE6 INT6/AIN0
85//
86// D8 A8 PB4 ADC11/PCINT4
87// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5
88// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6
89// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
90// D12 A11 PD6 T1/#OC4D/ADC9
91// D13# PC7 PWM10 CLK0/OC4A
92//
93// A0 D18 PF7 ADC7
94// A1 D19 PF6 ADC6
95// A2 D20 PF5 ADC5
96// A3 D21 PF4 ADC4
97// A4 D22 PF1 ADC1
98// A5 D23 PF0 ADC0
99//
100// New pins D14..D17 to map SPI port to digital pins
101//
102// MISO D14 PB3 MISO,PCINT3
103// SCK D15 PB1 SCK,PCINT1
104// MOSI D16 PB2 MOSI,PCINT2
105// SS D17 PB0 RXLED,SS/PCINT0
106//
107// TXLED PD5
108// RXLED PB0
109// HWB PE2 HWB
110
111// these arrays map port names (e.g. port B) to the
112// appropriate addresses for various functions (e.g. reading
113// and writing)
114const uint16_t PROGMEM port_to_mode_PGM[] = {
115 NOT_A_PORT,
116 NOT_A_PORT,
117 (uint16_t) &DDRB,
118 (uint16_t) &DDRC,
119 (uint16_t) &DDRD,
120 (uint16_t) &DDRE,
121 (uint16_t) &DDRF,
122};
123
124const uint16_t PROGMEM port_to_output_PGM[] = {
125 NOT_A_PORT,
126 NOT_A_PORT,
127 (uint16_t) &PORTB,
128 (uint16_t) &PORTC,
129 (uint16_t) &PORTD,
130 (uint16_t) &PORTE,
131 (uint16_t) &PORTF,
132};
133
134const uint16_t PROGMEM port_to_input_PGM[] = {
135 NOT_A_PORT,
136 NOT_A_PORT,
137 (uint16_t) &PINB,
138 (uint16_t) &PINC,
139 (uint16_t) &PIND,
140 (uint16_t) &PINE,
141 (uint16_t) &PINF,
142};
143
144const uint8_t PROGMEM digital_pin_to_port_PGM[30] = {
145 PD, // D0 - PD2
146 PD, // D1 - PD3
147 PD, // D2 - PD1
148 PD, // D3 - PD0
149 PD, // D4 - PD4
150 PC, // D5 - PC6
151 PD, // D6 - PD7
152 PE, // D7 - PE6
153
154 PB, // D8 - PB4
155 PB, // D9 - PB5
156 PB, // D10 - PB6
157 PB, // D11 - PB7
158 PD, // D12 - PD6
159 PC, // D13 - PC7
160
161 PB, // D14 - MISO - PB3
162 PB, // D15 - SCK - PB1
163 PB, // D16 - MOSI - PB2
164 PB, // D17 - SS - PB0
165
166 PF, // D18 - A0 - PF7
167 PF, // D19 - A1 - PF6
168 PF, // D20 - A2 - PF5
169 PF, // D21 - A3 - PF4
170 PF, // D22 - A4 - PF1
171 PF, // D23 - A5 - PF0
172
173 PD, // D24 / D4 - A6 - PD4
174 PD, // D25 / D6 - A7 - PD7
175 PB, // D26 / D8 - A8 - PB4
176 PB, // D27 / D9 - A9 - PB5
177 PB, // D28 / D10 - A10 - PB6
178 PD, // D29 / D12 - A11 - PD6
179};
180
181const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[30] = {
182 _BV(2), // D0 - PD2
183 _BV(3), // D1 - PD3
184 _BV(1), // D2 - PD1
185 _BV(0), // D3 - PD0
186 _BV(4), // D4 - PD4
187 _BV(6), // D5 - PC6
188 _BV(7), // D6 - PD7
189 _BV(6), // D7 - PE6
190
191 _BV(4), // D8 - PB4
192 _BV(5), // D9 - PB5
193 _BV(6), // D10 - PB6
194 _BV(7), // D11 - PB7
195 _BV(6), // D12 - PD6
196 _BV(7), // D13 - PC7
197
198 _BV(3), // D14 - MISO - PB3
199 _BV(1), // D15 - SCK - PB1
200 _BV(2), // D16 - MOSI - PB2
201 _BV(0), // D17 - SS - PB0
202
203 _BV(7), // D18 - A0 - PF7
204 _BV(6), // D19 - A1 - PF6
205 _BV(5), // D20 - A2 - PF5
206 _BV(4), // D21 - A3 - PF4
207 _BV(1), // D22 - A4 - PF1
208 _BV(0), // D23 - A5 - PF0
209
210 _BV(4), // D24 / D4 - A6 - PD4
211 _BV(7), // D25 / D6 - A7 - PD7
212 _BV(4), // D26 / D8 - A8 - PB4
213 _BV(5), // D27 / D9 - A9 - PB5
214 _BV(6), // D28 / D10 - A10 - PB6
215 _BV(6), // D29 / D12 - A11 - PD6
216};
217
218const uint8_t PROGMEM digital_pin_to_timer_PGM[16] = {
219 NOT_ON_TIMER,
220 NOT_ON_TIMER,
221 NOT_ON_TIMER,
222 TIMER0B, /* 3 */
223 NOT_ON_TIMER,
224 TIMER3A, /* 5 */
225 TIMER4D, /* 6 */
226 NOT_ON_TIMER,
227
228 NOT_ON_TIMER,
229 TIMER1A, /* 9 */
230 TIMER1B, /* 10 */
231 TIMER0A, /* 11 */
232
233 NOT_ON_TIMER,
234 TIMER4A, /* 13 */
235
236 NOT_ON_TIMER,
237 NOT_ON_TIMER,
238};
239
240const uint8_t PROGMEM analog_pin_to_channel_PGM[12] = {
241 7, // A0 PF7 ADC7
242 6, // A1 PF6 ADC6
243 5, // A2 PF5 ADC5
244 4, // A3 PF4 ADC4
245 1, // A4 PF1 ADC1
246 0, // A5 PF0 ADC0
247 8, // A6 D4 PD4 ADC8
248 10, // A7 D6 PD7 ADC10
249 11, // A8 D8 PB4 ADC11
250 12, // A9 D9 PB5 ADC12
251 13, // A10 D10 PB6 ADC13
252 9 // A11 D12 PD6 ADC9
253};
254
255#endif /* ARDUINO_MAIN */
256#endif /* Pins_Arduino_h */
diff --git a/protocol/usb_hid/arduino-1.0.1/variants/mega/pins_arduino.h b/protocol/usb_hid/arduino-1.0.1/variants/mega/pins_arduino.h
new file mode 100644
index 000000000..5a9b4cb09
--- /dev/null
+++ b/protocol/usb_hid/arduino-1.0.1/variants/mega/pins_arduino.h
@@ -0,0 +1,363 @@
1/*
2 pins_arduino.h - Pin definition functions for Arduino
3 Part of Arduino - http://www.arduino.cc/
4
5 Copyright (c) 2007 David A. Mellis
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General
18 Public License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 Boston, MA 02111-1307 USA
21
22 $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
23*/
24
25#ifndef Pins_Arduino_h
26#define Pins_Arduino_h
27
28#include <avr/pgmspace.h>
29
30#define NUM_DIGITAL_PINS 70
31#define NUM_ANALOG_INPUTS 16
32#define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
33#define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))
34
35static const uint8_t SS = 53;
36static const uint8_t MOSI = 51;
37static const uint8_t MISO = 50;
38static const uint8_t SCK = 52;
39
40static const uint8_t SDA = 20;
41static const uint8_t SCL = 21;
42static const uint8_t LED_BUILTIN = 13;
43
44static const uint8_t A0 = 54;
45static const uint8_t A1 = 55;
46static const uint8_t A2 = 56;
47static const uint8_t A3 = 57;
48static const uint8_t A4 = 58;
49static const uint8_t A5 = 59;
50static const uint8_t A6 = 60;
51static const uint8_t A7 = 61;
52static const uint8_t A8 = 62;
53static const uint8_t A9 = 63;
54static const uint8_t A10 = 64;
55static const uint8_t A11 = 65;
56static const uint8_t A12 = 66;
57static const uint8_t A13 = 67;
58static const uint8_t A14 = 68;
59static const uint8_t A15 = 69;
60
61// A majority of the pins are NOT PCINTs, SO BE WARNED (i.e. you cannot use them as receive pins)
62// Only pins available for RECEIVE (TRANSMIT can be on any pin):
63// (I've deliberately left out pin mapping to the Hardware USARTs - seems senseless to me)
64// Pins: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
65
66#define digitalPinToPCICR(p) ( (((p) >= 10) && ((p) <= 13)) || \
67 (((p) >= 50) && ((p) <= 53)) || \
68 (((p) >= 62) && ((p) <= 69)) ? (&PCICR) : ((uint8_t *)0) )
69
70#define digitalPinToPCICRbit(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? 0 : \
71 ( (((p) >= 62) && ((p) <= 69)) ? 2 : \
72 0 ) )
73
74#define digitalPinToPCMSK(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? (&PCMSK0) : \
75 ( (((p) >= 62) && ((p) <= 69)) ? (&PCMSK2) : \
76 ((uint8_t *)0) ) )
77
78#define digitalPinToPCMSKbit(p) ( (((p) >= 10) && ((p) <= 13)) ? ((p) - 6) : \
79 ( ((p) == 50) ? 3 : \
80 ( ((p) == 51) ? 2 : \
81 ( ((p) == 52) ? 1 : \
82 ( ((p) == 53) ? 0 : \
83 ( (((p) >= 62) && ((p) <= 69)) ? ((p) - 62) : \
84 0 ) ) ) ) ) )
85
86#ifdef ARDUINO_MAIN
87
88const uint16_t PROGMEM port_to_mode_PGM[] = {
89 NOT_A_PORT,
90 (uint16_t) &DDRA,
91 (uint16_t) &DDRB,
92 (uint16_t) &DDRC,
93 (uint16_t) &DDRD,
94 (uint16_t) &DDRE,
95 (uint16_t) &DDRF,
96 (uint16_t) &DDRG,
97 (uint16_t) &DDRH,
98 NOT_A_PORT,
99 (uint16_t) &DDRJ,
100 (uint16_t) &DDRK,
101 (uint16_t) &DDRL,
102};
103
104const uint16_t PROGMEM port_to_output_PGM[] = {
105 NOT_A_PORT,
106 (uint16_t) &PORTA,
107 (uint16_t) &PORTB,
108 (uint16_t) &PORTC,
109 (uint16_t) &PORTD,
110 (uint16_t) &PORTE,
111 (uint16_t) &PORTF,
112 (uint16_t) &PORTG,
113 (uint16_t) &PORTH,
114 NOT_A_PORT,
115 (uint16_t) &PORTJ,
116 (uint16_t) &PORTK,
117 (uint16_t) &PORTL,
118};
119
120const uint16_t PROGMEM port_to_input_PGM[] = {
121 NOT_A_PIN,
122 (uint16_t) &PINA,
123 (uint16_t) &PINB,
124 (uint16_t) &PINC,
125 (uint16_t) &PIND,
126 (uint16_t) &PINE,
127 (uint16_t) &PINF,
128 (uint16_t) &PING,
129 (uint16_t) &PINH,
130 NOT_A_PIN,
131 (uint16_t) &PINJ,
132 (uint16_t) &PINK,
133 (uint16_t) &PINL,
134};
135
136const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
137 // PORTLIST
138 // -------------------------------------------
139 PE , // PE 0 ** 0 ** USART0_RX
140 PE , // PE 1 ** 1 ** USART0_TX
141 PE , // PE 4 ** 2 ** PWM2
142 PE , // PE 5 ** 3 ** PWM3
143 PG , // PG 5 ** 4 ** PWM4
144 PE , // PE 3 ** 5 ** PWM5
145 PH , // PH 3 ** 6 ** PWM6
146 PH , // PH 4 ** 7 ** PWM7
147 PH , // PH 5 ** 8 ** PWM8
148 PH , // PH 6 ** 9 ** PWM9
149 PB , // PB 4 ** 10 ** PWM10
150 PB , // PB 5 ** 11 ** PWM11
151 PB , // PB 6 ** 12 ** PWM12
152 PB , // PB 7 ** 13 ** PWM13
153 PJ , // PJ 1 ** 14 ** USART3_TX
154 PJ , // PJ 0 ** 15 ** USART3_RX
155 PH , // PH 1 ** 16 ** USART2_TX
156 PH , // PH 0 ** 17 ** USART2_RX
157 PD , // PD 3 ** 18 ** USART1_TX
158 PD , // PD 2 ** 19 ** USART1_RX
159 PD , // PD 1 ** 20 ** I2C_SDA
160 PD , // PD 0 ** 21 ** I2C_SCL
161 PA , // PA 0 ** 22 ** D22
162 PA , // PA 1 ** 23 ** D23
163 PA , // PA 2 ** 24 ** D24
164 PA , // PA 3 ** 25 ** D25
165 PA , // PA 4 ** 26 ** D26
166 PA , // PA 5 ** 27 ** D27
167 PA , // PA 6 ** 28 ** D28
168 PA , // PA 7 ** 29 ** D29
169 PC , // PC 7 ** 30 ** D30
170 PC , // PC 6 ** 31 ** D31
171 PC , // PC 5 ** 32 ** D32
172 PC , // PC 4 ** 33 ** D33
173 PC , // PC 3 ** 34 ** D34
174 PC , // PC 2 ** 35 ** D35
175 PC , // PC 1 ** 36 ** D36
176 PC , // PC 0 ** 37 ** D37
177 PD , // PD 7 ** 38 ** D38
178 PG , // PG 2 ** 39 ** D39
179 PG , // PG 1 ** 40 ** D40
180 PG , // PG 0 ** 41 ** D41
181 PL , // PL 7 ** 42 ** D42
182 PL , // PL 6 ** 43 ** D43
183 PL , // PL 5 ** 44 ** D44
184 PL , // PL 4 ** 45 ** D45
185 PL , // PL 3 ** 46 ** D46
186 PL , // PL 2 ** 47 ** D47
187 PL , // PL 1 ** 48 ** D48
188 PL , // PL 0 ** 49 ** D49
189 PB , // PB 3 ** 50 ** SPI_MISO
190 PB , // PB 2 ** 51 ** SPI_MOSI
191 PB , // PB 1 ** 52 ** SPI_SCK
192 PB , // PB 0 ** 53 ** SPI_SS
193 PF , // PF 0 ** 54 ** A0
194 PF , // PF 1 ** 55 ** A1
195 PF , // PF 2 ** 56 ** A2
196 PF , // PF 3 ** 57 ** A3
197 PF , // PF 4 ** 58 ** A4
198 PF , // PF 5 ** 59 ** A5
199 PF , // PF 6 ** 60 ** A6
200 PF , // PF 7 ** 61 ** A7
201 PK , // PK 0 ** 62 ** A8
202 PK , // PK 1 ** 63 ** A9
203 PK , // PK 2 ** 64 ** A10
204 PK , // PK 3 ** 65 ** A11
205 PK , // PK 4 ** 66 ** A12
206 PK , // PK 5 ** 67 ** A13
207 PK , // PK 6 ** 68 ** A14
208 PK , // PK 7 ** 69 ** A15
209};
210
211const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
212 // PIN IN PORT
213 // -------------------------------------------
214 _BV( 0 ) , // PE 0 ** 0 ** USART0_RX
215 _BV( 1 ) , // PE 1 ** 1 ** USART0_TX
216 _BV( 4 ) , // PE 4 ** 2 ** PWM2
217 _BV( 5 ) , // PE 5 ** 3 ** PWM3
218 _BV( 5 ) , // PG 5 ** 4 ** PWM4
219 _BV( 3 ) , // PE 3 ** 5 ** PWM5
220 _BV( 3 ) , // PH 3 ** 6 ** PWM6
221 _BV( 4 ) , // PH 4 ** 7 ** PWM7
222 _BV( 5 ) , // PH 5 ** 8 ** PWM8
223 _BV( 6 ) , // PH 6 ** 9 ** PWM9
224 _BV( 4 ) , // PB 4 ** 10 ** PWM10
225 _BV( 5 ) , // PB 5 ** 11 ** PWM11
226 _BV( 6 ) , // PB 6 ** 12 ** PWM12
227 _BV( 7 ) , // PB 7 ** 13 ** PWM13
228 _BV( 1 ) , // PJ 1 ** 14 ** USART3_TX
229 _BV( 0 ) , // PJ 0 ** 15 ** USART3_RX
230 _BV( 1 ) , // PH 1 ** 16 ** USART2_TX
231 _BV( 0 ) , // PH 0 ** 17 ** USART2_RX
232 _BV( 3 ) , // PD 3 ** 18 ** USART1_TX
233 _BV( 2 ) , // PD 2 ** 19 ** USART1_RX
234 _BV( 1 ) , // PD 1 ** 20 ** I2C_SDA
235 _BV( 0 ) , // PD 0 ** 21 ** I2C_SCL
236 _BV( 0 ) , // PA 0 ** 22 ** D22
237 _BV( 1 ) , // PA 1 ** 23 ** D23
238 _BV( 2 ) , // PA 2 ** 24 ** D24
239 _BV( 3 ) , // PA 3 ** 25 ** D25
240 _BV( 4 ) , // PA 4 ** 26 ** D26
241 _BV( 5 ) , // PA 5 ** 27 ** D27
242 _BV( 6 ) , // PA 6 ** 28 ** D28
243 _BV( 7 ) , // PA 7 ** 29 ** D29
244 _BV( 7 ) , // PC 7 ** 30 ** D30
245 _BV( 6 ) , // PC 6 ** 31 ** D31
246 _BV( 5 ) , // PC 5 ** 32 ** D32
247 _BV( 4 ) , // PC 4 ** 33 ** D33
248 _BV( 3 ) , // PC 3 ** 34 ** D34
249 _BV( 2 ) , // PC 2 ** 35 ** D35
250 _BV( 1 ) , // PC 1 ** 36 ** D36
251 _BV( 0 ) , // PC 0 ** 37 ** D37
252 _BV( 7 ) , // PD 7 ** 38 ** D38
253 _BV( 2 ) , // PG 2 ** 39 ** D39
254 _BV( 1 ) , // PG 1 ** 40 ** D40
255 _BV( 0 ) , // PG 0 ** 41 ** D41
256 _BV( 7 ) , // PL 7 ** 42 ** D42
257 _BV( 6 ) , // PL 6 ** 43 ** D43
258 _BV( 5 ) , // PL 5 ** 44 ** D44
259 _BV( 4 ) , // PL 4 ** 45 ** D45
260 _BV( 3 ) , // PL 3 ** 46 ** D46
261 _BV( 2 ) , // PL 2 ** 47 ** D47
262 _BV( 1 ) , // PL 1 ** 48 ** D48
263 _BV( 0 ) , // PL 0 ** 49 ** D49
264 _BV( 3 ) , // PB 3 ** 50 ** SPI_MISO
265 _BV( 2 ) , // PB 2 ** 51 ** SPI_MOSI
266 _BV( 1 ) , // PB 1 ** 52 ** SPI_SCK
267 _BV( 0 ) , // PB 0 ** 53 ** SPI_SS
268 _BV( 0 ) , // PF 0 ** 54 ** A0
269 _BV( 1 ) , // PF 1 ** 55 ** A1
270 _BV( 2 ) , // PF 2 ** 56 ** A2
271 _BV( 3 ) , // PF 3 ** 57 ** A3
272 _BV( 4 ) , // PF 4 ** 58 ** A4
273 _BV( 5 ) , // PF 5 ** 59 ** A5
274 _BV( 6 ) , // PF 6 ** 60 ** A6
275 _BV( 7 ) , // PF 7 ** 61 ** A7
276 _BV( 0 ) , // PK 0 ** 62 ** A8
277 _BV( 1 ) , // PK 1 ** 63 ** A9
278 _BV( 2 ) , // PK 2 ** 64 ** A10
279 _BV( 3 ) , // PK 3 ** 65 ** A11
280 _BV( 4 ) , // PK 4 ** 66 ** A12
281 _BV( 5 ) , // PK 5 ** 67 ** A13
282 _BV( 6 ) , // PK 6 ** 68 ** A14
283 _BV( 7 ) , // PK 7 ** 69 ** A15
284};
285
286const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
287 // TIMERS
288 // -------------------------------------------
289 NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX
290 NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX
291 TIMER3B , // PE 4 ** 2 ** PWM2
292 TIMER3C , // PE 5 ** 3 ** PWM3
293 TIMER0B , // PG 5 ** 4 ** PWM4
294 TIMER3A , // PE 3 ** 5 ** PWM5
295 TIMER4A , // PH 3 ** 6 ** PWM6
296 TIMER4B , // PH 4 ** 7 ** PWM7
297 TIMER4C , // PH 5 ** 8 ** PWM8
298 TIMER2B , // PH 6 ** 9 ** PWM9
299 TIMER2A , // PB 4 ** 10 ** PWM10
300 TIMER1A , // PB 5 ** 11 ** PWM11
301 TIMER1B , // PB 6 ** 12 ** PWM12
302 TIMER0A , // PB 7 ** 13 ** PWM13
303 NOT_ON_TIMER , // PJ 1 ** 14 ** USART3_TX
304 NOT_ON_TIMER , // PJ 0 ** 15 ** USART3_RX
305 NOT_ON_TIMER , // PH 1 ** 16 ** USART2_TX
306 NOT_ON_TIMER , // PH 0 ** 17 ** USART2_RX
307 NOT_ON_TIMER , // PD 3 ** 18 ** USART1_TX
308 NOT_ON_TIMER , // PD 2 ** 19 ** USART1_RX
309 NOT_ON_TIMER , // PD 1 ** 20 ** I2C_SDA
310 NOT_ON_TIMER , // PD 0 ** 21 ** I2C_SCL
311 NOT_ON_TIMER , // PA 0 ** 22 ** D22
312 NOT_ON_TIMER , // PA 1 ** 23 ** D23
313 NOT_ON_TIMER , // PA 2 ** 24 ** D24
314 NOT_ON_TIMER , // PA 3 ** 25 ** D25
315 NOT_ON_TIMER , // PA 4 ** 26 ** D26
316 NOT_ON_TIMER , // PA 5 ** 27 ** D27
317 NOT_ON_TIMER , // PA 6 ** 28 ** D28
318 NOT_ON_TIMER , // PA 7 ** 29 ** D29
319 NOT_ON_TIMER , // PC 7 ** 30 ** D30
320 NOT_ON_TIMER , // PC 6 ** 31 ** D31
321 NOT_ON_TIMER , // PC 5 ** 32 ** D32
322 NOT_ON_TIMER , // PC 4 ** 33 ** D33
323 NOT_ON_TIMER , // PC 3 ** 34 ** D34
324 NOT_ON_TIMER , // PC 2 ** 35 ** D35
325 NOT_ON_TIMER , // PC 1 ** 36 ** D36
326 NOT_ON_TIMER , // PC 0 ** 37 ** D37
327 NOT_ON_TIMER , // PD 7 ** 38 ** D38
328 NOT_ON_TIMER , // PG 2 ** 39 ** D39
329 NOT_ON_TIMER , // PG 1 ** 40 ** D40
330 NOT_ON_TIMER , // PG 0 ** 41 ** D41
331 NOT_ON_TIMER , // PL 7 ** 42 ** D42
332 NOT_ON_TIMER , // PL 6 ** 43 ** D43
333 TIMER5C , // PL 5 ** 44 ** D44
334 TIMER5B , // PL 4 ** 45 ** D45
335 TIMER5A , // PL 3 ** 46 ** D46
336 NOT_ON_TIMER , // PL 2 ** 47 ** D47
337 NOT_ON_TIMER , // PL 1 ** 48 ** D48
338 NOT_ON_TIMER , // PL 0 ** 49 ** D49
339 NOT_ON_TIMER , // PB 3 ** 50 ** SPI_MISO
340 NOT_ON_TIMER , // PB 2 ** 51 ** SPI_MOSI
341 NOT_ON_TIMER , // PB 1 ** 52 ** SPI_SCK
342 NOT_ON_TIMER , // PB 0 ** 53 ** SPI_SS
343 NOT_ON_TIMER , // PF 0 ** 54 ** A0
344 NOT_ON_TIMER , // PF 1 ** 55 ** A1
345 NOT_ON_TIMER , // PF 2 ** 56 ** A2
346 NOT_ON_TIMER , // PF 3 ** 57 ** A3
347 NOT_ON_TIMER , // PF 4 ** 58 ** A4
348 NOT_ON_TIMER , // PF 5 ** 59 ** A5
349 NOT_ON_TIMER , // PF 6 ** 60 ** A6
350 NOT_ON_TIMER , // PF 7 ** 61 ** A7
351 NOT_ON_TIMER , // PK 0 ** 62 ** A8
352 NOT_ON_TIMER , // PK 1 ** 63 ** A9
353 NOT_ON_TIMER , // PK 2 ** 64 ** A10
354 NOT_ON_TIMER , // PK 3 ** 65 ** A11
355 NOT_ON_TIMER , // PK 4 ** 66 ** A12
356 NOT_ON_TIMER , // PK 5 ** 67 ** A13
357 NOT_ON_TIMER , // PK 6 ** 68 ** A14
358 NOT_ON_TIMER , // PK 7 ** 69 ** A15
359};
360
361#endif
362
363#endif \ No newline at end of file
diff --git a/protocol/usb_hid/arduino-1.0.1/variants/standard/pins_arduino.h b/protocol/usb_hid/arduino-1.0.1/variants/standard/pins_arduino.h
new file mode 100644
index 000000000..30b426630
--- /dev/null
+++ b/protocol/usb_hid/arduino-1.0.1/variants/standard/pins_arduino.h
@@ -0,0 +1,218 @@
1/*
2 pins_arduino.h - Pin definition functions for Arduino
3 Part of Arduino - http://www.arduino.cc/
4
5 Copyright (c) 2007 David A. Mellis
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General
18 Public License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 Boston, MA 02111-1307 USA
21
22 $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
23*/
24
25#ifndef Pins_Arduino_h
26#define Pins_Arduino_h
27
28#include <avr/pgmspace.h>
29
30#define NUM_DIGITAL_PINS 20
31#define NUM_ANALOG_INPUTS 6
32#define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1)
33
34#if defined(__AVR_ATmega8__)
35#define digitalPinHasPWM(p) ((p) == 9 || (p) == 10 || (p) == 11)
36#else
37#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
38#endif
39
40static const uint8_t SS = 10;
41static const uint8_t MOSI = 11;
42static const uint8_t MISO = 12;
43static const uint8_t SCK = 13;
44
45static const uint8_t SDA = 18;
46static const uint8_t SCL = 19;
47static const uint8_t LED_BUILTIN = 13;
48
49static const uint8_t A0 = 14;
50static const uint8_t A1 = 15;
51static const uint8_t A2 = 16;
52static const uint8_t A3 = 17;
53static const uint8_t A4 = 18;
54static const uint8_t A5 = 19;
55static const uint8_t A6 = 20;
56static const uint8_t A7 = 21;
57
58#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
59#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
60#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0))))
61#define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14)))
62
63#ifdef ARDUINO_MAIN
64
65// On the Arduino board, digital pins are also used
66// for the analog output (software PWM). Analog input
67// pins are a separate set.
68
69// ATMEL ATMEGA8 & 168 / ARDUINO
70//
71// +-\/-+
72// PC6 1| |28 PC5 (AI 5)
73// (D 0) PD0 2| |27 PC4 (AI 4)
74// (D 1) PD1 3| |26 PC3 (AI 3)
75// (D 2) PD2 4| |25 PC2 (AI 2)
76// PWM+ (D 3) PD3 5| |24 PC1 (AI 1)
77// (D 4) PD4 6| |23 PC0 (AI 0)
78// VCC 7| |22 GND
79// GND 8| |21 AREF
80// PB6 9| |20 AVCC
81// PB7 10| |19 PB5 (D 13)
82// PWM+ (D 5) PD5 11| |18 PB4 (D 12)
83// PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM
84// (D 7) PD7 13| |16 PB2 (D 10) PWM
85// (D 8) PB0 14| |15 PB1 (D 9) PWM
86// +----+
87//
88// (PWM+ indicates the additional PWM pins on the ATmega168.)
89
90// ATMEL ATMEGA1280 / ARDUINO
91//
92// 0-7 PE0-PE7 works
93// 8-13 PB0-PB5 works
94// 14-21 PA0-PA7 works
95// 22-29 PH0-PH7 works
96// 30-35 PG5-PG0 works
97// 36-43 PC7-PC0 works
98// 44-51 PJ7-PJ0 works
99// 52-59 PL7-PL0 works
100// 60-67 PD7-PD0 works
101// A0-A7 PF0-PF7
102// A8-A15 PK0-PK7
103
104
105// these arrays map port names (e.g. port B) to the
106// appropriate addresses for various functions (e.g. reading
107// and writing)
108const uint16_t PROGMEM port_to_mode_PGM[] = {
109 NOT_A_PORT,
110 NOT_A_PORT,
111 (uint16_t) &DDRB,
112 (uint16_t) &DDRC,
113 (uint16_t) &DDRD,
114};
115
116const uint16_t PROGMEM port_to_output_PGM[] = {
117 NOT_A_PORT,
118 NOT_A_PORT,
119 (uint16_t) &PORTB,
120 (uint16_t) &PORTC,
121 (uint16_t) &PORTD,
122};
123
124const uint16_t PROGMEM port_to_input_PGM[] = {
125 NOT_A_PORT,
126 NOT_A_PORT,
127 (uint16_t) &PINB,
128 (uint16_t) &PINC,
129 (uint16_t) &PIND,
130};
131
132const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
133 PD, /* 0 */
134 PD,
135 PD,
136 PD,
137 PD,
138 PD,
139 PD,
140 PD,
141 PB, /* 8 */
142 PB,
143 PB,
144 PB,
145 PB,
146 PB,
147 PC, /* 14 */
148 PC,
149 PC,
150 PC,
151 PC,
152 PC,
153};
154
155const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
156 _BV(0), /* 0, port D */
157 _BV(1),
158 _BV(2),
159 _BV(3),
160 _BV(4),
161 _BV(5),
162 _BV(6),
163 _BV(7),
164 _BV(0), /* 8, port B */
165 _BV(1),
166 _BV(2),
167 _BV(3),
168 _BV(4),
169 _BV(5),
170 _BV(0), /* 14, port C */
171 _BV(1),
172 _BV(2),
173 _BV(3),
174 _BV(4),
175 _BV(5),
176};
177
178const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
179 NOT_ON_TIMER, /* 0 - port D */
180 NOT_ON_TIMER,
181 NOT_ON_TIMER,
182 // on the ATmega168, digital pin 3 has hardware pwm
183#if defined(__AVR_ATmega8__)
184 NOT_ON_TIMER,
185#else
186 TIMER2B,
187#endif
188 NOT_ON_TIMER,
189 // on the ATmega168, digital pins 5 and 6 have hardware pwm
190#if defined(__AVR_ATmega8__)
191 NOT_ON_TIMER,
192 NOT_ON_TIMER,
193#else
194 TIMER0B,
195 TIMER0A,
196#endif
197 NOT_ON_TIMER,
198 NOT_ON_TIMER, /* 8 - port B */
199 TIMER1A,
200 TIMER1B,
201#if defined(__AVR_ATmega8__)
202 TIMER2,
203#else
204 TIMER2A,
205#endif
206 NOT_ON_TIMER,
207 NOT_ON_TIMER,
208 NOT_ON_TIMER,
209 NOT_ON_TIMER, /* 14 - port C */
210 NOT_ON_TIMER,
211 NOT_ON_TIMER,
212 NOT_ON_TIMER,
213 NOT_ON_TIMER,
214};
215
216#endif
217
218#endif