pin_defs.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. /*
  2. * pin_defs.h
  3. * optiboot helper defining the default pin assignments (LED, SOFT_UART)
  4. * for the various chips that are supported. This also has some ugly macros
  5. * for selecting among various UARTs and LED possibilities using command-line
  6. * defines like "UART=2 LED=B5"
  7. *
  8. * Copyright 2013-2015 by Bill Westfield.
  9. * Copyright 2010 by Peter Knight.
  10. * This software is licensed under version 2 of the Gnu Public Licence.
  11. * See optiboot.c for details.
  12. */
  13. /*------------------------------------------------------------------------ */
  14. #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega88) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega88__)
  15. /*------------------------------------------------------------------------ */
  16. /* Onboard LED is connected to pin PB5 in Arduino NG, Diecimila, and Duemilanove
  17. */
  18. #if !defined(LED)
  19. #define LED B5
  20. #endif
  21. /* Ports for soft UART */
  22. #ifdef SOFT_UART
  23. #define UART_PORT PORTD
  24. #define UART_PIN PIND
  25. #define UART_DDR DDRD
  26. #define UART_TX_BIT 1
  27. #define UART_RX_BIT 0
  28. #endif
  29. #endif
  30. /*
  31. * Handle devices with up to 4 uarts (eg m1280.) Rather inelegantly.
  32. * Note that mega8/m32 still needs special handling, because ubrr is handled
  33. * differently.
  34. */
  35. #if UART == 0
  36. # define UART_SRA UCSR0A
  37. # define UART_SRB UCSR0B
  38. # define UART_SRC UCSR0C
  39. # define UART_SRL UBRR0L
  40. # define UART_UDR UDR0
  41. #elif UART == 1
  42. #if !defined(UDR1)
  43. #error UART == 1, but no UART1 on device
  44. #endif
  45. # define UART_SRA UCSR1A
  46. # define UART_SRB UCSR1B
  47. # define UART_SRC UCSR1C
  48. # define UART_SRL UBRR1L
  49. # define UART_UDR UDR1
  50. #elif UART == 2
  51. #if !defined(UDR2)
  52. #error UART == 2, but no UART2 on device
  53. #endif
  54. # define UART_SRA UCSR2A
  55. # define UART_SRB UCSR2B
  56. # define UART_SRC UCSR2C
  57. # define UART_SRL UBRR2L
  58. # define UART_UDR UDR2
  59. #elif UART == 3
  60. #if !defined(UDR3)
  61. #error UART == 3, but no UART3 on device
  62. #endif
  63. # define UART_SRA UCSR3A
  64. # define UART_SRB UCSR3B
  65. # define UART_SRC UCSR3C
  66. # define UART_SRL UBRR3L
  67. # define UART_UDR UDR3
  68. #endif
  69. #if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__)
  70. //Name conversion R.Wiersma
  71. #define UCSR0A UCSRA
  72. #define UDR0 UDR
  73. #define UDRE0 UDRE
  74. #define RXC0 RXC
  75. #define FE0 FE
  76. #define TIFR1 TIFR
  77. #define WDTCSR WDTCR
  78. #endif
  79. #if defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__)
  80. #define WDCE WDTOE
  81. #endif
  82. /* Luminet support */
  83. /*------------------------------------------------------------------------ */
  84. #if defined(__AVR_ATtiny84__)
  85. /*------------------------------------------------------------------------ */
  86. /* Red LED is connected to pin PA4 */
  87. #if !defined(LED)
  88. #define LED A4
  89. #endif
  90. /* Ports for soft UART - left port only for now. TX/RX on PA2/PA3 */
  91. #ifdef SOFT_UART
  92. #define UART_PORT PORTA
  93. #define UART_PIN PINA
  94. #define UART_DDR DDRA
  95. #define UART_TX_BIT 2
  96. #define UART_RX_BIT 3
  97. #endif
  98. #endif
  99. /*------------------------------------------------------------------------ */
  100. /* Sanguino support (and other 40pin DIP cpus) */
  101. #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega32__) || defined (__AVR_ATmega16__)
  102. /*------------------------------------------------------------------------ */
  103. /* Onboard LED is connected to pin PB0 on Sanguino */
  104. #if !defined(LED)
  105. #define LED B0
  106. #endif
  107. /* Ports for soft UART */
  108. #ifdef SOFT_UART
  109. #define UART_PORT PORTD
  110. #define UART_PIN PIND
  111. #define UART_DDR DDRD
  112. #define UART_TX_BIT 1
  113. #define UART_RX_BIT 0
  114. #endif
  115. #endif
  116. /*------------------------------------------------------------------------ */
  117. /* Mega support */
  118. #if defined(__AVR_ATmega1280__)
  119. /*------------------------------------------------------------------------ */
  120. /* Onboard LED is connected to pin PB7 on Arduino Mega */
  121. #if !defined(LED)
  122. #define LED B7
  123. #endif
  124. /* Ports for soft UART */
  125. #ifdef SOFT_UART
  126. #define UART_PORT PORTE
  127. #define UART_PIN PINE
  128. #define UART_DDR DDRE
  129. #define UART_TX_BIT 1
  130. #define UART_RX_BIT 0
  131. #endif
  132. #endif
  133. /*
  134. * ------------------------------------------------------------------------
  135. * A bunch of macros to enable the LED to be specifed as "B5" for bit 5
  136. * of port B, and similar.
  137. */
  138. #define A0 0x100
  139. #define A1 0x101
  140. #define A2 0x102
  141. #define A3 0x103
  142. #define A4 0x104
  143. #define A5 0x105
  144. #define A6 0x106
  145. #define A7 0x107
  146. #define B0 0x200
  147. #define B1 0x201
  148. #define B2 0x202
  149. #define B3 0x203
  150. #define B4 0x204
  151. #define B5 0x205
  152. #define B6 0x206
  153. #define B7 0x207
  154. #define C0 0x300
  155. #define C1 0x301
  156. #define C2 0x302
  157. #define C3 0x303
  158. #define C4 0x304
  159. #define C5 0x305
  160. #define C6 0x306
  161. #define C7 0x307
  162. #define D0 0x400
  163. #define D1 0x401
  164. #define D2 0x402
  165. #define D3 0x403
  166. #define D4 0x404
  167. #define D5 0x405
  168. #define D6 0x406
  169. #define D7 0x407
  170. #define E0 0x500
  171. #define E1 0x501
  172. #define E2 0x502
  173. #define E3 0x503
  174. #define E4 0x504
  175. #define E5 0x505
  176. #define E6 0x506
  177. #define E7 0x507
  178. #define F0 0x600
  179. #define F1 0x601
  180. #define F2 0x602
  181. #define F3 0x603
  182. #define F4 0x604
  183. #define F5 0x605
  184. #define F6 0x606
  185. #define F7 0x607
  186. #define G0 0x700
  187. #define G1 0x701
  188. #define G2 0x702
  189. #define G3 0x703
  190. #define G4 0x704
  191. #define G5 0x705
  192. #define G6 0x706
  193. #define G7 0x707
  194. #define H0 0x800
  195. #define H1 0x801
  196. #define H2 0x802
  197. #define H3 0x803
  198. #define H4 0x804
  199. #define H5 0x805
  200. #define H6 0x806
  201. #define H7 0x807
  202. #define J0 0xA00
  203. #define J1 0xA01
  204. #define J2 0xA02
  205. #define J3 0xA03
  206. #define J4 0xA04
  207. #define J5 0xA05
  208. #define J6 0xA06
  209. #define J7 0xA07
  210. #define K0 0xB00
  211. #define K1 0xB01
  212. #define K2 0xB02
  213. #define K3 0xB03
  214. #define K4 0xB04
  215. #define K5 0xB05
  216. #define K6 0xB06
  217. #define K7 0xB07
  218. #define L0 0xC00
  219. #define L1 0xC01
  220. #define L2 0xC02
  221. #define L3 0xC03
  222. #define L4 0xC04
  223. #define L5 0xC05
  224. #define L6 0xC06
  225. #define L7 0xC07
  226. #if LED == B0
  227. #undef LED
  228. #define LED_DDR DDRB
  229. #define LED_PORT PORTB
  230. #define LED_PIN PINB
  231. #define LED PINB0
  232. #elif LED == B1
  233. #undef LED
  234. #define LED_DDR DDRB
  235. #define LED_PORT PORTB
  236. #define LED_PIN PINB
  237. #define LED PINB1
  238. #elif LED == B2
  239. #undef LED
  240. #define LED_DDR DDRB
  241. #define LED_PORT PORTB
  242. #define LED_PIN PINB
  243. #define LED PINB2
  244. #elif LED == B3
  245. #undef LED
  246. #define LED_DDR DDRB
  247. #define LED_PORT PORTB
  248. #define LED_PIN PINB
  249. #define LED PINB3
  250. #elif LED == B4
  251. #undef LED
  252. #define LED_DDR DDRB
  253. #define LED_PORT PORTB
  254. #define LED_PIN PINB
  255. #define LED PINB4
  256. #elif LED == B5
  257. #undef LED
  258. #define LED_DDR DDRB
  259. #define LED_PORT PORTB
  260. #define LED_PIN PINB
  261. #define LED PINB5
  262. #elif LED == B6
  263. #undef LED
  264. #define LED_DDR DDRB
  265. #define LED_PORT PORTB
  266. #define LED_PIN PINB
  267. #define LED PINB6
  268. #elif LED == B7
  269. #undef LED
  270. #define LED_DDR DDRB
  271. #define LED_PORT PORTB
  272. #define LED_PIN PINB
  273. #define LED PINB7
  274. #elif LED == C0
  275. #undef LED
  276. #define LED_DDR DDRC
  277. #define LED_PORT PORTC
  278. #define LED_PIN PINC
  279. #define LED PINC0
  280. #elif LED == C1
  281. #undef LED
  282. #define LED_DDR DDRC
  283. #define LED_PORT PORTC
  284. #define LED_PIN PINC
  285. #define LED PINC1
  286. #elif LED == C2
  287. #undef LED
  288. #define LED_DDR DDRC
  289. #define LED_PORT PORTC
  290. #define LED_PIN PINC
  291. #define LED PINC2
  292. #elif LED == C3
  293. #undef LED
  294. #define LED_DDR DDRC
  295. #define LED_PORT PORTC
  296. #define LED_PIN PINC
  297. #define LED PINC3
  298. #elif LED == C4
  299. #undef LED
  300. #define LED_DDR DDRC
  301. #define LED_PORT PORTC
  302. #define LED_PIN PINC
  303. #define LED PINC4
  304. #elif LED == C5
  305. #undef LED
  306. #define LED_DDR DDRC
  307. #define LED_PORT PORTC
  308. #define LED_PIN PINC
  309. #define LED PINC5
  310. #elif LED == C6
  311. #undef LED
  312. #define LED_DDR DDRC
  313. #define LED_PORT PORTC
  314. #define LED_PIN PINC
  315. #define LED PINC6
  316. #elif LED == C7
  317. #undef LED
  318. #define LED_DDR DDRC
  319. #define LED_PORT PORTC
  320. #define LED_PIN PINC
  321. #define LED PINC7
  322. #elif LED == D0
  323. #undef LED
  324. #define LED_DDR DDRD
  325. #define LED_PORT PORTD
  326. #define LED_PIN PIND
  327. #define LED PIND0
  328. #elif LED == D1
  329. #undef LED
  330. #define LED_DDR DDRD
  331. #define LED_PORT PORTD
  332. #define LED_PIN PIND
  333. #define LED PIND1
  334. #elif LED == D2
  335. #undef LED
  336. #define LED_DDR DDRD
  337. #define LED_PORT PORTD
  338. #define LED_PIN PIND
  339. #define LED PIND2
  340. #elif LED == D3
  341. #undef LED
  342. #define LED_DDR DDRD
  343. #define LED_PORT PORTD
  344. #define LED_PIN PIND
  345. #define LED PIND3
  346. #elif LED == D4
  347. #undef LED
  348. #define LED_DDR DDRD
  349. #define LED_PORT PORTD
  350. #define LED_PIN PIND
  351. #define LED PIND4
  352. #elif LED == D5
  353. #undef LED
  354. #define LED_DDR DDRD
  355. #define LED_PORT PORTD
  356. #define LED_PIN PIND
  357. #define LED PIND5
  358. #elif LED == D6
  359. #undef LED
  360. #define LED_DDR DDRD
  361. #define LED_PORT PORTD
  362. #define LED_PIN PIND
  363. #define LED PIND6
  364. #elif LED == D7
  365. #undef LED
  366. #define LED_DDR DDRD
  367. #define LED_PORT PORTD
  368. #define LED_PIN PIND
  369. #define LED PIND7
  370. #elif LED == E0
  371. #undef LED
  372. #define LED_DDR DDRE
  373. #define LED_PORT PORTE
  374. #define LED_PIN PINE
  375. #define LED PINE0
  376. #elif LED == E1
  377. #undef LED
  378. #define LED_DDR DDRE
  379. #define LED_PORT PORTE
  380. #define LED_PIN PINE
  381. #define LED PINE1
  382. #elif LED == E2
  383. #undef LED
  384. #define LED_DDR DDRE
  385. #define LED_PORT PORTE
  386. #define LED_PIN PINE
  387. #define LED PINE2
  388. #elif LED == E3
  389. #undef LED
  390. #define LED_DDR DDRE
  391. #define LED_PORT PORTE
  392. #define LED_PIN PINE
  393. #define LED PINE3
  394. #elif LED == E4
  395. #undef LED
  396. #define LED_DDR DDRE
  397. #define LED_PORT PORTE
  398. #define LED_PIN PINE
  399. #define LED PINE4
  400. #elif LED == E5
  401. #undef LED
  402. #define LED_DDR DDRE
  403. #define LED_PORT PORTE
  404. #define LED_PIN PINE
  405. #define LED PINE5
  406. #elif LED == E6
  407. #undef LED
  408. #define LED_DDR DDRE
  409. #define LED_PORT PORTE
  410. #define LED_PIN PINE
  411. #define LED PINE6
  412. #elif LED == E7
  413. #undef LED
  414. #define LED_DDR DDRE
  415. #define LED_PORT PORTE
  416. #define LED_PIN PINE
  417. #define LED PINE7
  418. #elif LED == F0
  419. #undef LED
  420. #define LED_DDR DDRF
  421. #define LED_PORT PORTF
  422. #define LED_PIN PINF
  423. #define LED PINF0
  424. #elif LED == F1
  425. #undef LED
  426. #define LED_DDR DDRF
  427. #define LED_PORT PORTF
  428. #define LED_PIN PINF
  429. #define LED PINF1
  430. #elif LED == F2
  431. #undef LED
  432. #define LED_DDR DDRF
  433. #define LED_PORT PORTF
  434. #define LED_PIN PINF
  435. #define LED PINF2
  436. #elif LED == F3
  437. #undef LED
  438. #define LED_DDR DDRF
  439. #define LED_PORT PORTF
  440. #define LED_PIN PINF
  441. #define LED PINF3
  442. #elif LED == F4
  443. #undef LED
  444. #define LED_DDR DDRF
  445. #define LED_PORT PORTF
  446. #define LED_PIN PINF
  447. #define LED PINF4
  448. #elif LED == F5
  449. #undef LED
  450. #define LED_DDR DDRF
  451. #define LED_PORT PORTF
  452. #define LED_PIN PINF
  453. #define LED PINF5
  454. #elif LED == F6
  455. #undef LED
  456. #define LED_DDR DDRF
  457. #define LED_PORT PORTF
  458. #define LED_PIN PINF
  459. #define LED PINF6
  460. #elif LED == F7
  461. #undef LED
  462. #define LED_DDR DDRF
  463. #define LED_PORT PORTF
  464. #define LED_PIN PINF
  465. #define LED PINF7
  466. #elif LED == G0
  467. #undef LED
  468. #define LED_DDR DDRG
  469. #define LED_PORT PORTG
  470. #define LED_PIN PING
  471. #define LED PING0
  472. #elif LED == G1
  473. #undef LED
  474. #define LED_DDR DDRG
  475. #define LED_PORT PORTG
  476. #define LED_PIN PING
  477. #define LED PING1
  478. #elif LED == G2
  479. #undef LED
  480. #define LED_DDR DDRG
  481. #define LED_PORT PORTG
  482. #define LED_PIN PING
  483. #define LED PING2
  484. #elif LED == G3
  485. #undef LED
  486. #define LED_DDR DDRG
  487. #define LED_PORT PORTG
  488. #define LED_PIN PING
  489. #define LED PING3
  490. #elif LED == G4
  491. #undef LED
  492. #define LED_DDR DDRG
  493. #define LED_PORT PORTG
  494. #define LED_PIN PING
  495. #define LED PING4
  496. #elif LED == G5
  497. #undef LED
  498. #define LED_DDR DDRG
  499. #define LED_PORT PORTG
  500. #define LED_PIN PING
  501. #define LED PING5
  502. #elif LED == G6
  503. #undef LED
  504. #define LED_DDR DDRG
  505. #define LED_PORT PORTG
  506. #define LED_PIN PING
  507. #define LED PING6
  508. #elif LED == G7
  509. #undef LED
  510. #define LED_DDR DDRG
  511. #define LED_PORT PORTG
  512. #define LED_PIN PING
  513. #define LED PING7
  514. #elif LED == H0
  515. #undef LED
  516. #define LED_DDR DDRH
  517. #define LED_PORT PORTH
  518. #define LED_PIN PINH
  519. #define LED PINH0
  520. #elif LED == H1
  521. #undef LED
  522. #define LED_DDR DDRH
  523. #define LED_PORT PORTH
  524. #define LED_PIN PINH
  525. #define LED PINH1
  526. #elif LED == H2
  527. #undef LED
  528. #define LED_DDR DDRH
  529. #define LED_PORT PORTH
  530. #define LED_PIN PINH
  531. #define LED PINH2
  532. #elif LED == H3
  533. #undef LED
  534. #define LED_DDR DDRH
  535. #define LED_PORT PORTH
  536. #define LED_PIN PINH
  537. #define LED PINH3
  538. #elif LED == H4
  539. #undef LED
  540. #define LED_DDR DDRH
  541. #define LED_PORT PORTH
  542. #define LED_PIN PINH
  543. #define LED PINH4
  544. #elif LED == H5
  545. #undef LED
  546. #define LED_DDR DDRH
  547. #define LED_PORT PORTH
  548. #define LED_PIN PINH
  549. #define LED PINH5
  550. #elif LED == H6
  551. #undef LED
  552. #define LED_DDR DDRH
  553. #define LED_PORT PORTH
  554. #define LED_PIN PINH
  555. #define LED PINH6
  556. #elif LED == H7
  557. #undef LED
  558. #define LED_DDR DDRH
  559. #define LED_PORT PORTH
  560. #define LED_PIN PINH
  561. #define LED PINH7
  562. #elif LED == J0
  563. #undef LED
  564. #define LED_DDR DDRJ
  565. #define LED_PORT PORTJ
  566. #define LED_PIN PINJ
  567. #define LED PINJ0
  568. #elif LED == J1
  569. #undef LED
  570. #define LED_DDR DDRJ
  571. #define LED_PORT PORTJ
  572. #define LED_PIN PINJ
  573. #define LED PINJ1
  574. #elif LED == J2
  575. #undef LED
  576. #define LED_DDR DDRJ
  577. #define LED_PORT PORTJ
  578. #define LED_PIN PINJ
  579. #define LED PINJ2
  580. #elif LED == J3
  581. #undef LED
  582. #define LED_DDR DDRJ
  583. #define LED_PORT PORTJ
  584. #define LED_PIN PINJ
  585. #define LED PINJ3
  586. #elif LED == J4
  587. #undef LED
  588. #define LED_DDR DDRJ
  589. #define LED_PORT PORTJ
  590. #define LED_PIN PINJ
  591. #define LED PINJ4
  592. #elif LED == J5
  593. #undef LED
  594. #define LED_DDR DDRJ
  595. #define LED_PORT PORTJ
  596. #define LED_PIN PINJ
  597. #define LED PINJ5
  598. #elif LED == J6
  599. #undef LED
  600. #define LED_DDR DDRJ
  601. #define LED_PORT PORTJ
  602. #define LED_PIN PINJ
  603. #define LED PINJ6
  604. #elif LED == J7
  605. #undef LED
  606. #define LED_DDR DDRJ
  607. #define LED_PORT PORTJ
  608. #define LED_PIN PINJ
  609. #define LED PINJ7
  610. #elif LED == K0
  611. #undef LED
  612. #define LED_DDR DDRK
  613. #define LED_PORT PORTK
  614. #define LED_PIN PINK
  615. #define LED PINK0
  616. #elif LED == K1
  617. #undef LED
  618. #define LED_DDR DDRK
  619. #define LED_PORT PORTK
  620. #define LED_PIN PINK
  621. #define LED PINK1
  622. #elif LED == K2
  623. #undef LED
  624. #define LED_DDR DDRK
  625. #define LED_PORT PORTK
  626. #define LED_PIN PINK
  627. #define LED PINK2
  628. #elif LED == K3
  629. #undef LED
  630. #define LED_DDR DDRK
  631. #define LED_PORT PORTK
  632. #define LED_PIN PINK
  633. #define LED PINK3
  634. #elif LED == K4
  635. #undef LED
  636. #define LED_DDR DDRK
  637. #define LED_PORT PORTK
  638. #define LED_PIN PINK
  639. #define LED PINK4
  640. #elif LED == K5
  641. #undef LED
  642. #define LED_DDR DDRK
  643. #define LED_PORT PORTK
  644. #define LED_PIN PINK
  645. #define LED PINK5
  646. #elif LED == K6
  647. #undef LED
  648. #define LED_DDR DDRK
  649. #define LED_PORT PORTK
  650. #define LED_PIN PINK
  651. #define LED PINK6
  652. #elif LED == K7
  653. #undef LED
  654. #define LED_DDR DDRK
  655. #define LED_PORT PORTK
  656. #define LED_PIN PINK
  657. #define LED PINK7
  658. #elif LED == L0
  659. #undef LED
  660. #define LED_DDR DDRL
  661. #define LED_PORT PORTL
  662. #define LED_PIN PINL
  663. #define LED PINL0
  664. #elif LED == L1
  665. #undef LED
  666. #define LED_DDR DDRL
  667. #define LED_PORT PORTL
  668. #define LED_PIN PINL
  669. #define LED PINL1
  670. #elif LED == L2
  671. #undef LED
  672. #define LED_DDR DDRL
  673. #define LED_PORT PORTL
  674. #define LED_PIN PINL
  675. #define LED PINL2
  676. #elif LED == L3
  677. #undef LED
  678. #define LED_DDR DDRL
  679. #define LED_PORT PORTL
  680. #define LED_PIN PINL
  681. #define LED PINL3
  682. #elif LED == L4
  683. #undef LED
  684. #define LED_DDR DDRL
  685. #define LED_PORT PORTL
  686. #define LED_PIN PINL
  687. #define LED PINL4
  688. #elif LED == L5
  689. #undef LED
  690. #define LED_DDR DDRL
  691. #define LED_PORT PORTL
  692. #define LED_PIN PINL
  693. #define LED PINL5
  694. #elif LED == L6
  695. #undef LED
  696. #define LED_DDR DDRL
  697. #define LED_PORT PORTL
  698. #define LED_PIN PINL
  699. #define LED PINL6
  700. #elif LED == L7
  701. #undef LED
  702. #define LED_DDR DDRL
  703. #define LED_PORT PORTL
  704. #define LED_PIN PINL
  705. #define LED PINL7
  706. #elif LED == A0
  707. #undef LED
  708. #define LED_DDR DDRA
  709. #define LED_PORT PORTA
  710. #define LED_PIN PINA
  711. #define LED PINA0
  712. #elif LED == A1
  713. #undef LED
  714. #define LED_DDR DDRA
  715. #define LED_PORT PORTA
  716. #define LED_PIN PINA
  717. #define LED PINA1
  718. #elif LED == A2
  719. #undef LED
  720. #define LED_DDR DDRA
  721. #define LED_PORT PORTA
  722. #define LED_PIN PINA
  723. #define LED PINA2
  724. #elif LED == A3
  725. #undef LED
  726. #define LED_DDR DDRA
  727. #define LED_PORT PORTA
  728. #define LED_PIN PINA
  729. #define LED PINA3
  730. #elif LED == A4
  731. #undef LED
  732. #define LED_DDR DDRA
  733. #define LED_PORT PORTA
  734. #define LED_PIN PINA
  735. #define LED PINA4
  736. #elif LED == A5
  737. #undef LED
  738. #define LED_DDR DDRA
  739. #define LED_PORT PORTA
  740. #define LED_PIN PINA
  741. #define LED PINA5
  742. #elif LED == A6
  743. #undef LED
  744. #define LED_DDR DDRA
  745. #define LED_PORT PORTA
  746. #define LED_PIN PINA
  747. #define LED PINA6
  748. #elif LED == A7
  749. #undef LED
  750. #define LED_DDR DDRA
  751. #define LED_PORT PORTA
  752. #define LED_PIN PINA
  753. #define LED PINA7
  754. #else
  755. #error -------------------------------------------
  756. #error Unrecognized LED name. Should be like "B5"
  757. #error -------------------------------------------
  758. #endif