arduino_iomap.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015,2017 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
22 #ifndef ARDUINO_IOMAP_H
23 #define ARDUINO_IOMAP_H
24 
25 #include "periph/adc.h"
26 #include "periph/gpio.h"
27 #include "periph/i2c.h"
28 #include "periph/spi.h"
29 #include "periph/uart.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
39 #define ARDUINO_UART_D0D1 UART_DEV(0)
49 #define ARDUINO_SPI_ISP SPI_DEV(0)
59 #define ARDUINO_I2C_UNO I2C_DEV(0)
66 #define ARDUINO_PIN_0 GPIO_PIN(PA, 8)
67 #define ARDUINO_PIN_1 GPIO_PIN(PA, 9)
68 #define ARDUINO_PIN_2 GPIO_PIN(PB, 25)
69 #define ARDUINO_PIN_3 GPIO_PIN(PC, 28)
70 #define ARDUINO_PIN_4 GPIO_PIN(PA, 29)
71 #define ARDUINO_PIN_5 GPIO_PIN(PC, 25)
72 #define ARDUINO_PIN_6 GPIO_PIN(PC, 24)
73 #define ARDUINO_PIN_7 GPIO_PIN(PC, 23)
74 #define ARDUINO_PIN_8 GPIO_PIN(PC, 22)
75 #define ARDUINO_PIN_9 GPIO_PIN(PC, 21)
76 #define ARDUINO_PIN_10 GPIO_PIN(PC, 29)
77 #define ARDUINO_PIN_11 GPIO_PIN(PD, 7)
78 #define ARDUINO_PIN_12 GPIO_PIN(PD, 8)
79 #define ARDUINO_PIN_13 GPIO_PIN(PB, 27)
80 #define ARDUINO_PIN_14 GPIO_PIN(PD, 4)
81 #define ARDUINO_PIN_15 GPIO_PIN(PD, 5)
82 #define ARDUINO_PIN_16 GPIO_PIN(PA, 13)
83 #define ARDUINO_PIN_17 GPIO_PIN(PA, 12)
84 #define ARDUINO_PIN_18 GPIO_PIN(PA, 11)
85 #define ARDUINO_PIN_19 GPIO_PIN(PA, 10)
86 #define ARDUINO_PIN_20 GPIO_PIN(PB, 12)
87 #define ARDUINO_PIN_21 GPIO_PIN(PB, 13)
88 #define ARDUINO_PIN_22 GPIO_PIN(PB, 26)
89 #define ARDUINO_PIN_23 GPIO_PIN(PA, 14)
90 #define ARDUINO_PIN_24 GPIO_PIN(PA, 15)
91 #define ARDUINO_PIN_25 GPIO_PIN(PD, 0)
92 #define ARDUINO_PIN_26 GPIO_PIN(PD, 1)
93 #define ARDUINO_PIN_27 GPIO_PIN(PD, 2)
94 #define ARDUINO_PIN_28 GPIO_PIN(PD, 3)
95 #define ARDUINO_PIN_29 GPIO_PIN(PD, 6)
96 #define ARDUINO_PIN_30 GPIO_PIN(PD, 9)
97 #define ARDUINO_PIN_31 GPIO_PIN(PA, 7)
98 #define ARDUINO_PIN_32 GPIO_PIN(PD, 10)
99 #define ARDUINO_PIN_33 GPIO_PIN(PC, 1)
100 #define ARDUINO_PIN_34 GPIO_PIN(PC, 2)
101 #define ARDUINO_PIN_35 GPIO_PIN(PC, 3)
102 #define ARDUINO_PIN_36 GPIO_PIN(PC, 4)
103 #define ARDUINO_PIN_37 GPIO_PIN(PC, 5)
104 #define ARDUINO_PIN_38 GPIO_PIN(PC, 6)
105 #define ARDUINO_PIN_39 GPIO_PIN(PC, 7)
106 #define ARDUINO_PIN_40 GPIO_PIN(PC, 8)
107 #define ARDUINO_PIN_41 GPIO_PIN(PC, 9)
108 #define ARDUINO_PIN_42 GPIO_PIN(PA, 19)
109 #define ARDUINO_PIN_43 GPIO_PIN(PA, 20)
110 #define ARDUINO_PIN_44 GPIO_PIN(PC, 19)
111 #define ARDUINO_PIN_45 GPIO_PIN(PC, 18)
112 #define ARDUINO_PIN_46 GPIO_PIN(PC, 17)
113 #define ARDUINO_PIN_47 GPIO_PIN(PC, 16)
114 #define ARDUINO_PIN_48 GPIO_PIN(PC, 15)
115 #define ARDUINO_PIN_49 GPIO_PIN(PC, 14)
116 #define ARDUINO_PIN_50 GPIO_PIN(PC, 13)
117 #define ARDUINO_PIN_51 GPIO_PIN(PC, 12)
118 #define ARDUINO_PIN_52 GPIO_PIN(PB, 21)
119 #define ARDUINO_PIN_53 GPIO_PIN(PB, 14)
120 #define ARDUINO_PIN_54 GPIO_PIN(PA, 16)
121 #define ARDUINO_PIN_55 GPIO_PIN(PA, 24)
122 #define ARDUINO_PIN_56 GPIO_PIN(PA, 23)
123 #define ARDUINO_PIN_57 GPIO_PIN(PA, 22)
124 #define ARDUINO_PIN_58 GPIO_PIN(PA, 6)
125 #define ARDUINO_PIN_59 GPIO_PIN(PA, 4)
126 #define ARDUINO_PIN_60 GPIO_PIN(PA, 3)
127 #define ARDUINO_PIN_61 GPIO_PIN(PA, 2)
128 #define ARDUINO_PIN_62 GPIO_PIN(PB, 17)
129 #define ARDUINO_PIN_63 GPIO_PIN(PB, 18)
130 #define ARDUINO_PIN_64 GPIO_PIN(PB, 19)
131 #define ARDUINO_PIN_65 GPIO_PIN(PB, 20)
132 #define ARDUINO_PIN_66 GPIO_PIN(PB, 15)
133 #define ARDUINO_PIN_67 GPIO_PIN(PB, 16)
134 #define ARDUINO_PIN_68 GPIO_PIN(PA, 1)
135 #define ARDUINO_PIN_69 GPIO_PIN(PA, 0)
136 #define ARDUINO_PIN_70 GPIO_PIN(PA, 17)
137 #define ARDUINO_PIN_71 GPIO_PIN(PA, 18)
138 #define ARDUINO_PIN_72 GPIO_PIN(PC, 30)
139 #define ARDUINO_PIN_73 GPIO_PIN(PA, 21)
140 #define ARDUINO_PIN_74 GPIO_PIN(PA, 25)
141 #define ARDUINO_PIN_75 GPIO_PIN(PA, 26)
142 #define ARDUINO_PIN_76 GPIO_PIN(PA, 27)
143 #define ARDUINO_PIN_77 GPIO_PIN(PA, 28)
144 #define ARDUINO_PIN_78 GPIO_PIN(PB, 23)
145 
146 #define ARDUINO_PIN_LAST 78
153 #define ARDUINO_PIN_A0 ARDUINO_PIN_54
154 #define ARDUINO_PIN_A1 ARDUINO_PIN_55
155 #define ARDUINO_PIN_A2 ARDUINO_PIN_56
156 #define ARDUINO_PIN_A3 ARDUINO_PIN_57
157 #define ARDUINO_PIN_A4 ARDUINO_PIN_58
158 #define ARDUINO_PIN_A5 ARDUINO_PIN_59
159 #define ARDUINO_PIN_A6 ARDUINO_PIN_60
160 #define ARDUINO_PIN_A7 ARDUINO_PIN_61
161 #define ARDUINO_PIN_A8 ARDUINO_PIN_62
162 #define ARDUINO_PIN_A9 ARDUINO_PIN_63
163 #define ARDUINO_PIN_A10 ARDUINO_PIN_64
164 #define ARDUINO_PIN_A11 ARDUINO_PIN_65
165 #define ARDUINO_PIN_DAC0 ARDUINO_PIN_66
166 #define ARDUINO_PIN_DAC1 ARDUINO_PIN_67
173 #define ARDUINO_A0 ADC_LINE(7)
174 #define ARDUINO_A1 ADC_LINE(6)
175 #define ARDUINO_A2 ADC_LINE(5)
176 #define ARDUINO_A3 ADC_LINE(4)
177 #define ARDUINO_A4 ADC_LINE(3)
178 #define ARDUINO_A5 ADC_LINE(2)
179 #define ARDUINO_A6 ADC_LINE(1)
180 #define ARDUINO_A7 ADC_LINE(0)
181 #define ARDUINO_A8 ADC_LINE(10)
182 #define ARDUINO_A9 ADC_LINE(11)
183 #define ARDUINO_A10 ADC_LINE(12)
184 #define ARDUINO_A11 ADC_LINE(13)
185 
186 #define ARDUINO_ANALOG_PIN_LAST 11
193 #define ARDUINO_DAC0 DAC_LINE(0)
194 #define ARDUINO_DAC1 DAC_LINE(1)
195 
196 #define ARDUINO_DAC_PIN_LAST 1
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #endif /* ARDUINO_IOMAP_H */
Low-level ADC peripheral driver interface definitions.
Low-level GPIO peripheral driver interface definitions.
Low-level UART peripheral driver interface definition.
Low-level I2C peripheral driver interface definition.
Low-level SPI peripheral driver interface definition.