【ボードのGPIO定義】
arduinoボードのピン情報の定義ファイル。UNO/LEONARDO/DIGISPARKなどが定義済み。
【ソース・コード】
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
/* variants.h - define gpio port pins for any arduino boards. Copyright (c) 2021 Sasapea's Lab. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __VARIANTS_H #define __VARIANTS_H #if defined(PA0) #define GPA0 IOPORT_PIN('A', PA0) #endif #if defined(PA1) #define GPA1 IOPORT_PIN('A', PA1) #endif #if defined(PA2) #define GPA2 IOPORT_PIN('A', PA2) #endif #if defined(PA3) #define GPA3 IOPORT_PIN('A', PA3) #endif #if defined(PA4) #define GPA4 IOPORT_PIN('A', PA4) #endif #if defined(PA5) #define GPA5 IOPORT_PIN('A', PA5) #endif #if defined(PA6) #define GPA6 IOPORT_PIN('A', PA6) #endif #if defined(PA7) #define GPA7 IOPORT_PIN('A', PA7) #endif #if defined(PB0) #define GPB0 IOPORT_PIN('B', PB0) #endif #if defined(PB1) #define GPB1 IOPORT_PIN('B', PB1) #endif #if defined(PB2) #define GPB2 IOPORT_PIN('B', PB2) #endif #if defined(PB3) #define GPB3 IOPORT_PIN('B', PB3) #endif #if defined(PB4) #define GPB4 IOPORT_PIN('B', PB4) #endif #if defined(PB5) #define GPB5 IOPORT_PIN('B', PB5) #endif #if defined(PB6) #define GPB6 IOPORT_PIN('B', PB6) #endif #if defined(PB7) #define GPB7 IOPORT_PIN('B', PB7) #endif #if defined(PC0) #define GPC0 IOPORT_PIN('C', PC0) #endif #if defined(PC1) #define GPC1 IOPORT_PIN('C', PC1) #endif #if defined(PC2) #define GPC2 IOPORT_PIN('C', PC2) #endif #if defined(PC3) #define GPC3 IOPORT_PIN('C', PC3) #endif #if defined(PC4) #define GPC4 IOPORT_PIN('C', PC4) #endif #if defined(PC5) #define GPC5 IOPORT_PIN('C', PC5) #endif #if defined(PC6) #define GPC6 IOPORT_PIN('C', PC6) #endif #if defined(PC7) #define GPC7 IOPORT_PIN('C', PC7) #endif #if defined(PD0) #define GPD0 IOPORT_PIN('D', PD0) #endif #if defined(PD1) #define GPD1 IOPORT_PIN('D', PD1) #endif #if defined(PD2) #define GPD2 IOPORT_PIN('D', PD2) #endif #if defined(PD3) #define GPD3 IOPORT_PIN('D', PD3) #endif #if defined(PD4) #define GPD4 IOPORT_PIN('D', PD4) #endif #if defined(PD5) #define GPD5 IOPORT_PIN('D', PD5) #endif #if defined(PD6) #define GPD6 IOPORT_PIN('D', PD6) #endif #if defined(PD7) #define GPD7 IOPORT_PIN('D', PD7) #endif #if defined(PE0) #define GPE0 IOPORT_PIN('E', PE0) #endif #if defined(PE1) #define GPE1 IOPORT_PIN('E', PE1) #endif #if defined(PE2) #define GPE2 IOPORT_PIN('E', PE2) #endif #if defined(PE3) #define GPE3 IOPORT_PIN('E', PE3) #endif #if defined(PE4) #define GPE4 IOPORT_PIN('E', PE4) #endif #if defined(PE5) #define GPE5 IOPORT_PIN('E', PE5) #endif #if defined(PE6) #define GPE6 IOPORT_PIN('E', PE6) #endif #if defined(PE7) #define GPE7 IOPORT_PIN('E', PE7) #endif #if defined(PF0) #define GPF0 IOPORT_PIN('F', PF0) #endif #if defined(PF1) #define GPF1 IOPORT_PIN('F', PF1) #endif #if defined(PF2) #define GPF2 IOPORT_PIN('F', PF2) #endif #if defined(PF3) #define GPF3 IOPORT_PIN('F', PF3) #endif #if defined(PF4) #define GPF4 IOPORT_PIN('F', PF4) #endif #if defined(PF5) #define GPF5 IOPORT_PIN('F', PF5) #endif #if defined(PF6) #define GPF6 IOPORT_PIN('F', PF6) #endif #if defined(PF7) #define GPF7 IOPORT_PIN('F', PF7) #endif #if defined(PG0) #define GPG0 IOPORT_PIN('G', PG0) #endif #if defined(PG1) #define GPG1 IOPORT_PIN('G', PG1) #endif #if defined(PG2) #define GPG2 IOPORT_PIN('G', PG2) #endif #if defined(PG3) #define GPG3 IOPORT_PIN('G', PG3) #endif #if defined(PG4) #define GPG4 IOPORT_PIN('G', PG4) #endif #if defined(PG5) #define GPG5 IOPORT_PIN('G', PG5) #endif #if defined(PG6) #define GPG6 IOPORT_PIN('G', PG6) #endif #if defined(PG7) #define GPG7 IOPORT_PIN('G', PG7) #endif #if defined(PH0) #define GPH0 IOPORT_PIN('H', PH0) #endif #if defined(PH1) #define GPH1 IOPORT_PIN('H', PH1) #endif #if defined(PH2) #define GPH2 IOPORT_PIN('H', PH2) #endif #if defined(PH3) #define GPH3 IOPORT_PIN('H', PH3) #endif #if defined(PH4) #define GPH4 IOPORT_PIN('H', PH4) #endif #if defined(PH5) #define GPH5 IOPORT_PIN('H', PH5) #endif #if defined(PH6) #define GPH6 IOPORT_PIN('H', PH6) #endif #if defined(PH7) #define GPH7 IOPORT_PIN('H', PH7) #endif #if defined(PI0) #define GPI0 IOPORT_PIN('I', PI0) #endif #if defined(PI1) #define GPI1 IOPORT_PIN('I', PI1) #endif #if defined(PI2) #define GPI2 IOPORT_PIN('I', PI2) #endif #if defined(PI3) #define GPI3 IOPORT_PIN('I', PI3) #endif #if defined(PI4) #define GPI4 IOPORT_PIN('I', PI4) #endif #if defined(PI5) #define GPI5 IOPORT_PIN('I', PI5) #endif #if defined(PI6) #define GPI6 IOPORT_PIN('I', PI6) #endif #if defined(PI7) #define GPI7 IOPORT_PIN('I', PI7) #endif #if defined(PJ0) #define GPJ0 IOPORT_PIN('J', PJ0) #endif #if defined(PJ1) #define GPJ1 IOPORT_PIN('J', PJ1) #endif #if defined(PJ2) #define GPJ2 IOPORT_PIN('J', PJ2) #endif #if defined(PJ3) #define GPJ3 IOPORT_PIN('J', PJ3) #endif #if defined(PJ4) #define GPJ4 IOPORT_PIN('J', PJ4) #endif #if defined(PJ5) #define GPJ5 IOPORT_PIN('J', PJ5) #endif #if defined(PJ6) #define GPJ6 IOPORT_PIN('J', PJ6) #endif #if defined(PJ7) #define GPJ7 IOPORT_PIN('J', PJ7) #endif #if defined(PK0) #define GPK0 IOPORT_PIN('K', PK0) #endif #if defined(PK1) #define GPK1 IOPORT_PIN('K', PK1) #endif #if defined(PK2) #define GPK2 IOPORT_PIN('K', PK2) #endif #if defined(PK3) #define GPK3 IOPORT_PIN('K', PK3) #endif #if defined(PK4) #define GPK4 IOPORT_PIN('K', PK4) #endif #if defined(PK5) #define GPK5 IOPORT_PIN('K', PK5) #endif #if defined(PK6) #define GPK6 IOPORT_PIN('K', PK6) #endif #if defined(PK7) #define GPK7 IOPORT_PIN('K', PK7) #endif #if defined(PL0) #define GPL0 IOPORT_PIN('L', PL0) #endif #if defined(PL1) #define GPL1 IOPORT_PIN('L', PL1) #endif #if defined(PL2) #define GPL2 IOPORT_PIN('L', PL2) #endif #if defined(PL3) #define GPL3 IOPORT_PIN('L', PL3) #endif #if defined(PL4) #define GPL4 IOPORT_PIN('L', PL4) #endif #if defined(PL5) #define GPL5 IOPORT_PIN('L', PL5) #endif #if defined(PL6) #define GPL6 IOPORT_PIN('L', PL6) #endif #if defined(PL7) #define GPL7 IOPORT_PIN('L', PL7) #endif #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_DUEMILANOVE) || defined(ARDUINO_AVR_LILYPAD) || defined(ARDUINO_AVR_NG) || defined(ARDUINO_AVR_UNO_WIFI_DEV_ED) #define BSP_D0 GPD0 #define BSP_D1 GPD1 #define BSP_D2 GPD2 #define BSP_D3 GPD3 #define BSP_D4 GPD4 #define BSP_D5 GPD5 #define BSP_D6 GPD6 #define BSP_D7 GPD7 #define BSP_D8 GPB0 #define BSP_D9 GPB1 #define BSP_D10 GPB2 #define BSP_D11 GPB3 #define BSP_D12 GPB4 #define BSP_D13 GPB5 #define BSP_D14 GPC0 #define BSP_D15 GPC1 #define BSP_D16 GPC2 #define BSP_D17 GPC3 #define BSP_D18 GPC4 #define BSP_D19 GPC5 #define BSP_A0 BSP_D14 #define BSP_A1 BSP_D15 #define BSP_A2 BSP_D16 #define BSP_A3 BSP_D17 #define BSP_A4 BSP_D18 #define BSP_A5 BSP_D19 #define BSP_WIRE_SDA BSP_D18 #define BSP_WIRE_SCL BSP_D19 #define BSP_SPI_SS BSP_D10 #define BSP_SPI_MOSI BSP_D11 #define BSP_SPI_MISO BSP_D12 #define BSP_SPI_SCK BSP_D13 #define BSP_LED_BUILTIN BSP_D13 #define BSP_LED_BUILTIN_RX BSP_D4 #define BSP_LED_BUILTIN_TX BSP_D5 #elif defined(ARDUINO_AVR_LEONARDO) || defined(ARDUINO_AVR_LEONARDO_ETH) || defined(ARDUINO_AVR_ESPLORA) || defined(ARDUINO_AVR_LILYPAD_USB) #define BSP_D0 GPD2 #define BSP_D1 GPD3 #define BSP_D2 GPD1 #define BSP_D3 GPD0 #define BSP_D4 GPD4 #define BSP_D5 GPC6 #define BSP_D6 GPD7 #define BSP_D7 GPE6 #define BSP_D8 GPB4 #define BSP_D9 GPB5 #define BSP_D10 GPB6 #define BSP_D11 GPB7 #define BSP_D12 GPD6 #define BSP_D13 GPC7 #define BSP_D14 GPB3 #define BSP_D15 GPB1 #define BSP_D16 GPB2 #define BSP_D17 GPB0 #define BSP_D18 GPF7 #define BSP_D19 GPF6 #define BSP_D20 GPF5 #define BSP_D21 GPF4 #define BSP_D22 GPF1 #define BSP_D23 GPF0 #define BSP_D30 GPD5 #define BSP_A0 BSP_D18 #define BSP_A1 BSP_D19 #define BSP_A2 BSP_D20 #define BSP_A3 BSP_D21 #define BSP_A4 BSP_D22 #define BSP_A5 BSP_D23 #define BSP_WIRE_SDA BSP_D2 #define BSP_WIRE_SCL BSP_D3 #define BSP_SPI_SS BSP_D17 #define BSP_SPI_MOSI BSP_D16 #define BSP_SPI_MISO BSP_D14 #define BSP_SPI_SCK BSP_D15 #define BSP_LED_BUILTIN BSP_D13 #define BSP_LED_BUILTIN_RX BSP_D17 #define BSP_LED_BUILTIN_TX BSP_D30 #elif defined(ARDUINO_AVR_DIGISPARK) #define BSP_D0 GPB0 #define BSP_D1 GPB1 #define BSP_D2 GPB2 #define BSP_D3 GPB3 #define BSP_D4 GPB4 #define BSP_D5 GPB5 #define BSP_A0 BSP_D5 #define BSP_A1 BSP_D2 #define BSP_A2 BSP_D4 #define BSP_A3 BSP_D3 #define LED_BUILTIN PIN_D1 #endif #endif |
【その他、必要なライブラリ】
AVR用高速GPIOライブラリ
【関連する投稿】
理想のRTOSを自作する (1)
理想のRTOSを自作する (2)
理想のRTOSを自作する (3)
理想のRTOSを自作する (4)
理想のRTOSを自作する (5)
理想のRTOSを自作する (6)
理想のRTOSを自作する (7)
理想のRTOSを自作する (8)
理想のRTOSを自作する (9)
理想のRTOSを自作する (10)
理想のRTOSを自作する (11)