Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
Board.h
Go to the documentation of this file.
1 
19 #ifndef HARDWARE_SAM_BOARD_H
20 #define HARDWARE_SAM_BOARD_H
21 
28 #define GPIO_PIN(index,pin) (((index) << 8) | (pin))
29 
34 #define GPIO_REG(pin) ((pin) >> 8)
35 
40 #define GPIO_MASK(pin) (1U << ((pin) & 0xff))
41 
42 #if defined(__SAM3X8E__)
43 
90 class BOARD {
91 public:
92  enum pin_t {
93  D0 = GPIO_PIN(0,8),
94  D1 = GPIO_PIN(0,9),
95  D2 = GPIO_PIN(1,25),
96  D3 = GPIO_PIN(2,28),
97  D4 = GPIO_PIN(2,26),
98  D5 = GPIO_PIN(2,25),
99  D6 = GPIO_PIN(2,24),
100  D7 = GPIO_PIN(2,23),
101 
102  D8 = GPIO_PIN(2,22),
103  D9 = GPIO_PIN(2,21),
104  D10 = GPIO_PIN(2,29),
105  D11 = GPIO_PIN(3,7),
106  D12 = GPIO_PIN(3,8),
107  D13 = GPIO_PIN(1,27),
108 
109  D14 = GPIO_PIN(3,4),
110  D15 = GPIO_PIN(3,5),
111  D16 = GPIO_PIN(0,13),
112  D17 = GPIO_PIN(0,12),
113  D18 = GPIO_PIN(0,11),
114  D19 = GPIO_PIN(0,10),
115  D20 = GPIO_PIN(1,12),
116  D21 = GPIO_PIN(1,13),
117 
118  D22 = GPIO_PIN(1,26),
119  D23 = GPIO_PIN(0,14),
120  D24 = GPIO_PIN(0,15),
121  D25 = GPIO_PIN(3,0),
122  D26 = GPIO_PIN(3,1),
123  D27 = GPIO_PIN(3,2),
124  D28 = GPIO_PIN(3,3),
125  D29 = GPIO_PIN(3,6),
126  D30 = GPIO_PIN(3,9),
127  D31 = GPIO_PIN(0,7),
128  D32 = GPIO_PIN(3,10),
129  D33 = GPIO_PIN(2,1),
130  D34 = GPIO_PIN(2,2),
131  D35 = GPIO_PIN(2,3),
132  D36 = GPIO_PIN(2,4),
133  D37 = GPIO_PIN(2,5),
134  D38 = GPIO_PIN(2,6),
135  D39 = GPIO_PIN(2,7),
136  D40 = GPIO_PIN(2,8),
137  D41 = GPIO_PIN(2,9),
138  D42 = GPIO_PIN(0,19),
139  D43 = GPIO_PIN(0,20),
140  D44 = GPIO_PIN(2,19),
141  D45 = GPIO_PIN(2,18),
142  D46 = GPIO_PIN(2,17),
143  D47 = GPIO_PIN(2,16),
144  D48 = GPIO_PIN(2,15),
145  D49 = GPIO_PIN(2,14),
146  D50 = GPIO_PIN(2,13),
147  D51 = GPIO_PIN(2,12),
148  D52 = GPIO_PIN(1,21),
149  D53 = GPIO_PIN(1,14)
150  };
151 };
152 #else
153 #error Board.h: sam mcu not supported
154 #endif
155 #endif
PIND:5.
Definition: Board.h:109
PIND:0.
Definition: Board.h:104
PIND:1.
Definition: Board.h:105
#define GPIO_PIN(index, pin)
Definition: Board.h:28
pin_t
Definition: Board.h:103
PINC:5/A5/SCL.
Definition: Board.h:125
PINC:2/A2.
Definition: Board.h:122
PINC:0/A0.
Definition: Board.h:120
PIND:7.
Definition: Board.h:111
PINB:2/SS.
Definition: Board.h:115
PIND:4.
Definition: Board.h:108
PIND:3.
Definition: Board.h:107
PINB:5/SCK/ICSP.3.
Definition: Board.h:118
PINB:3/MOSI/ICSP.4.
Definition: Board.h:116
PINB:4/MISO/ICSP.1.
Definition: Board.h:117
PINC:1/A1.
Definition: Board.h:121
PINB:0.
Definition: Board.h:113
PINC:4/A4/SDA.
Definition: Board.h:124
Definition: Board.h:101
PINB:1.
Definition: Board.h:114
PINC:3/A3.
Definition: Board.h:123
PIND:2.
Definition: Board.h:106
PIND:6.
Definition: Board.h:110