pins_softuart.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. #undef UART_PORT
  2. #undef UART_PIN
  3. #undef UART_DDR
  4. #undef UART_TX_BIT
  5. #undef UART_RX_BIT
  6. #if SOFTTX == B0
  7. #define SOFTTX_NAME "B0"
  8. #define UART_DDR DDRB
  9. #define UART_PORT PORTB
  10. #define UART_TX_BIT PINB0
  11. #elif SOFTTX == B1
  12. #define SOFTTX_NAME "B1"
  13. #define UART_DDR DDRB
  14. #define UART_PORT PORTB
  15. #define UART_TX_BIT PINB1
  16. #elif SOFTTX == B2
  17. #define SOFTTX_NAME "B2"
  18. #define UART_DDR DDRB
  19. #define UART_PORT PORTB
  20. #define UART_TX_BIT PINB2
  21. #elif SOFTTX == B3
  22. #define SOFTTX_NAME "B3"
  23. #define UART_DDR DDRB
  24. #define UART_PORT PORTB
  25. #define UART_TX_BIT PINB3
  26. #elif SOFTTX == B4
  27. #define SOFTTX_NAME "B4"
  28. #define UART_DDR DDRB
  29. #define UART_PORT PORTB
  30. #define UART_TX_BIT PINB4
  31. #elif SOFTTX == B5
  32. #define SOFTTX_NAME "B5"
  33. #define UART_DDR DDRB
  34. #define UART_PORT PORTB
  35. #define UART_TX_BIT PINB5
  36. #elif SOFTTX == B6
  37. #define SOFTTX_NAME "B6"
  38. #define UART_DDR DDRB
  39. #define UART_PORT PORTB
  40. #define UART_TX_BIT PINB6
  41. #elif SOFTTX == B7
  42. #define SOFTTX_NAME "B7"
  43. #define UART_DDR DDRB
  44. #define UART_PORT PORTB
  45. #define UART_TX_BIT PINB7
  46. #elif SOFTTX == C0
  47. #define SOFTTX_NAME "C0"
  48. #define UART_DDR DDRC
  49. #define UART_PORT PORTC
  50. #define UART_TX_BIT PINC0
  51. #elif SOFTTX == C1
  52. #define SOFTTX_NAME "C1"
  53. #define UART_DDR DDRC
  54. #define UART_PORT PORTC
  55. #define UART_TX_BIT PINC1
  56. #elif SOFTTX == C2
  57. #define SOFTTX_NAME "C2"
  58. #define UART_DDR DDRC
  59. #define UART_PORT PORTC
  60. #define UART_TX_BIT PINC2
  61. #elif SOFTTX == C3
  62. #define SOFTTX_NAME "C3"
  63. #define UART_DDR DDRC
  64. #define UART_PORT PORTC
  65. #define UART_TX_BIT PINC3
  66. #elif SOFTTX == C4
  67. #define SOFTTX_NAME "C4"
  68. #define UART_DDR DDRC
  69. #define UART_PORT PORTC
  70. #define UART_TX_BIT PINC4
  71. #elif SOFTTX == C5
  72. #define SOFTTX_NAME "C5"
  73. #define UART_DDR DDRC
  74. #define UART_PORT PORTC
  75. #define UART_TX_BIT PINC5
  76. #elif SOFTTX == C6
  77. #define SOFTTX_NAME "C6"
  78. #define UART_DDR DDRC
  79. #define UART_PORT PORTC
  80. #define UART_TX_BIT PINC6
  81. #elif SOFTTX == C7
  82. #define SOFTTX_NAME "C7"
  83. #define UART_DDR DDRC
  84. #define UART_PORT PORTC
  85. #define UART_TX_BIT PINC7
  86. #elif SOFTTX == D0
  87. #define SOFTTX_NAME "D0"
  88. #define UART_DDR DDRD
  89. #define UART_PORT PORTD
  90. #define UART_TX_BIT PIND0
  91. #elif SOFTTX == D1
  92. #define SOFTTX_NAME "D1"
  93. #define UART_DDR DDRD
  94. #define UART_PORT PORTD
  95. #define UART_TX_BIT PIND1
  96. #elif SOFTTX == D2
  97. #define SOFTTX_NAME "D2"
  98. #define UART_DDR DDRD
  99. #define UART_PORT PORTD
  100. #define UART_TX_BIT PIND2
  101. #elif SOFTTX == D3
  102. #define SOFTTX_NAME "D3"
  103. #define UART_DDR DDRD
  104. #define UART_PORT PORTD
  105. #define UART_TX_BIT PIND3
  106. #elif SOFTTX == D4
  107. #define SOFTTX_NAME "D4"
  108. #define UART_DDR DDRD
  109. #define UART_PORT PORTD
  110. #define UART_TX_BIT PIND4
  111. #elif SOFTTX == D5
  112. #define SOFTTX_NAME "D5"
  113. #define UART_DDR DDRD
  114. #define UART_PORT PORTD
  115. #define UART_TX_BIT PIND5
  116. #elif SOFTTX == D6
  117. #define SOFTTX_NAME "D6"
  118. #define UART_DDR DDRD
  119. #define UART_PORT PORTD
  120. #define UART_TX_BIT PIND6
  121. #elif SOFTTX == D7
  122. #define SOFTTX_NAME "D7"
  123. #define UART_DDR DDRD
  124. #define UART_PORT PORTD
  125. #define UART_TX_BIT PIND7
  126. #elif SOFTTX == E0
  127. #define SOFTTX_NAME "E0"
  128. #define UART_DDR DDRE
  129. #define UART_PORT PORTE
  130. #define UART_TX_BIT PINE0
  131. #elif SOFTTX == E1
  132. #define SOFTTX_NAME "E1"
  133. #define UART_DDR DDRE
  134. #define UART_PORT PORTE
  135. #define UART_TX_BIT PINE1
  136. #elif SOFTTX == E2
  137. #define SOFTTX_NAME "E2"
  138. #define UART_DDR DDRE
  139. #define UART_PORT PORTE
  140. #define UART_TX_BIT PINE2
  141. #elif SOFTTX == E3
  142. #define SOFTTX_NAME "E3"
  143. #define UART_DDR DDRE
  144. #define UART_PORT PORTE
  145. #define UART_TX_BIT PINE3
  146. #elif SOFTTX == E4
  147. #define SOFTTX_NAME "E4"
  148. #define UART_DDR DDRE
  149. #define UART_PORT PORTE
  150. #define UART_TX_BIT PINE4
  151. #elif SOFTTX == E5
  152. #define SOFTTX_NAME "E5"
  153. #define UART_DDR DDRE
  154. #define UART_PORT PORTE
  155. #define UART_TX_BIT PINE5
  156. #elif SOFTTX == E6
  157. #define SOFTTX_NAME "E6"
  158. #define UART_DDR DDRE
  159. #define UART_PORT PORTE
  160. #define UART_TX_BIT PINE6
  161. #elif SOFTTX == E7
  162. #define SOFTTX_NAME "E7"
  163. #define UART_DDR DDRE
  164. #define UART_PORT PORTE
  165. #define UART_TX_BIT PINE7
  166. #elif SOFTTX == F0
  167. #define SOFTTX_NAME "F0"
  168. #define UART_DDR DDRF
  169. #define UART_PORT PORTF
  170. #define UART_TX_BIT PINF0
  171. #elif SOFTTX == F1
  172. #define SOFTTX_NAME "F1"
  173. #define UART_DDR DDRF
  174. #define UART_PORT PORTF
  175. #define UART_TX_BIT PINF1
  176. #elif SOFTTX == F2
  177. #define SOFTTX_NAME "F2"
  178. #define UART_DDR DDRF
  179. #define UART_PORT PORTF
  180. #define UART_TX_BIT PINF2
  181. #elif SOFTTX == F3
  182. #define SOFTTX_NAME "F3"
  183. #define UART_DDR DDRF
  184. #define UART_PORT PORTF
  185. #define UART_TX_BIT PINF3
  186. #elif SOFTTX == F4
  187. #define SOFTTX_NAME "F4"
  188. #define UART_DDR DDRF
  189. #define UART_PORT PORTF
  190. #define UART_TX_BIT PINF4
  191. #elif SOFTTX == F5
  192. #define SOFTTX_NAME "F5"
  193. #define UART_DDR DDRF
  194. #define UART_PORT PORTF
  195. #define UART_TX_BIT PINF5
  196. #elif SOFTTX == F6
  197. #define SOFTTX_NAME "F6"
  198. #define UART_DDR DDRF
  199. #define UART_PORT PORTF
  200. #define UART_TX_BIT PINF6
  201. #elif SOFTTX == F7
  202. #define SOFTTX_NAME "F7"
  203. #define UART_DDR DDRF
  204. #define UART_PORT PORTF
  205. #define UART_TX_BIT PINF7
  206. #elif SOFTTX == G0
  207. #define SOFTTX_NAME "G0"
  208. #define UART_DDR DDRG
  209. #define UART_PORT PORTG
  210. #define UART_TX_BIT PING0
  211. #elif SOFTTX == G1
  212. #define SOFTTX_NAME "G1"
  213. #define UART_DDR DDRG
  214. #define UART_PORT PORTG
  215. #define UART_TX_BIT PING1
  216. #elif SOFTTX == G2
  217. #define SOFTTX_NAME "G2"
  218. #define UART_DDR DDRG
  219. #define UART_PORT PORTG
  220. #define UART_TX_BIT PING2
  221. #elif SOFTTX == G3
  222. #define SOFTTX_NAME "G3"
  223. #define UART_DDR DDRG
  224. #define UART_PORT PORTG
  225. #define UART_TX_BIT PING3
  226. #elif SOFTTX == G4
  227. #define SOFTTX_NAME "G4"
  228. #define UART_DDR DDRG
  229. #define UART_PORT PORTG
  230. #define UART_TX_BIT PING4
  231. #elif SOFTTX == G5
  232. #define SOFTTX_NAME "G5"
  233. #define UART_DDR DDRG
  234. #define UART_PORT PORTG
  235. #define UART_TX_BIT PING5
  236. #elif SOFTTX == G6
  237. #define SOFTTX_NAME "G6"
  238. #define UART_DDR DDRG
  239. #define UART_PORT PORTG
  240. #define UART_TX_BIT PING6
  241. #elif SOFTTX == G7
  242. #define SOFTTX_NAME "G7"
  243. #define UART_DDR DDRG
  244. #define UART_PORT PORTG
  245. #define UART_TX_BIT PING7
  246. #elif SOFTTX == H0
  247. #define SOFTTX_NAME "H0"
  248. #define UART_DDR DDRH
  249. #define UART_PORT PORTH
  250. #define UART_TX_BIT PINH0
  251. #elif SOFTTX == H1
  252. #define SOFTTX_NAME "H1"
  253. #define UART_DDR DDRH
  254. #define UART_PORT PORTH
  255. #define UART_TX_BIT PINH1
  256. #elif SOFTTX == H2
  257. #define SOFTTX_NAME "H2"
  258. #define UART_DDR DDRH
  259. #define UART_PORT PORTH
  260. #define UART_TX_BIT PINH2
  261. #elif SOFTTX == H3
  262. #define SOFTTX_NAME "H3"
  263. #define UART_DDR DDRH
  264. #define UART_PORT PORTH
  265. #define UART_TX_BIT PINH3
  266. #elif SOFTTX == H4
  267. #define SOFTTX_NAME "H4"
  268. #define UART_DDR DDRH
  269. #define UART_PORT PORTH
  270. #define UART_TX_BIT PINH4
  271. #elif SOFTTX == H5
  272. #define SOFTTX_NAME "H5"
  273. #define UART_DDR DDRH
  274. #define UART_PORT PORTH
  275. #define UART_TX_BIT PINH5
  276. #elif SOFTTX == H6
  277. #define SOFTTX_NAME "H6"
  278. #define UART_DDR DDRH
  279. #define UART_PORT PORTH
  280. #define UART_TX_BIT PINH6
  281. #elif SOFTTX == H7
  282. #define SOFTTX_NAME "H7"
  283. #define UART_DDR DDRH
  284. #define UART_PORT PORTH
  285. #define UART_TX_BIT PINH7
  286. #elif SOFTTX == J0
  287. #define SOFTTX_NAME "J0"
  288. #define UART_DDR DDRJ
  289. #define UART_PORT PORTJ
  290. #define UART_TX_BIT PINJ0
  291. #elif SOFTTX == J1
  292. #define SOFTTX_NAME "J1"
  293. #define UART_DDR DDRJ
  294. #define UART_PORT PORTJ
  295. #define UART_TX_BIT PINJ1
  296. #elif SOFTTX == J2
  297. #define SOFTTX_NAME "J2"
  298. #define UART_DDR DDRJ
  299. #define UART_PORT PORTJ
  300. #define UART_TX_BIT PINJ2
  301. #elif SOFTTX == J3
  302. #define SOFTTX_NAME "J3"
  303. #define UART_DDR DDRJ
  304. #define UART_PORT PORTJ
  305. #define UART_TX_BIT PINJ3
  306. #elif SOFTTX == J4
  307. #define SOFTTX_NAME "J4"
  308. #define UART_DDR DDRJ
  309. #define UART_PORT PORTJ
  310. #define UART_TX_BIT PINJ4
  311. #elif SOFTTX == J5
  312. #define SOFTTX_NAME "J5"
  313. #define UART_DDR DDRJ
  314. #define UART_PORT PORTJ
  315. #define UART_TX_BIT PINJ5
  316. #elif SOFTTX == J6
  317. #define SOFTTX_NAME "J6"
  318. #define UART_DDR DDRJ
  319. #define UART_PORT PORTJ
  320. #define UART_TX_BIT PINJ6
  321. #elif SOFTTX == J7
  322. #define SOFTTX_NAME "J7"
  323. #define UART_DDR DDRJ
  324. #define UART_PORT PORTJ
  325. #define UART_TX_BIT PINJ7
  326. #elif SOFTTX == K0
  327. #define SOFTTX_NAME "K0"
  328. #define UART_DDR DDRK
  329. #define UART_PORT PORTK
  330. #define UART_TX_BIT PINK0
  331. #elif SOFTTX == K1
  332. #define SOFTTX_NAME "K1"
  333. #define UART_DDR DDRK
  334. #define UART_PORT PORTK
  335. #define UART_TX_BIT PINK1
  336. #elif SOFTTX == K2
  337. #define SOFTTX_NAME "K2"
  338. #define UART_DDR DDRK
  339. #define UART_PORT PORTK
  340. #define UART_TX_BIT PINK2
  341. #elif SOFTTX == K3
  342. #define SOFTTX_NAME "K3"
  343. #define UART_DDR DDRK
  344. #define UART_PORT PORTK
  345. #define UART_TX_BIT PINK3
  346. #elif SOFTTX == K4
  347. #define SOFTTX_NAME "K4"
  348. #define UART_DDR DDRK
  349. #define UART_PORT PORTK
  350. #define UART_TX_BIT PINK4
  351. #elif SOFTTX == K5
  352. #define SOFTTX_NAME "K5"
  353. #define UART_DDR DDRK
  354. #define UART_PORT PORTK
  355. #define UART_TX_BIT PINK5
  356. #elif SOFTTX == K6
  357. #define SOFTTX_NAME "K6"
  358. #define UART_DDR DDRK
  359. #define UART_PORT PORTK
  360. #define UART_TX_BIT PINK6
  361. #elif SOFTTX == K7
  362. #define SOFTTX_NAME "K7"
  363. #define UART_DDR DDRK
  364. #define UART_PORT PORTK
  365. #define UART_TX_BIT PINK7
  366. #elif SOFTTX == L0
  367. #define SOFTTX_NAME "L0"
  368. #define UART_DDR DDRL
  369. #define UART_PORT PORTL
  370. #define UART_TX_BIT PINL0
  371. #elif SOFTTX == L1
  372. #define SOFTTX_NAME "L1"
  373. #define UART_DDR DDRL
  374. #define UART_PORT PORTL
  375. #define UART_TX_BIT PINL1
  376. #elif SOFTTX == L2
  377. #define SOFTTX_NAME "L2"
  378. #define UART_DDR DDRL
  379. #define UART_PORT PORTL
  380. #define UART_TX_BIT PINL2
  381. #elif SOFTTX == L3
  382. #define SOFTTX_NAME "L3"
  383. #define UART_DDR DDRL
  384. #define UART_PORT PORTL
  385. #define UART_TX_BIT PINL3
  386. #elif SOFTTX == L4
  387. #define SOFTTX_NAME "L4"
  388. #define UART_DDR DDRL
  389. #define UART_PORT PORTL
  390. #define UART_TX_BIT PINL4
  391. #elif SOFTTX == L5
  392. #define SOFTTX_NAME "L5"
  393. #define UART_DDR DDRL
  394. #define UART_PORT PORTL
  395. #define UART_TX_BIT PINL5
  396. #elif SOFTTX == L6
  397. #define SOFTTX_NAME "L6"
  398. #define UART_DDR DDRL
  399. #define UART_PORT PORTL
  400. #define UART_TX_BIT PINL6
  401. #elif SOFTTX == L7
  402. #define SOFTTX_NAME "L7"
  403. #define UART_DDR DDRL
  404. #define UART_PORT PORTL
  405. #define UART_TX_BIT PINL7
  406. #elif SOFTTX == A0
  407. #define SOFTTX_NAME "A0"
  408. #define UART_DDR DDRA
  409. #define UART_PORT PORTA
  410. #define UART_TX_BIT PINA0
  411. #elif SOFTTX == A1
  412. #define SOFTTX_NAME "A1"
  413. #define UART_DDR DDRA
  414. #define UART_PORT PORTA
  415. #define UART_TX_BIT PINA1
  416. #elif SOFTTX == A2
  417. #define SOFTTX_NAME "A2"
  418. #define UART_DDR DDRA
  419. #define UART_PORT PORTA
  420. #define UART_TX_BIT PINA2
  421. #elif SOFTTX == A3
  422. #define SOFTTX_NAME "A3"
  423. #define UART_DDR DDRA
  424. #define UART_PORT PORTA
  425. #define UART_TX_BIT PINA3
  426. #elif SOFTTX == A4
  427. #define SOFTTX_NAME "A4"
  428. #define UART_DDR DDRA
  429. #define UART_PORT PORTA
  430. #define UART_TX_BIT PINA4
  431. #elif SOFTTX == A5
  432. #define SOFTTX_NAME "A5"
  433. #define UART_DDR DDRA
  434. #define UART_PORT PORTA
  435. #define UART_TX_BIT PINA5
  436. #elif SOFTTX == A6
  437. #define SOFTTX_NAME "A6"
  438. #define UART_DDR DDRA
  439. #define UART_PORT PORTA
  440. #define UART_TX_BIT PINA6
  441. #elif SOFTTX == A7
  442. #define SOFTTX_NAME "A7"
  443. #define UART_DDR DDRA
  444. #define UART_PORT PORTA
  445. #define UART_TX_BIT PINA7
  446. #else
  447. #error -------------------------------------------
  448. #error Unrecognized SOFTTX name. Should be like "B5"
  449. #error -------------------------------------------
  450. #endif
  451. #if SOFTRX == B0
  452. #define SOFTRX_NAME "B0"
  453. #define UART_PIN PINB
  454. #define UART_RX_BIT PINB0
  455. #elif SOFTRX == B1
  456. #define SOFTRX_NAME "B1"
  457. #define UART_PIN PINB
  458. #define UART_RX_BIT PINB1
  459. #elif SOFTRX == B2
  460. #define SOFTRX_NAME "B2"
  461. #define UART_PIN PINB
  462. #define UART_RX_BIT PINB2
  463. #elif SOFTRX == B3
  464. #define SOFTRX_NAME "B3"
  465. #define UART_PIN PINB
  466. #define UART_RX_BIT PINB3
  467. #elif SOFTRX == B4
  468. #define SOFTRX_NAME "B4"
  469. #define UART_PIN PINB
  470. #define UART_RX_BIT PINB4
  471. #elif SOFTRX == B5
  472. #define SOFTRX_NAME "B5"
  473. #define UART_PIN PINB
  474. #define UART_RX_BIT PINB5
  475. #elif SOFTRX == B6
  476. #define SOFTRX_NAME "B6"
  477. #define UART_PIN PINB
  478. #define UART_RX_BIT PINB6
  479. #elif SOFTRX == B7
  480. #define SOFTRX_NAME "B7"
  481. #define UART_PIN PINB
  482. #define UART_RX_BIT PINB7
  483. #elif SOFTRX == C0
  484. #define SOFTRX_NAME "C0"
  485. #define UART_PIN PINC
  486. #define UART_RX_BIT PINC0
  487. #elif SOFTRX == C1
  488. #define SOFTRX_NAME "C1"
  489. #define UART_PIN PINC
  490. #define UART_RX_BIT PINC1
  491. #elif SOFTRX == C2
  492. #define SOFTRX_NAME "C2"
  493. #define UART_PIN PINC
  494. #define UART_RX_BIT PINC2
  495. #elif SOFTRX == C3
  496. #define SOFTRX_NAME "C3"
  497. #define UART_PIN PINC
  498. #define UART_RX_BIT PINC3
  499. #elif SOFTRX == C4
  500. #define SOFTRX_NAME "C4"
  501. #define UART_PIN PINC
  502. #define UART_RX_BIT PINC4
  503. #elif SOFTRX == C5
  504. #define SOFTRX_NAME "C5"
  505. #define UART_PIN PINC
  506. #define UART_RX_BIT PINC5
  507. #elif SOFTRX == C6
  508. #define SOFTRX_NAME "C6"
  509. #define UART_PIN PINC
  510. #define UART_RX_BIT PINC6
  511. #elif SOFTRX == C7
  512. #define SOFTRX_NAME "C7"
  513. #define UART_PIN PINC
  514. #define UART_RX_BIT PINC7
  515. #elif SOFTRX == D0
  516. #define SOFTRX_NAME "D0"
  517. #define UART_PIN PIND
  518. #define UART_RX_BIT PIND0
  519. #elif SOFTRX == D1
  520. #define SOFTRX_NAME "D1"
  521. #define UART_PIN PIND
  522. #define UART_RX_BIT PIND1
  523. #elif SOFTRX == D2
  524. #define SOFTRX_NAME "D2"
  525. #define UART_PIN PIND
  526. #define UART_RX_BIT PIND2
  527. #elif SOFTRX == D3
  528. #define SOFTRX_NAME "D3"
  529. #define UART_PIN PIND
  530. #define UART_RX_BIT PIND3
  531. #elif SOFTRX == D4
  532. #define SOFTRX_NAME "D4"
  533. #define UART_PIN PIND
  534. #define UART_RX_BIT PIND4
  535. #elif SOFTRX == D5
  536. #define SOFTRX_NAME "D5"
  537. #define UART_PIN PIND
  538. #define UART_RX_BIT PIND5
  539. #elif SOFTRX == D6
  540. #define SOFTRX_NAME "D6"
  541. #define UART_PIN PIND
  542. #define UART_RX_BIT PIND6
  543. #elif SOFTRX == D7
  544. #define SOFTRX_NAME "D7"
  545. #define UART_PIN PIND
  546. #define UART_RX_BIT PIND7
  547. #elif SOFTRX == E0
  548. #define SOFTRX_NAME "E0"
  549. #define UART_PIN PINE
  550. #define UART_RX_BIT PINE0
  551. #elif SOFTRX == E1
  552. #define SOFTRX_NAME "E1"
  553. #define UART_PIN PINE
  554. #define UART_RX_BIT PINE1
  555. #elif SOFTRX == E2
  556. #define SOFTRX_NAME "E2"
  557. #define UART_PIN PINE
  558. #define UART_RX_BIT PINE2
  559. #elif SOFTRX == E3
  560. #define SOFTRX_NAME "E3"
  561. #define UART_PIN PINE
  562. #define UART_RX_BIT PINE3
  563. #elif SOFTRX == E4
  564. #define SOFTRX_NAME "E4"
  565. #define UART_PIN PINE
  566. #define UART_RX_BIT PINE4
  567. #elif SOFTRX == E5
  568. #define SOFTRX_NAME "E5"
  569. #define UART_PIN PINE
  570. #define UART_RX_BIT PINE5
  571. #elif SOFTRX == E6
  572. #define SOFTRX_NAME "E6"
  573. #define UART_PIN PINE
  574. #define UART_RX_BIT PINE6
  575. #elif SOFTRX == E7
  576. #define SOFTRX_NAME "E7"
  577. #define UART_PIN PINE
  578. #define UART_RX_BIT PINE7
  579. #elif SOFTRX == F0
  580. #define SOFTRX_NAME "F0"
  581. #define UART_PIN PINF
  582. #define UART_RX_BIT PINF0
  583. #elif SOFTRX == F1
  584. #define SOFTRX_NAME "F1"
  585. #define UART_PIN PINF
  586. #define UART_RX_BIT PINF1
  587. #elif SOFTRX == F2
  588. #define SOFTRX_NAME "F2"
  589. #define UART_PIN PINF
  590. #define UART_RX_BIT PINF2
  591. #elif SOFTRX == F3
  592. #define SOFTRX_NAME "F3"
  593. #define UART_PIN PINF
  594. #define UART_RX_BIT PINF3
  595. #elif SOFTRX == F4
  596. #define SOFTRX_NAME "F4"
  597. #define UART_PIN PINF
  598. #define UART_RX_BIT PINF4
  599. #elif SOFTRX == F5
  600. #define SOFTRX_NAME "F5"
  601. #define UART_PIN PINF
  602. #define UART_RX_BIT PINF5
  603. #elif SOFTRX == F6
  604. #define SOFTRX_NAME "F6"
  605. #define UART_PIN PINF
  606. #define UART_RX_BIT PINF6
  607. #elif SOFTRX == F7
  608. #define SOFTRX_NAME "F7"
  609. #define UART_PIN PINF
  610. #define UART_RX_BIT PINF7
  611. #elif SOFTRX == G0
  612. #define SOFTRX_NAME "G0"
  613. #define UART_PIN PING
  614. #define UART_RX_BIT PING0
  615. #elif SOFTRX == G1
  616. #define SOFTRX_NAME "G1"
  617. #define UART_PIN PING
  618. #define UART_RX_BIT PING1
  619. #elif SOFTRX == G2
  620. #define SOFTRX_NAME "G2"
  621. #define UART_PIN PING
  622. #define UART_RX_BIT PING2
  623. #elif SOFTRX == G3
  624. #define SOFTRX_NAME "G3"
  625. #define UART_PIN PING
  626. #define UART_RX_BIT PING3
  627. #elif SOFTRX == G4
  628. #define SOFTRX_NAME "G4"
  629. #define UART_PIN PING
  630. #define UART_RX_BIT PING4
  631. #elif SOFTRX == G5
  632. #define SOFTRX_NAME "G5"
  633. #define UART_PIN PING
  634. #define UART_RX_BIT PING5
  635. #elif SOFTRX == G6
  636. #define SOFTRX_NAME "G6"
  637. #define UART_PIN PING
  638. #define UART_RX_BIT PING6
  639. #elif SOFTRX == G7
  640. #define SOFTRX_NAME "G7"
  641. #define UART_PIN PING
  642. #define UART_RX_BIT PING7
  643. #elif SOFTRX == H0
  644. #define SOFTRX_NAME "H0"
  645. #define UART_PIN PINH
  646. #define UART_RX_BIT PINH0
  647. #elif SOFTRX == H1
  648. #define SOFTRX_NAME "H1"
  649. #define UART_PIN PINH
  650. #define UART_RX_BIT PINH1
  651. #elif SOFTRX == H2
  652. #define SOFTRX_NAME "H2"
  653. #define UART_PIN PINH
  654. #define UART_RX_BIT PINH2
  655. #elif SOFTRX == H3
  656. #define SOFTRX_NAME "H3"
  657. #define UART_PIN PINH
  658. #define UART_RX_BIT PINH3
  659. #elif SOFTRX == H4
  660. #define SOFTRX_NAME "H4"
  661. #define UART_PIN PINH
  662. #define UART_RX_BIT PINH4
  663. #elif SOFTRX == H5
  664. #define SOFTRX_NAME "H5"
  665. #define UART_PIN PINH
  666. #define UART_RX_BIT PINH5
  667. #elif SOFTRX == H6
  668. #define SOFTRX_NAME "H6"
  669. #define UART_PIN PINH
  670. #define UART_RX_BIT PINH6
  671. #elif SOFTRX == H7
  672. #define SOFTRX_NAME "H7"
  673. #define UART_PIN PINH
  674. #define UART_RX_BIT PINH7
  675. #elif SOFTRX == J0
  676. #define SOFTRX_NAME "J0"
  677. #define UART_PIN PINJ
  678. #define UART_RX_BIT PINJ0
  679. #elif SOFTRX == J1
  680. #define SOFTRX_NAME "J1"
  681. #define UART_PIN PINJ
  682. #define UART_RX_BIT PINJ1
  683. #elif SOFTRX == J2
  684. #define SOFTRX_NAME "J2"
  685. #define UART_PIN PINJ
  686. #define UART_RX_BIT PINJ2
  687. #elif SOFTRX == J3
  688. #define SOFTRX_NAME "J3"
  689. #define UART_PIN PINJ
  690. #define UART_RX_BIT PINJ3
  691. #elif SOFTRX == J4
  692. #define SOFTRX_NAME "J4"
  693. #define UART_PIN PINJ
  694. #define UART_RX_BIT PINJ4
  695. #elif SOFTRX == J5
  696. #define SOFTRX_NAME "J5"
  697. #define UART_PIN PINJ
  698. #define UART_RX_BIT PINJ5
  699. #elif SOFTRX == J6
  700. #define SOFTRX_NAME "J6"
  701. #define UART_PIN PINJ
  702. #define UART_RX_BIT PINJ6
  703. #elif SOFTRX == J7
  704. #define SOFTRX_NAME "J7"
  705. #define UART_PIN PINJ
  706. #define UART_RX_BIT PINJ7
  707. #elif SOFTRX == K0
  708. #define SOFTRX_NAME "K0"
  709. #define UART_PIN PINK
  710. #define UART_RX_BIT PINK0
  711. #elif SOFTRX == K1
  712. #define SOFTRX_NAME "K1"
  713. #define UART_PIN PINK
  714. #define UART_RX_BIT PINK1
  715. #elif SOFTRX == K2
  716. #define SOFTRX_NAME "K2"
  717. #define UART_PIN PINK
  718. #define UART_RX_BIT PINK2
  719. #elif SOFTRX == K3
  720. #define SOFTRX_NAME "K3"
  721. #define UART_PIN PINK
  722. #define UART_RX_BIT PINK3
  723. #elif SOFTRX == K4
  724. #define SOFTRX_NAME "K4"
  725. #define UART_PIN PINK
  726. #define UART_RX_BIT PINK4
  727. #elif SOFTRX == K5
  728. #define SOFTRX_NAME "K5"
  729. #define UART_PIN PINK
  730. #define UART_RX_BIT PINK5
  731. #elif SOFTRX == K6
  732. #define SOFTRX_NAME "K6"
  733. #define UART_PIN PINK
  734. #define UART_RX_BIT PINK6
  735. #elif SOFTRX == K7
  736. #define SOFTRX_NAME "K7"
  737. #define UART_PIN PINK
  738. #define UART_RX_BIT PINK7
  739. #elif SOFTRX == L0
  740. #define SOFTRX_NAME "L0"
  741. #define UART_PIN PINL
  742. #define UART_RX_BIT PINL0
  743. #elif SOFTRX == L1
  744. #define SOFTRX_NAME "L1"
  745. #define UART_PIN PINL
  746. #define UART_RX_BIT PINL1
  747. #elif SOFTRX == L2
  748. #define SOFTRX_NAME "L2"
  749. #define UART_PIN PINL
  750. #define UART_RX_BIT PINL2
  751. #elif SOFTRX == L3
  752. #define SOFTRX_NAME "L3"
  753. #define UART_PIN PINL
  754. #define UART_RX_BIT PINL3
  755. #elif SOFTRX == L4
  756. #define SOFTRX_NAME "L4"
  757. #define UART_PIN PINL
  758. #define UART_RX_BIT PINL4
  759. #elif SOFTRX == L5
  760. #define SOFTRX_NAME "L5"
  761. #define UART_PIN PINL
  762. #define UART_RX_BIT PINL5
  763. #elif SOFTRX == L6
  764. #define SOFTRX_NAME "L6"
  765. #define UART_PIN PINL
  766. #define UART_RX_BIT PINL6
  767. #elif SOFTRX == L7
  768. #define SOFTRX_NAME "L7"
  769. #define UART_PIN PINL
  770. #define UART_RX_BIT PINL7
  771. #elif SOFTRX == A0
  772. #define SOFTRX_NAME "A0"
  773. #define UART_PIN PINA
  774. #define UART_RX_BIT PINA0
  775. #elif SOFTRX == A1
  776. #define SOFTRX_NAME "A1"
  777. #define UART_PIN PINA
  778. #define UART_RX_BIT PINA1
  779. #elif SOFTRX == A2
  780. #define SOFTRX_NAME "A2"
  781. #define UART_PIN PINA
  782. #define UART_RX_BIT PINA2
  783. #elif SOFTRX == A3
  784. #define SOFTRX_NAME "A3"
  785. #define UART_PIN PINA
  786. #define UART_RX_BIT PINA3
  787. #elif SOFTRX == A4
  788. #define SOFTRX_NAME "A4"
  789. #define UART_PIN PINA
  790. #define UART_RX_BIT PINA4
  791. #elif SOFTRX == A5
  792. #define SOFTRX_NAME "A5"
  793. #define UART_PIN PINA
  794. #define UART_RX_BIT PINA5
  795. #elif SOFTRX == A6
  796. #define SOFTRX_NAME "A6"
  797. #define UART_PIN PINA
  798. #define UART_RX_BIT PINA6
  799. #elif SOFTRX == A7
  800. #define SOFTRX_NAME "A7"
  801. #define UART_PIN PINA
  802. #define UART_RX_BIT PINA7
  803. #else
  804. #error -------------------------------------------
  805. #error Unrecognized SOFTRX name. Should be like "B5"
  806. #error -------------------------------------------
  807. #endif