Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ArduinoCore-avr
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ArduinoCore-avr
Commits
5665f869
Commit
5665f869
authored
Jul 07, 2016
by
Arturo Guadalupi
Committed by
GitHub
Jul 07, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4814 from sandeepmistry/avr-pin_
Add PIN_* defines to AVR variants
parents
0c8151db
257ee3fd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
251 additions
and
112 deletions
+251
-112
variants/ethernet/pins_arduino.h
variants/ethernet/pins_arduino.h
+32
-14
variants/gemma/pins_arduino.h
variants/gemma/pins_arduino.h
+9
-4
variants/leonardo/pins_arduino.h
variants/leonardo/pins_arduino.h
+40
-18
variants/mega/pins_arduino.h
variants/mega/pins_arduino.h
+48
-22
variants/robot_control/pins_arduino.h
variants/robot_control/pins_arduino.h
+45
-20
variants/robot_motor/pins_arduino.h
variants/robot_motor/pins_arduino.h
+45
-20
variants/standard/pins_arduino.h
variants/standard/pins_arduino.h
+32
-14
No files found.
variants/ethernet/pins_arduino.h
View file @
5665f869
...
...
@@ -35,23 +35,41 @@
#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
#endif
static
const
uint8_t
SS
=
10
;
static
const
uint8_t
MOSI
=
11
;
static
const
uint8_t
MISO
=
12
;
static
const
uint8_t
SCK
=
13
;
#define PIN_SPI_SS (10)
#define PIN_SPI_MOSI (11)
#define PIN_SPI_MISO (12)
#define PIN_SPI_SCK (13)
static
const
uint8_t
SS
=
PIN_SPI_SS
;
static
const
uint8_t
MOSI
=
PIN_SPI_MOSI
;
static
const
uint8_t
MISO
=
PIN_SPI_MISO
;
static
const
uint8_t
SCK
=
PIN_SPI_SCK
;
#define PIN_WIRE_SDA (18)
#define PIN_WIRE_SCL (19)
static
const
uint8_t
SDA
=
PIN_WIRE_SDA
;
static
const
uint8_t
SCL
=
PIN_WIRE_SCL
;
static
const
uint8_t
SDA
=
18
;
static
const
uint8_t
SCL
=
19
;
#define LED_BUILTIN 9
static
const
uint8_t
A0
=
14
;
static
const
uint8_t
A1
=
15
;
static
const
uint8_t
A2
=
16
;
static
const
uint8_t
A3
=
17
;
static
const
uint8_t
A4
=
18
;
static
const
uint8_t
A5
=
19
;
static
const
uint8_t
A6
=
20
;
static
const
uint8_t
A7
=
21
;
#define PIN_A0 (14)
#define PIN_A1 (15)
#define PIN_A2 (16)
#define PIN_A3 (17)
#define PIN_A4 (18)
#define PIN_A5 (19)
#define PIN_A6 (20)
#define PIN_A7 (21)
static
const
uint8_t
A0
=
PIN_A0
;
static
const
uint8_t
A1
=
PIN_A1
;
static
const
uint8_t
A2
=
PIN_A2
;
static
const
uint8_t
A3
=
PIN_A3
;
static
const
uint8_t
A4
=
PIN_A4
;
static
const
uint8_t
A5
=
PIN_A5
;
static
const
uint8_t
A6
=
PIN_A6
;
static
const
uint8_t
A7
=
PIN_A7
;
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
...
...
variants/gemma/pins_arduino.h
View file @
5665f869
...
...
@@ -46,10 +46,15 @@
#define NUM_ANALOG_INPUTS 1
#define LED_BUILTIN 1
static
const
uint8_t
A0
=
6
;
static
const
uint8_t
A1
=
7
;
static
const
uint8_t
A2
=
8
;
static
const
uint8_t
A3
=
9
;
#define PIN_A0 (6)
#define PIN_A1 (7)
#define PIN_A2 (8)
#define PIN_A3 (9)
static
const
uint8_t
A0
=
PIN_A0
;
static
const
uint8_t
A1
=
PIN_A1
;
static
const
uint8_t
A2
=
PIN_A2
;
static
const
uint8_t
A3
=
PIN_A3
;
#define digitalPinToPCICR(p) ( ((p) >= 0 && (p) <= 4) ? (&GIMSK) : ((uint8_t *)0) )
#define digitalPinToPCICRbit(p) ( PCIE )
...
...
variants/leonardo/pins_arduino.h
View file @
5665f869
...
...
@@ -97,32 +97,54 @@
#define RXLED0 PORTB |= (1<<0)
#define RXLED1 PORTB &= ~(1<<0)
static
const
uint8_t
SDA
=
2
;
static
const
uint8_t
SCL
=
3
;
#define PIN_WIRE_SDA (2)
#define PIN_WIRE_SCL (3)
static
const
uint8_t
SDA
=
PIN_WIRE_SDA
;
static
const
uint8_t
SCL
=
PIN_WIRE_SCL
;
#define LED_BUILTIN 13
#define LED_BUILTIN_RX 17
#define LED_BUILTIN_TX 30
// Map SPI port to 'new' pins D14..D17
static
const
uint8_t
SS
=
17
;
static
const
uint8_t
MOSI
=
16
;
static
const
uint8_t
MISO
=
14
;
static
const
uint8_t
SCK
=
15
;
#define PIN_SPI_SS (17)
#define PIN_SPI_MOSI (16)
#define PIN_SPI_MISO (14)
#define PIN_SPI_SCK (15)
static
const
uint8_t
SS
=
PIN_SPI_SS
;
static
const
uint8_t
MOSI
=
PIN_SPI_MOSI
;
static
const
uint8_t
MISO
=
PIN_SPI_MISO
;
static
const
uint8_t
SCK
=
PIN_SPI_SCK
;
// Mapping of analog pins as digital I/O
// A6-A11 share with digital pins
static
const
uint8_t
A0
=
18
;
static
const
uint8_t
A1
=
19
;
static
const
uint8_t
A2
=
20
;
static
const
uint8_t
A3
=
21
;
static
const
uint8_t
A4
=
22
;
static
const
uint8_t
A5
=
23
;
static
const
uint8_t
A6
=
24
;
// D4
static
const
uint8_t
A7
=
25
;
// D6
static
const
uint8_t
A8
=
26
;
// D8
static
const
uint8_t
A9
=
27
;
// D9
static
const
uint8_t
A10
=
28
;
// D10
static
const
uint8_t
A11
=
29
;
// D12
#define PIN_A0 (18)
#define PIN_A1 (19)
#define PIN_A2 (20)
#define PIN_A3 (21)
#define PIN_A4 (22)
#define PIN_A5 (23)
#define PIN_A6 (24)
#define PIN_A7 (25)
#define PIN_A8 (26)
#define PIN_A9 (27)
#define PIN_A10 (28)
#define PIN_A11 (29)
static
const
uint8_t
A0
=
PIN_A0
;
static
const
uint8_t
A1
=
PIN_A1
;
static
const
uint8_t
A2
=
PIN_A2
;
static
const
uint8_t
A3
=
PIN_A3
;
static
const
uint8_t
A4
=
PIN_A4
;
static
const
uint8_t
A5
=
PIN_A5
;
static
const
uint8_t
A6
=
PIN_A6
;
// D4
static
const
uint8_t
A7
=
PIN_A7
;
// D6
static
const
uint8_t
A8
=
PIN_A8
;
// D8
static
const
uint8_t
A9
=
PIN_A9
;
// D9
static
const
uint8_t
A10
=
PIN_A10
;
// D10
static
const
uint8_t
A11
=
PIN_A11
;
// D12
#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
#define digitalPinToPCICRbit(p) 0
...
...
variants/mega/pins_arduino.h
View file @
5665f869
...
...
@@ -30,31 +30,57 @@
#define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
#define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))
static
const
uint8_t
SS
=
53
;
static
const
uint8_t
MOSI
=
51
;
static
const
uint8_t
MISO
=
50
;
static
const
uint8_t
SCK
=
52
;
#define PIN_SPI_SS (53)
#define PIN_SPI_MOSI (51)
#define PIN_SPI_MISO (50)
#define PIN_SPI_SCK (52)
static
const
uint8_t
SS
=
PIN_SPI_SS
;
static
const
uint8_t
MOSI
=
PIN_SPI_MOSI
;
static
const
uint8_t
MISO
=
PIN_SPI_MISO
;
static
const
uint8_t
SCK
=
PIN_SPI_SCK
;
#define PIN_WIRE_SDA (20)
#define PIN_WIRE_SCL (21)
static
const
uint8_t
SDA
=
PIN_WIRE_SDA
;
static
const
uint8_t
SCL
=
PIN_WIRE_SCL
;
static
const
uint8_t
SDA
=
20
;
static
const
uint8_t
SCL
=
21
;
#define LED_BUILTIN 13
static
const
uint8_t
A0
=
54
;
static
const
uint8_t
A1
=
55
;
static
const
uint8_t
A2
=
56
;
static
const
uint8_t
A3
=
57
;
static
const
uint8_t
A4
=
58
;
static
const
uint8_t
A5
=
59
;
static
const
uint8_t
A6
=
60
;
static
const
uint8_t
A7
=
61
;
static
const
uint8_t
A8
=
62
;
static
const
uint8_t
A9
=
63
;
static
const
uint8_t
A10
=
64
;
static
const
uint8_t
A11
=
65
;
static
const
uint8_t
A12
=
66
;
static
const
uint8_t
A13
=
67
;
static
const
uint8_t
A14
=
68
;
static
const
uint8_t
A15
=
69
;
#define PIN_A0 (54)
#define PIN_A1 (55)
#define PIN_A2 (56)
#define PIN_A3 (57)
#define PIN_A4 (58)
#define PIN_A5 (59)
#define PIN_A6 (60)
#define PIN_A7 (61)
#define PIN_A8 (62)
#define PIN_A9 (63)
#define PIN_A10 (64)
#define PIN_A11 (65)
#define PIN_A12 (66)
#define PIN_A13 (67)
#define PIN_A14 (68)
#define PIN_A15 (69)
static
const
uint8_t
A0
=
PIN_A0
;
static
const
uint8_t
A1
=
PIN_A1
;
static
const
uint8_t
A2
=
PIN_A2
;
static
const
uint8_t
A3
=
PIN_A3
;
static
const
uint8_t
A4
=
PIN_A4
;
static
const
uint8_t
A5
=
PIN_A5
;
static
const
uint8_t
A6
=
PIN_A6
;
static
const
uint8_t
A7
=
PIN_A7
;
static
const
uint8_t
A8
=
PIN_A8
;
static
const
uint8_t
A9
=
PIN_A9
;
static
const
uint8_t
A10
=
PIN_A10
;
static
const
uint8_t
A11
=
PIN_A11
;
static
const
uint8_t
A12
=
PIN_A12
;
static
const
uint8_t
A13
=
PIN_A13
;
static
const
uint8_t
A14
=
PIN_A14
;
static
const
uint8_t
A15
=
PIN_A15
;
// A majority of the pins are NOT PCINTs, SO BE WARNED (i.e. you cannot use them as receive pins)
// Only pins available for RECEIVE (TRANSMIT can be on any pin):
...
...
variants/robot_control/pins_arduino.h
View file @
5665f869
...
...
@@ -41,31 +41,56 @@
#define D4 TKD4
#define D5 TKD5
static
const
uint8_t
RX
=
0
;
static
const
uint8_t
TX
=
1
;
static
const
uint8_t
SDA
=
2
;
static
const
uint8_t
SCL
=
3
;
#define PIN_SERIAL_RX (0)
#define PIN_SERIAL_TX (1)
static
const
uint8_t
RX
=
PIN_SERIAL_RX
;
static
const
uint8_t
TX
=
PIN_SERIAL_TX
;
#define PIN_WIRE_SDA (2)
#define PIN_WIRE_SCL (3)
static
const
uint8_t
SDA
=
PIN_WIRE_SDA
;
static
const
uint8_t
SCL
=
PIN_WIRE_SCL
;
// Map SPI port to 'new' pins D14..D17
static
const
uint8_t
SS
=
17
;
static
const
uint8_t
MOSI
=
16
;
static
const
uint8_t
MISO
=
14
;
static
const
uint8_t
SCK
=
15
;
#define PIN_SPI_SS (17)
#define PIN_SPI_MOSI (16)
#define PIN_SPI_MISO (14)
#define PIN_SPI_SCK (15)
static
const
uint8_t
SS
=
PIN_SPI_SS
;
static
const
uint8_t
MOSI
=
PIN_SPI_MOSI
;
static
const
uint8_t
MISO
=
PIN_SPI_MISO
;
static
const
uint8_t
SCK
=
PIN_SPI_SCK
;
// Mapping of analog pins as digital I/O
// A6-A11 share with digital pins
static
const
uint8_t
A0
=
18
;
static
const
uint8_t
A1
=
19
;
static
const
uint8_t
A2
=
20
;
static
const
uint8_t
A3
=
21
;
static
const
uint8_t
A4
=
22
;
static
const
uint8_t
A5
=
23
;
static
const
uint8_t
A6
=
24
;
// D4
static
const
uint8_t
A7
=
25
;
// D6
static
const
uint8_t
A8
=
26
;
// D8
static
const
uint8_t
A9
=
27
;
// D9
static
const
uint8_t
A10
=
28
;
// D10
static
const
uint8_t
A11
=
29
;
// D12
#define PIN_A0 (18)
#define PIN_A1 (19)
#define PIN_A2 (20)
#define PIN_A3 (21)
#define PIN_A4 (22)
#define PIN_A5 (23)
#define PIN_A6 (24)
#define PIN_A7 (25)
#define PIN_A8 (26)
#define PIN_A9 (27)
#define PIN_A10 (28)
#define PIN_A11 (29)
static
const
uint8_t
A0
=
PIN_A0
;
static
const
uint8_t
A1
=
PIN_A1
;
static
const
uint8_t
A2
=
PIN_A2
;
static
const
uint8_t
A3
=
PIN_A3
;
static
const
uint8_t
A4
=
PIN_A4
;
static
const
uint8_t
A5
=
PIN_A5
;
static
const
uint8_t
A6
=
PIN_A6
;
// D4
static
const
uint8_t
A7
=
PIN_A7
;
// D6
static
const
uint8_t
A8
=
PIN_A8
;
// D8
static
const
uint8_t
A9
=
PIN_A9
;
// D9
static
const
uint8_t
A10
=
PIN_A10
;
// D10
static
const
uint8_t
A11
=
PIN_A11
;
// D12
// Specific Mapping for the Control Board
static
const
uint8_t
KEY
=
18
;
// AD0
...
...
variants/robot_motor/pins_arduino.h
View file @
5665f869
...
...
@@ -39,31 +39,56 @@
#define D8 TK4
#define D7 TK3
static
const
uint8_t
RX
=
0
;
static
const
uint8_t
TX
=
1
;
static
const
uint8_t
SDA
=
2
;
static
const
uint8_t
SCL
=
3
;
#define PIN_SERIAL_RX (0)
#define PIN_SERIAL_TX (1)
static
const
uint8_t
RX
=
PIN_SERIAL_RX
;
static
const
uint8_t
TX
=
PIN_SERIAL_TX
;
#define PIN_WIRE_SDA (2)
#define PIN_WIRE_SCL (3)
static
const
uint8_t
SDA
=
PIN_WIRE_SDA
;
static
const
uint8_t
SCL
=
PIN_WIRE_SCL
;
// Map SPI port to 'new' pins D14..D17
static
const
uint8_t
SS
=
17
;
static
const
uint8_t
MOSI
=
16
;
static
const
uint8_t
MISO
=
14
;
static
const
uint8_t
SCK
=
15
;
#define PIN_SPI_SS (17)
#define PIN_SPI_MOSI (16)
#define PIN_SPI_MISO (14)
#define PIN_SPI_SCK (15)
static
const
uint8_t
SS
=
PIN_SPI_SS
;
static
const
uint8_t
MOSI
=
PIN_SPI_MOSI
;
static
const
uint8_t
MISO
=
PIN_SPI_MISO
;
static
const
uint8_t
SCK
=
PIN_SPI_SCK
;
// Mapping of analog pins as digital I/O
// A6-A11 share with digital pins
static
const
uint8_t
A0
=
18
;
static
const
uint8_t
A1
=
19
;
static
const
uint8_t
A2
=
20
;
static
const
uint8_t
A3
=
21
;
static
const
uint8_t
A4
=
22
;
static
const
uint8_t
A5
=
23
;
static
const
uint8_t
A6
=
24
;
// D4
static
const
uint8_t
A7
=
25
;
// D6
static
const
uint8_t
A8
=
26
;
// D8
static
const
uint8_t
A9
=
27
;
// D9
static
const
uint8_t
A10
=
28
;
// D10
static
const
uint8_t
A11
=
29
;
// D12
#define PIN_A0 (18)
#define PIN_A1 (19)
#define PIN_A2 (20)
#define PIN_A3 (21)
#define PIN_A4 (22)
#define PIN_A5 (23)
#define PIN_A6 (24)
#define PIN_A7 (25)
#define PIN_A8 (26)
#define PIN_A9 (27)
#define PIN_A10 (28)
#define PIN_A11 (29)
static
const
uint8_t
A0
=
PIN_A0
;
static
const
uint8_t
A1
=
PIN_A1
;
static
const
uint8_t
A2
=
PIN_A2
;
static
const
uint8_t
A3
=
PIN_A3
;
static
const
uint8_t
A4
=
PIN_A4
;
static
const
uint8_t
A5
=
PIN_A5
;
static
const
uint8_t
A6
=
PIN_A6
;
// D4
static
const
uint8_t
A7
=
PIN_A7
;
// D6
static
const
uint8_t
A8
=
PIN_A8
;
// D8
static
const
uint8_t
A9
=
PIN_A9
;
// D9
static
const
uint8_t
A10
=
PIN_A10
;
// D10
static
const
uint8_t
A11
=
PIN_A11
;
// D12
// Specific Mapping for the Motor Board
static
const
uint8_t
MUX_IN
=
20
;
// A2
...
...
variants/standard/pins_arduino.h
View file @
5665f869
...
...
@@ -35,23 +35,41 @@
#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
#endif
static
const
uint8_t
SS
=
10
;
static
const
uint8_t
MOSI
=
11
;
static
const
uint8_t
MISO
=
12
;
static
const
uint8_t
SCK
=
13
;
#define PIN_SPI_SS (10)
#define PIN_SPI_MOSI (11)
#define PIN_SPI_MISO (12)
#define PIN_SPI_SCK (13)
static
const
uint8_t
SS
=
PIN_SPI_SS
;
static
const
uint8_t
MOSI
=
PIN_SPI_MOSI
;
static
const
uint8_t
MISO
=
PIN_SPI_MISO
;
static
const
uint8_t
SCK
=
PIN_SPI_SCK
;
#define PIN_WIRE_SDA (18)
#define PIN_WIRE_SCL (19)
static
const
uint8_t
SDA
=
PIN_WIRE_SDA
;
static
const
uint8_t
SCL
=
PIN_WIRE_SCL
;
static
const
uint8_t
SDA
=
18
;
static
const
uint8_t
SCL
=
19
;
#define LED_BUILTIN 13
static
const
uint8_t
A0
=
14
;
static
const
uint8_t
A1
=
15
;
static
const
uint8_t
A2
=
16
;
static
const
uint8_t
A3
=
17
;
static
const
uint8_t
A4
=
18
;
static
const
uint8_t
A5
=
19
;
static
const
uint8_t
A6
=
20
;
static
const
uint8_t
A7
=
21
;
#define PIN_A0 (14)
#define PIN_A1 (15)
#define PIN_A2 (16)
#define PIN_A3 (17)
#define PIN_A4 (18)
#define PIN_A5 (19)
#define PIN_A6 (20)
#define PIN_A7 (21)
static
const
uint8_t
A0
=
PIN_A0
;
static
const
uint8_t
A1
=
PIN_A1
;
static
const
uint8_t
A2
=
PIN_A2
;
static
const
uint8_t
A3
=
PIN_A3
;
static
const
uint8_t
A4
=
PIN_A4
;
static
const
uint8_t
A5
=
PIN_A5
;
static
const
uint8_t
A6
=
PIN_A6
;
static
const
uint8_t
A7
=
PIN_A7
;
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment