pins_rs485.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266
  1. #ifdef __AVR_XMEGA__
  2. #define _mkPort(a) V##a
  3. #else
  4. #define _mkPort(a) a
  5. #endif
  6. #define PIN_INVERTED 0x8000
  7. #define A0_INV (PIN_INVERTED + A0)
  8. #define A1_INV (PIN_INVERTED + A1)
  9. #define A2_INV (PIN_INVERTED + A2)
  10. #define A3_INV (PIN_INVERTED + A3)
  11. #define A4_INV (PIN_INVERTED + A4)
  12. #define A5_INV (PIN_INVERTED + A5)
  13. #define A6_INV (PIN_INVERTED + A6)
  14. #define A7_INV (PIN_INVERTED + A7)
  15. #define B0_INV (PIN_INVERTED + B0)
  16. #define B1_INV (PIN_INVERTED + B1)
  17. #define B2_INV (PIN_INVERTED + B2)
  18. #define B3_INV (PIN_INVERTED + B3)
  19. #define B4_INV (PIN_INVERTED + B4)
  20. #define B5_INV (PIN_INVERTED + B5)
  21. #define B6_INV (PIN_INVERTED + B6)
  22. #define B7_INV (PIN_INVERTED + B7)
  23. #define C0_INV (PIN_INVERTED + C0)
  24. #define C1_INV (PIN_INVERTED + C1)
  25. #define C2_INV (PIN_INVERTED + C2)
  26. #define C3_INV (PIN_INVERTED + C3)
  27. #define C4_INV (PIN_INVERTED + C4)
  28. #define C5_INV (PIN_INVERTED + C5)
  29. #define C6_INV (PIN_INVERTED + C6)
  30. #define C7_INV (PIN_INVERTED + C7)
  31. #define D0_INV (PIN_INVERTED + D0)
  32. #define D1_INV (PIN_INVERTED + D1)
  33. #define D2_INV (PIN_INVERTED + D2)
  34. #define D3_INV (PIN_INVERTED + D3)
  35. #define D4_INV (PIN_INVERTED + D4)
  36. #define D5_INV (PIN_INVERTED + D5)
  37. #define D6_INV (PIN_INVERTED + D6)
  38. #define D7_INV (PIN_INVERTED + D7)
  39. #define E0_INV (PIN_INVERTED + E0)
  40. #define E1_INV (PIN_INVERTED + E1)
  41. #define E2_INV (PIN_INVERTED + E2)
  42. #define E3_INV (PIN_INVERTED + E3)
  43. #define E4_INV (PIN_INVERTED + E4)
  44. #define E5_INV (PIN_INVERTED + E5)
  45. #define E6_INV (PIN_INVERTED + E6)
  46. #define E7_INV (PIN_INVERTED + E7)
  47. #define F0_INV (PIN_INVERTED + F0)
  48. #define F1_INV (PIN_INVERTED + F1)
  49. #define F2_INV (PIN_INVERTED + F2)
  50. #define F3_INV (PIN_INVERTED + F3)
  51. #define F4_INV (PIN_INVERTED + F4)
  52. #define F5_INV (PIN_INVERTED + F5)
  53. #define F6_INV (PIN_INVERTED + F6)
  54. #define F7_INV (PIN_INVERTED + F7)
  55. #define G0_INV (PIN_INVERTED + G0)
  56. #define G1_INV (PIN_INVERTED + G1)
  57. #define G2_INV (PIN_INVERTED + G2)
  58. #define G3_INV (PIN_INVERTED + G3)
  59. #define G4_INV (PIN_INVERTED + G4)
  60. #define G5_INV (PIN_INVERTED + G5)
  61. #define G6_INV (PIN_INVERTED + G6)
  62. #define G7_INV (PIN_INVERTED + G7)
  63. #define H0_INV (PIN_INVERTED + H0)
  64. #define H1_INV (PIN_INVERTED + H1)
  65. #define H2_INV (PIN_INVERTED + H2)
  66. #define H3_INV (PIN_INVERTED + H3)
  67. #define H4_INV (PIN_INVERTED + H4)
  68. #define H5_INV (PIN_INVERTED + H5)
  69. #define H6_INV (PIN_INVERTED + H6)
  70. #define H7_INV (PIN_INVERTED + H7)
  71. #define J0_INV (PIN_INVERTED + J0)
  72. #define J1_INV (PIN_INVERTED + J1)
  73. #define J2_INV (PIN_INVERTED + J2)
  74. #define J3_INV (PIN_INVERTED + J3)
  75. #define J4_INV (PIN_INVERTED + J4)
  76. #define J5_INV (PIN_INVERTED + J5)
  77. #define J6_INV (PIN_INVERTED + J6)
  78. #define J7_INV (PIN_INVERTED + J7)
  79. #define K0_INV (PIN_INVERTED + K0)
  80. #define K1_INV (PIN_INVERTED + K1)
  81. #define K2_INV (PIN_INVERTED + K2)
  82. #define K3_INV (PIN_INVERTED + K3)
  83. #define K4_INV (PIN_INVERTED + K4)
  84. #define K5_INV (PIN_INVERTED + K5)
  85. #define K6_INV (PIN_INVERTED + K6)
  86. #define K7_INV (PIN_INVERTED + K7)
  87. #define L0_INV (PIN_INVERTED + L0)
  88. #define L1_INV (PIN_INVERTED + L1)
  89. #define L2_INV (PIN_INVERTED + L2)
  90. #define L3_INV (PIN_INVERTED + L3)
  91. #define L4_INV (PIN_INVERTED + L4)
  92. #define L5_INV (PIN_INVERTED + L5)
  93. #define L6_INV (PIN_INVERTED + L6)
  94. #define L7_INV (PIN_INVERTED + L7)
  95. #if RS485 == B0
  96. #define RS485_NAME "B0"
  97. #define RS485_DDR DDRB
  98. #define RS485_PORT _mkPort(PORTB)
  99. #define RS485_PIN PINB
  100. #define RS485_BIT PIN0
  101. #elif RS485 == B1
  102. #define RS485_NAME "B1"
  103. #define RS485_DDR DDRB
  104. #define RS485_PORT _mkPort(PORTB)
  105. #define RS485_PIN PINB
  106. #define RS485_BIT PIN1
  107. #elif RS485 == B2
  108. #define RS485_NAME "B2"
  109. #define RS485_DDR DDRB
  110. #define RS485_PORT _mkPort(PORTB)
  111. #define RS485_PIN PINB
  112. #define RS485_BIT PIN2
  113. #elif RS485 == B3
  114. #define RS485_NAME "B3"
  115. #define RS485_DDR DDRB
  116. #define RS485_PORT _mkPort(PORTB)
  117. #define RS485_PIN PINB
  118. #define RS485_BIT PIN3
  119. #elif RS485 == B4
  120. #define RS485_NAME "B4"
  121. #define RS485_DDR DDRB
  122. #define RS485_PORT _mkPort(PORTB)
  123. #define RS485_PIN PINB
  124. #define RS485_BIT PIN4
  125. #elif RS485 == B5
  126. #define RS485_NAME "B5"
  127. #define RS485_DDR DDRB
  128. #define RS485_PORT _mkPort(PORTB)
  129. #define RS485_PIN PINB
  130. #define RS485_BIT PIN5
  131. #elif RS485 == B6
  132. #define RS485_NAME "B6"
  133. #define RS485_DDR DDRB
  134. #define RS485_PORT _mkPort(PORTB)
  135. #define RS485_PIN PINB
  136. #define RS485_BIT PIN6
  137. #elif RS485 == B7
  138. #define RS485_NAME "B7"
  139. #define RS485_DDR DDRB
  140. #define RS485_PORT _mkPort(PORTB)
  141. #define RS485_PIN PINB
  142. #define RS485_BIT PIN7
  143. #elif RS485 == C0
  144. #define RS485_NAME "C0"
  145. #define RS485_DDR DDRC
  146. #define RS485_PORT _mkPort(PORTC)
  147. #define RS485_PIN PINC
  148. #define RS485_BIT PIN0
  149. #elif RS485 == C1
  150. #define RS485_NAME "C1"
  151. #define RS485_DDR DDRC
  152. #define RS485_PORT _mkPort(PORTC)
  153. #define RS485_PIN PINC
  154. #define RS485_BIT PIN1
  155. #elif RS485 == C2
  156. #define RS485_NAME "C2"
  157. #define RS485_DDR DDRC
  158. #define RS485_PORT _mkPort(PORTC)
  159. #define RS485_PIN PINC
  160. #define RS485_BIT PIN2
  161. #elif RS485 == C3
  162. #define RS485_NAME "C3"
  163. #define RS485_DDR DDRC
  164. #define RS485_PORT _mkPort(PORTC)
  165. #define RS485_PIN PINC
  166. #define RS485_BIT PIN3
  167. #elif RS485 == C4
  168. #define RS485_NAME "C4"
  169. #define RS485_DDR DDRC
  170. #define RS485_PORT _mkPort(PORTC)
  171. #define RS485_PIN PINC
  172. #define RS485_BIT PIN4
  173. #elif RS485 == C5
  174. #define RS485_NAME "C5"
  175. #define RS485_DDR DDRC
  176. #define RS485_PORT _mkPort(PORTC)
  177. #define RS485_PIN PINC
  178. #define RS485_BIT PIN5
  179. #elif RS485 == C6
  180. #define RS485_NAME "C6"
  181. #define RS485_DDR DDRC
  182. #define RS485_PORT _mkPort(PORTC)
  183. #define RS485_PIN PINC
  184. #define RS485_BIT PIN6
  185. #elif RS485 == C7
  186. #define RS485_NAME "C7"
  187. #define RS485_DDR DDRC
  188. #define RS485_PORT _mkPort(PORTC)
  189. #define RS485_PIN PINC
  190. #define RS485_BIT PIN7
  191. #elif RS485 == D0
  192. #define RS485_NAME "D0"
  193. #define RS485_DDR DDRD
  194. #define RS485_PORT _mkPort(PORTD)
  195. #define RS485_PIN PIND
  196. #define RS485_BIT PIN0
  197. #elif RS485 == D1
  198. #define RS485_NAME "D1"
  199. #define RS485_DDR DDRD
  200. #define RS485_PORT _mkPort(PORTD)
  201. #define RS485_PIN PIND
  202. #define RS485_BIT PIN1
  203. #elif RS485 == D2
  204. #define RS485_NAME "D2"
  205. #define RS485_DDR DDRD
  206. #define RS485_PORT _mkPort(PORTD)
  207. #define RS485_PIN PIND
  208. #define RS485_BIT PIN2
  209. #elif RS485 == D3
  210. #define RS485_NAME "D3"
  211. #define RS485_DDR DDRD
  212. #define RS485_PORT _mkPort(PORTD)
  213. #define RS485_PIN PIND
  214. #define RS485_BIT PIN3
  215. #elif RS485 == D4
  216. #define RS485_NAME "D4"
  217. #define RS485_DDR DDRD
  218. #define RS485_PORT _mkPort(PORTD)
  219. #define RS485_PIN PIND
  220. #define RS485_BIT PIN4
  221. #elif RS485 == D5
  222. #define RS485_NAME "D5"
  223. #define RS485_DDR DDRD
  224. #define RS485_PORT _mkPort(PORTD)
  225. #define RS485_PIN PIND
  226. #define RS485_BIT PIN5
  227. #elif RS485 == D6
  228. #define RS485_NAME "D6"
  229. #define RS485_DDR DDRD
  230. #define RS485_PORT _mkPort(PORTD)
  231. #define RS485_PIN PIND
  232. #define RS485_BIT PIN6
  233. #elif RS485 == D7
  234. #define RS485_NAME "D7"
  235. #define RS485_DDR DDRD
  236. #define RS485_PORT _mkPort(PORTD)
  237. #define RS485_PIN PIND
  238. #define RS485_BIT PIN7
  239. #elif RS485 == E0
  240. #define RS485_NAME "E0"
  241. #define RS485_DDR DDRE
  242. #define RS485_PORT _mkPort(PORTE)
  243. #define RS485_PIN PINE
  244. #define RS485_BIT PIN0
  245. #elif RS485 == E1
  246. #define RS485_NAME "E1"
  247. #define RS485_DDR DDRE
  248. #define RS485_PORT _mkPort(PORTE)
  249. #define RS485_PIN PINE
  250. #define RS485_BIT PIN1
  251. #elif RS485 == E2
  252. #define RS485_NAME "E2"
  253. #define RS485_DDR DDRE
  254. #define RS485_PORT _mkPort(PORTE)
  255. #define RS485_PIN PINE
  256. #define RS485_BIT PIN2
  257. #elif RS485 == E3
  258. #define RS485_NAME "E3"
  259. #define RS485_DDR DDRE
  260. #define RS485_PORT _mkPort(PORTE)
  261. #define RS485_PIN PINE
  262. #define RS485_BIT PIN3
  263. #elif RS485 == E4
  264. #define RS485_NAME "E4"
  265. #define RS485_DDR DDRE
  266. #define RS485_PORT _mkPort(PORTE)
  267. #define RS485_PIN PINE
  268. #define RS485_BIT PIN4
  269. #elif RS485 == E5
  270. #define RS485_NAME "E5"
  271. #define RS485_DDR DDRE
  272. #define RS485_PORT _mkPort(PORTE)
  273. #define RS485_PIN PINE
  274. #define RS485_BIT PIN5
  275. #elif RS485 == E6
  276. #define RS485_NAME "E6"
  277. #define RS485_DDR DDRE
  278. #define RS485_PORT _mkPort(PORTE)
  279. #define RS485_PIN PINE
  280. #define RS485_BIT PIN6
  281. #elif RS485 == E7
  282. #define RS485_NAME "E7"
  283. #define RS485_DDR DDRE
  284. #define RS485_PORT _mkPort(PORTE)
  285. #define RS485_PIN PINE
  286. #define RS485_BIT PIN7
  287. #elif RS485 == F0
  288. #define RS485_NAME "F0"
  289. #define RS485_DDR DDRF
  290. #define RS485_PORT _mkPort(PORTF)
  291. #define RS485_PIN PINF
  292. #define RS485_BIT PIN0
  293. #elif RS485 == F1
  294. #define RS485_NAME "F1"
  295. #define RS485_DDR DDRF
  296. #define RS485_PORT _mkPort(PORTF)
  297. #define RS485_PIN PINF
  298. #define RS485_BIT PIN1
  299. #elif RS485 == F2
  300. #define RS485_NAME "F2"
  301. #define RS485_DDR DDRF
  302. #define RS485_PORT _mkPort(PORTF)
  303. #define RS485_PIN PINF
  304. #define RS485_BIT PIN2
  305. #elif RS485 == F3
  306. #define RS485_NAME "F3"
  307. #define RS485_DDR DDRF
  308. #define RS485_PORT _mkPort(PORTF)
  309. #define RS485_PIN PINF
  310. #define RS485_BIT PIN3
  311. #elif RS485 == F4
  312. #define RS485_NAME "F4"
  313. #define RS485_DDR DDRF
  314. #define RS485_PORT _mkPort(PORTF)
  315. #define RS485_PIN PINF
  316. #define RS485_BIT PIN4
  317. #elif RS485 == F5
  318. #define RS485_NAME "F5"
  319. #define RS485_DDR DDRF
  320. #define RS485_PORT _mkPort(PORTF)
  321. #define RS485_PIN PINF
  322. #define RS485_BIT PIN5
  323. #elif RS485 == F6
  324. #define RS485_NAME "F6"
  325. #define RS485_DDR DDRF
  326. #define RS485_PORT _mkPort(PORTF)
  327. #define RS485_PIN PINF
  328. #define RS485_BIT PIN6
  329. #elif RS485 == F7
  330. #define RS485_NAME "F7"
  331. #define RS485_DDR DDRF
  332. #define RS485_PORT _mkPort(PORTF)
  333. #define RS485_PIN PINF
  334. #define RS485_BIT PIN7
  335. #elif RS485 == G0
  336. #define RS485_NAME "G0"
  337. #define RS485_DDR DDRG
  338. #define RS485_PORT _mkPort(PORTG)
  339. #define RS485_PIN PING
  340. #define RS485_BIT PIN0
  341. #elif RS485 == G1
  342. #define RS485_NAME "G1"
  343. #define RS485_DDR DDRG
  344. #define RS485_PORT _mkPort(PORTG)
  345. #define RS485_PIN PING
  346. #define RS485_BIT PIN1
  347. #elif RS485 == G2
  348. #define RS485_NAME "G2"
  349. #define RS485_DDR DDRG
  350. #define RS485_PORT _mkPort(PORTG)
  351. #define RS485_PIN PING
  352. #define RS485_BIT PIN2
  353. #elif RS485 == G3
  354. #define RS485_NAME "G3"
  355. #define RS485_DDR DDRG
  356. #define RS485_PORT _mkPort(PORTG)
  357. #define RS485_PIN PING
  358. #define RS485_BIT PIN3
  359. #elif RS485 == G4
  360. #define RS485_NAME "G4"
  361. #define RS485_DDR DDRG
  362. #define RS485_PORT _mkPort(PORTG)
  363. #define RS485_PIN PING
  364. #define RS485_BIT PIN4
  365. #elif RS485 == G5
  366. #define RS485_NAME "G5"
  367. #define RS485_DDR DDRG
  368. #define RS485_PORT _mkPort(PORTG)
  369. #define RS485_PIN PING
  370. #define RS485_BIT PIN5
  371. #elif RS485 == G6
  372. #define RS485_NAME "G6"
  373. #define RS485_DDR DDRG
  374. #define RS485_PORT _mkPort(PORTG)
  375. #define RS485_PIN PING
  376. #define RS485_BIT PIN6
  377. #elif RS485 == G7
  378. #define RS485_NAME "G7"
  379. #define RS485_DDR DDRG
  380. #define RS485_PORT _mkPort(PORTG)
  381. #define RS485_PIN PING
  382. #define RS485_BIT PIN7
  383. #elif RS485 == H0
  384. #define RS485_NAME "H0"
  385. #define RS485_DDR DDRH
  386. #define RS485_PORT _mkPort(PORTH)
  387. #define RS485_PIN PINH
  388. #define RS485_BIT PIN0
  389. #elif RS485 == H1
  390. #define RS485_NAME "H1"
  391. #define RS485_DDR DDRH
  392. #define RS485_PORT _mkPort(PORTH)
  393. #define RS485_PIN PINH
  394. #define RS485_BIT PIN1
  395. #elif RS485 == H2
  396. #define RS485_NAME "H2"
  397. #define RS485_DDR DDRH
  398. #define RS485_PORT _mkPort(PORTH)
  399. #define RS485_PIN PINH
  400. #define RS485_BIT PIN2
  401. #elif RS485 == H3
  402. #define RS485_NAME "H3"
  403. #define RS485_DDR DDRH
  404. #define RS485_PORT _mkPort(PORTH)
  405. #define RS485_PIN PINH
  406. #define RS485_BIT PIN3
  407. #elif RS485 == H4
  408. #define RS485_NAME "H4"
  409. #define RS485_DDR DDRH
  410. #define RS485_PORT _mkPort(PORTH)
  411. #define RS485_PIN PINH
  412. #define RS485_BIT PIN4
  413. #elif RS485 == H5
  414. #define RS485_NAME "H5"
  415. #define RS485_DDR DDRH
  416. #define RS485_PORT _mkPort(PORTH)
  417. #define RS485_PIN PINH
  418. #define RS485_BIT PIN5
  419. #elif RS485 == H6
  420. #define RS485_NAME "H6"
  421. #define RS485_DDR DDRH
  422. #define RS485_PORT _mkPort(PORTH)
  423. #define RS485_PIN PINH
  424. #define RS485_BIT PIN6
  425. #elif RS485 == H7
  426. #define RS485_NAME "H7"
  427. #define RS485_DDR DDRH
  428. #define RS485_PORT _mkPort(PORTH)
  429. #define RS485_PIN PINH
  430. #define RS485_BIT PIN7
  431. #elif RS485 == J0
  432. #define RS485_NAME "J0"
  433. #define RS485_DDR DDRJ
  434. #define RS485_PORT _mkPort(PORTJ)
  435. #define RS485_PIN PINJ
  436. #define RS485_BIT PIN0
  437. #elif RS485 == J1
  438. #define RS485_NAME "J1"
  439. #define RS485_DDR DDRJ
  440. #define RS485_PORT _mkPort(PORTJ)
  441. #define RS485_PIN PINJ
  442. #define RS485_BIT PIN1
  443. #elif RS485 == J2
  444. #define RS485_NAME "J2"
  445. #define RS485_DDR DDRJ
  446. #define RS485_PORT _mkPort(PORTJ)
  447. #define RS485_PIN PINJ
  448. #define RS485_BIT PIN2
  449. #elif RS485 == J3
  450. #define RS485_NAME "J3"
  451. #define RS485_DDR DDRJ
  452. #define RS485_PORT _mkPort(PORTJ)
  453. #define RS485_PIN PINJ
  454. #define RS485_BIT PIN3
  455. #elif RS485 == J4
  456. #define RS485_NAME "J4"
  457. #define RS485_DDR DDRJ
  458. #define RS485_PORT _mkPort(PORTJ)
  459. #define RS485_PIN PINJ
  460. #define RS485_BIT PIN4
  461. #elif RS485 == J5
  462. #define RS485_NAME "J5"
  463. #define RS485_DDR DDRJ
  464. #define RS485_PORT _mkPort(PORTJ)
  465. #define RS485_PIN PINJ
  466. #define RS485_BIT PIN5
  467. #elif RS485 == J6
  468. #define RS485_NAME "J6"
  469. #define RS485_DDR DDRJ
  470. #define RS485_PORT _mkPort(PORTJ)
  471. #define RS485_PIN PINJ
  472. #define RS485_BIT PIN6
  473. #elif RS485 == J7
  474. #define RS485_NAME "J7"
  475. #define RS485_DDR DDRJ
  476. #define RS485_PORT _mkPort(PORTJ)
  477. #define RS485_PIN PINJ
  478. #define RS485_BIT PIN7
  479. #elif RS485 == K0
  480. #define RS485_NAME "K0"
  481. #define RS485_DDR DDRK
  482. #define RS485_PORT _mkPort(PORTK)
  483. #define RS485_PIN PINK
  484. #define RS485_BIT PIN0
  485. #elif RS485 == K1
  486. #define RS485_NAME "K1"
  487. #define RS485_DDR DDRK
  488. #define RS485_PORT _mkPort(PORTK)
  489. #define RS485_PIN PINK
  490. #define RS485_BIT PIN1
  491. #elif RS485 == K2
  492. #define RS485_NAME "K2"
  493. #define RS485_DDR DDRK
  494. #define RS485_PORT _mkPort(PORTK)
  495. #define RS485_PIN PINK
  496. #define RS485_BIT PIN2
  497. #elif RS485 == K3
  498. #define RS485_NAME "K3"
  499. #define RS485_DDR DDRK
  500. #define RS485_PORT _mkPort(PORTK)
  501. #define RS485_PIN PINK
  502. #define RS485_BIT PIN3
  503. #elif RS485 == K4
  504. #define RS485_NAME "K4"
  505. #define RS485_DDR DDRK
  506. #define RS485_PORT _mkPort(PORTK)
  507. #define RS485_PIN PINK
  508. #define RS485_BIT PIN4
  509. #elif RS485 == K5
  510. #define RS485_NAME "K5"
  511. #define RS485_DDR DDRK
  512. #define RS485_PORT _mkPort(PORTK)
  513. #define RS485_PIN PINK
  514. #define RS485_BIT PIN5
  515. #elif RS485 == K6
  516. #define RS485_NAME "K6"
  517. #define RS485_DDR DDRK
  518. #define RS485_PORT _mkPort(PORTK)
  519. #define RS485_PIN PINK
  520. #define RS485_BIT PIN6
  521. #elif RS485 == K7
  522. #define RS485_NAME "K7"
  523. #define RS485_DDR DDRK
  524. #define RS485_PORT _mkPort(PORTK)
  525. #define RS485_PIN PINK
  526. #define RS485_BIT PIN7
  527. #elif RS485 == L0
  528. #define RS485_NAME "L0"
  529. #define RS485_DDR DDRL
  530. #define RS485_PORT _mkPort(PORTL)
  531. #define RS485_PIN PINL
  532. #define RS485_BIT PIN0
  533. #elif RS485 == L1
  534. #define RS485_NAME "L1"
  535. #define RS485_DDR DDRL
  536. #define RS485_PORT _mkPort(PORTL)
  537. #define RS485_PIN PINL
  538. #define RS485_BIT PIN1
  539. #elif RS485 == L2
  540. #define RS485_NAME "L2"
  541. #define RS485_DDR DDRL
  542. #define RS485_PORT _mkPort(PORTL)
  543. #define RS485_PIN PINL
  544. #define RS485_BIT PIN2
  545. #elif RS485 == L3
  546. #define RS485_NAME "L3"
  547. #define RS485_DDR DDRL
  548. #define RS485_PORT _mkPort(PORTL)
  549. #define RS485_PIN PINL
  550. #define RS485_BIT PIN3
  551. #elif RS485 == L4
  552. #define RS485_NAME "L4"
  553. #define RS485_DDR DDRL
  554. #define RS485_PORT _mkPort(PORTL)
  555. #define RS485_PIN PINL
  556. #define RS485_BIT PIN4
  557. #elif RS485 == L5
  558. #define RS485_NAME "L5"
  559. #define RS485_DDR DDRL
  560. #define RS485_PORT _mkPort(PORTL)
  561. #define RS485_PIN PINL
  562. #define RS485_BIT PIN5
  563. #elif RS485 == L6
  564. #define RS485_NAME "L6"
  565. #define RS485_DDR DDRL
  566. #define RS485_PORT _mkPort(PORTL)
  567. #define RS485_PIN PINL
  568. #define RS485_BIT PIN6
  569. #elif RS485 == L7
  570. #define RS485_NAME "L7"
  571. #define RS485_DDR DDRL
  572. #define RS485_PORT _mkPort(PORTL)
  573. #define RS485_PIN PINL
  574. #define RS485_BIT PIN7
  575. #elif RS485 == A0
  576. #define RS485_NAME "A0"
  577. #define RS485_DDR DDRA
  578. #define RS485_PORT _mkPort(PORTA)
  579. #define RS485_PIN PINA
  580. #define RS485_BIT PIN0
  581. #elif RS485 == A1
  582. #define RS485_NAME "A1"
  583. #define RS485_DDR DDRA
  584. #define RS485_PORT _mkPort(PORTA)
  585. #define RS485_PIN PINA
  586. #define RS485_BIT PIN1
  587. #elif RS485 == A2
  588. #define RS485_NAME "A2"
  589. #define RS485_DDR DDRA
  590. #define RS485_PORT _mkPort(PORTA)
  591. #define RS485_PIN PINA
  592. #define RS485_BIT PIN2
  593. #elif RS485 == A3
  594. #define RS485_NAME "A3"
  595. #define RS485_DDR DDRA
  596. #define RS485_PORT _mkPort(PORTA)
  597. #define RS485_PIN PINA
  598. #define RS485_BIT PIN3
  599. #elif RS485 == A4
  600. #define RS485_NAME "A4"
  601. #define RS485_DDR DDRA
  602. #define RS485_PORT _mkPort(PORTA)
  603. #define RS485_PIN PINA
  604. #define RS485_BIT PIN4
  605. #elif RS485 == A5
  606. #define RS485_NAME "A5"
  607. #define RS485_DDR DDRA
  608. #define RS485_PORT _mkPort(PORTA)
  609. #define RS485_PIN PINA
  610. #define RS485_BIT PIN5
  611. #elif RS485 == A6
  612. #define RS485_NAME "A6"
  613. #define RS485_DDR DDRA
  614. #define RS485_PORT _mkPort(PORTA)
  615. #define RS485_PIN PINA
  616. #define RS485_BIT PIN6
  617. #elif RS485 == A7
  618. #define RS485_NAME "A7"
  619. #define RS485_DDR DDRA
  620. #define RS485_PORT _mkPort(PORTA)
  621. #define RS485_PIN PINA
  622. #define RS485_BIT PIN7
  623. #elif RS485 == B0_INV
  624. #define RS485_NAME "B0_INV"
  625. #define RS485_INVERT
  626. #define RS485_DDR DDRB
  627. #define RS485_PORT _mkPort(PORTB)
  628. #define RS485_PIN PINB
  629. #define RS485_BIT PIN0
  630. #elif RS485 == B1_INV
  631. #define RS485_NAME "B1_INV"
  632. #define RS485_INVERT
  633. #define RS485_DDR DDRB
  634. #define RS485_PORT _mkPort(PORTB)
  635. #define RS485_PIN PINB
  636. #define RS485_BIT PIN1
  637. #elif RS485 == B2_INV
  638. #define RS485_NAME "B2_INV"
  639. #define RS485_INVERT
  640. #define RS485_DDR DDRB
  641. #define RS485_PORT _mkPort(PORTB)
  642. #define RS485_PIN PINB
  643. #define RS485_BIT PIN2
  644. #elif RS485 == B3_INV
  645. #define RS485_NAME "B3_INV"
  646. #define RS485_INVERT
  647. #define RS485_DDR DDRB
  648. #define RS485_PORT _mkPort(PORTB)
  649. #define RS485_PIN PINB
  650. #define RS485_BIT PIN3
  651. #elif RS485 == B4_INV
  652. #define RS485_NAME "B4_INV"
  653. #define RS485_INVERT
  654. #define RS485_DDR DDRB
  655. #define RS485_PORT _mkPort(PORTB)
  656. #define RS485_PIN PINB
  657. #define RS485_BIT PIN4
  658. #elif RS485 == B5_INV
  659. #define RS485_NAME "B5_INV"
  660. #define RS485_INVERT
  661. #define RS485_DDR DDRB
  662. #define RS485_PORT _mkPort(PORTB)
  663. #define RS485_PIN PINB
  664. #define RS485_BIT PIN5
  665. #elif RS485 == B6_INV
  666. #define RS485_NAME "B6_INV"
  667. #define RS485_INVERT
  668. #define RS485_DDR DDRB
  669. #define RS485_PORT _mkPort(PORTB)
  670. #define RS485_PIN PINB
  671. #define RS485_BIT PIN6
  672. #elif RS485 == B7_INV
  673. #define RS485_NAME "B7_INV"
  674. #define RS485_INVERT
  675. #define RS485_DDR DDRB
  676. #define RS485_PORT _mkPort(PORTB)
  677. #define RS485_PIN PINB
  678. #define RS485_BIT PIN7
  679. #elif RS485 == C0_INV
  680. #define RS485_NAME "C0_INV"
  681. #define RS485_INVERT
  682. #define RS485_DDR DDRC
  683. #define RS485_PORT _mkPort(PORTC)
  684. #define RS485_PIN PINC
  685. #define RS485_BIT PIN0
  686. #elif RS485 == C1_INV
  687. #define RS485_NAME "C1_INV"
  688. #define RS485_INVERT
  689. #define RS485_DDR DDRC
  690. #define RS485_PORT _mkPort(PORTC)
  691. #define RS485_PIN PINC
  692. #define RS485_BIT PIN1
  693. #elif RS485 == C2_INV
  694. #define RS485_NAME "C2_INV"
  695. #define RS485_INVERT
  696. #define RS485_DDR DDRC
  697. #define RS485_PORT _mkPort(PORTC)
  698. #define RS485_PIN PINC
  699. #define RS485_BIT PIN2
  700. #elif RS485 == C3_INV
  701. #define RS485_NAME "C3_INV"
  702. #define RS485_INVERT
  703. #define RS485_DDR DDRC
  704. #define RS485_PORT _mkPort(PORTC)
  705. #define RS485_PIN PINC
  706. #define RS485_BIT PIN3
  707. #elif RS485 == C4_INV
  708. #define RS485_NAME "C4_INV"
  709. #define RS485_INVERT
  710. #define RS485_DDR DDRC
  711. #define RS485_PORT _mkPort(PORTC)
  712. #define RS485_PIN PINC
  713. #define RS485_BIT PIN4
  714. #elif RS485 == C5_INV
  715. #define RS485_NAME "C5_INV"
  716. #define RS485_INVERT
  717. #define RS485_DDR DDRC
  718. #define RS485_PORT _mkPort(PORTC)
  719. #define RS485_PIN PINC
  720. #define RS485_BIT PIN5
  721. #elif RS485 == C6_INV
  722. #define RS485_NAME "C6_INV"
  723. #define RS485_INVERT
  724. #define RS485_DDR DDRC
  725. #define RS485_PORT _mkPort(PORTC)
  726. #define RS485_PIN PINC
  727. #define RS485_BIT PIN6
  728. #elif RS485 == C7_INV
  729. #define RS485_NAME "C7_INV"
  730. #define RS485_INVERT
  731. #define RS485_DDR DDRC
  732. #define RS485_PORT _mkPort(PORTC)
  733. #define RS485_PIN PINC
  734. #define RS485_BIT PIN7
  735. #elif RS485 == D0_INV
  736. #define RS485_NAME "D0_INV"
  737. #define RS485_INVERT
  738. #define RS485_DDR DDRD
  739. #define RS485_PORT _mkPort(PORTD)
  740. #define RS485_PIN PIND
  741. #define RS485_BIT PIN0
  742. #elif RS485 == D1_INV
  743. #define RS485_NAME "D1_INV"
  744. #define RS485_INVERT
  745. #define RS485_DDR DDRD
  746. #define RS485_PORT _mkPort(PORTD)
  747. #define RS485_PIN PIND
  748. #define RS485_BIT PIN1
  749. #elif RS485 == D2_INV
  750. #define RS485_NAME "D2_INV"
  751. #define RS485_INVERT
  752. #define RS485_DDR DDRD
  753. #define RS485_PORT _mkPort(PORTD)
  754. #define RS485_PIN PIND
  755. #define RS485_BIT PIN2
  756. #elif RS485 == D3_INV
  757. #define RS485_NAME "D3_INV"
  758. #define RS485_INVERT
  759. #define RS485_DDR DDRD
  760. #define RS485_PORT _mkPort(PORTD)
  761. #define RS485_PIN PIND
  762. #define RS485_BIT PIN3
  763. #elif RS485 == D4_INV
  764. #define RS485_NAME "D4_INV"
  765. #define RS485_INVERT
  766. #define RS485_DDR DDRD
  767. #define RS485_PORT _mkPort(PORTD)
  768. #define RS485_PIN PIND
  769. #define RS485_BIT PIN4
  770. #elif RS485 == D5_INV
  771. #define RS485_NAME "D5_INV"
  772. #define RS485_INVERT
  773. #define RS485_DDR DDRD
  774. #define RS485_PORT _mkPort(PORTD)
  775. #define RS485_PIN PIND
  776. #define RS485_BIT PIN5
  777. #elif RS485 == D6_INV
  778. #define RS485_NAME "D6_INV"
  779. #define RS485_INVERT
  780. #define RS485_DDR DDRD
  781. #define RS485_PORT _mkPort(PORTD)
  782. #define RS485_PIN PIND
  783. #define RS485_BIT PIN6
  784. #elif RS485 == D7_INV
  785. #define RS485_NAME "D7_INV"
  786. #define RS485_INVERT
  787. #define RS485_DDR DDRD
  788. #define RS485_PORT _mkPort(PORTD)
  789. #define RS485_PIN PIND
  790. #define RS485_BIT PIN7
  791. #elif RS485 == E0_INV
  792. #define RS485_NAME "E0_INV"
  793. #define RS485_INVERT
  794. #define RS485_DDR DDRE
  795. #define RS485_PORT _mkPort(PORTE)
  796. #define RS485_PIN PINE
  797. #define RS485_BIT PIN0
  798. #elif RS485 == E1_INV
  799. #define RS485_NAME "E1_INV"
  800. #define RS485_INVERT
  801. #define RS485_DDR DDRE
  802. #define RS485_PORT _mkPort(PORTE)
  803. #define RS485_PIN PINE
  804. #define RS485_BIT PIN1
  805. #elif RS485 == E2_INV
  806. #define RS485_NAME "E2_INV"
  807. #define RS485_INVERT
  808. #define RS485_DDR DDRE
  809. #define RS485_PORT _mkPort(PORTE)
  810. #define RS485_PIN PINE
  811. #define RS485_BIT PIN2
  812. #elif RS485 == E3_INV
  813. #define RS485_NAME "E3_INV"
  814. #define RS485_INVERT
  815. #define RS485_DDR DDRE
  816. #define RS485_PORT _mkPort(PORTE)
  817. #define RS485_PIN PINE
  818. #define RS485_BIT PIN3
  819. #elif RS485 == E4_INV
  820. #define RS485_NAME "E4_INV"
  821. #define RS485_INVERT
  822. #define RS485_DDR DDRE
  823. #define RS485_PORT _mkPort(PORTE)
  824. #define RS485_PIN PINE
  825. #define RS485_BIT PIN4
  826. #elif RS485 == E5_INV
  827. #define RS485_NAME "E5_INV"
  828. #define RS485_INVERT
  829. #define RS485_DDR DDRE
  830. #define RS485_PORT _mkPort(PORTE)
  831. #define RS485_PIN PINE
  832. #define RS485_BIT PIN5
  833. #elif RS485 == E6_INV
  834. #define RS485_NAME "E6_INV"
  835. #define RS485_INVERT
  836. #define RS485_DDR DDRE
  837. #define RS485_PORT _mkPort(PORTE)
  838. #define RS485_PIN PINE
  839. #define RS485_BIT PIN6
  840. #elif RS485 == E7_INV
  841. #define RS485_NAME "E7_INV"
  842. #define RS485_INVERT
  843. #define RS485_DDR DDRE
  844. #define RS485_PORT _mkPort(PORTE)
  845. #define RS485_PIN PINE
  846. #define RS485_BIT PIN7
  847. #elif RS485 == F0_INV
  848. #define RS485_NAME "F0_INV"
  849. #define RS485_INVERT
  850. #define RS485_DDR DDRF
  851. #define RS485_PORT _mkPort(PORTF)
  852. #define RS485_PIN PINF
  853. #define RS485_BIT PIN0
  854. #elif RS485 == F1_INV
  855. #define RS485_NAME "F1_INV"
  856. #define RS485_INVERT
  857. #define RS485_DDR DDRF
  858. #define RS485_PORT _mkPort(PORTF)
  859. #define RS485_PIN PINF
  860. #define RS485_BIT PIN1
  861. #elif RS485 == F2_INV
  862. #define RS485_NAME "F2_INV"
  863. #define RS485_INVERT
  864. #define RS485_DDR DDRF
  865. #define RS485_PORT _mkPort(PORTF)
  866. #define RS485_PIN PINF
  867. #define RS485_BIT PIN2
  868. #elif RS485 == F3_INV
  869. #define RS485_NAME "F3_INV"
  870. #define RS485_INVERT
  871. #define RS485_DDR DDRF
  872. #define RS485_PORT _mkPort(PORTF)
  873. #define RS485_PIN PINF
  874. #define RS485_BIT PIN3
  875. #elif RS485 == F4_INV
  876. #define RS485_NAME "F4_INV"
  877. #define RS485_INVERT
  878. #define RS485_DDR DDRF
  879. #define RS485_PORT _mkPort(PORTF)
  880. #define RS485_PIN PINF
  881. #define RS485_BIT PIN4
  882. #elif RS485 == F5_INV
  883. #define RS485_NAME "F5_INV"
  884. #define RS485_INVERT
  885. #define RS485_DDR DDRF
  886. #define RS485_PORT _mkPort(PORTF)
  887. #define RS485_PIN PINF
  888. #define RS485_BIT PIN5
  889. #elif RS485 == F6_INV
  890. #define RS485_NAME "F6_INV"
  891. #define RS485_INVERT
  892. #define RS485_DDR DDRF
  893. #define RS485_PORT _mkPort(PORTF)
  894. #define RS485_PIN PINF
  895. #define RS485_BIT PIN6
  896. #elif RS485 == F7_INV
  897. #define RS485_NAME "F7_INV"
  898. #define RS485_INVERT
  899. #define RS485_DDR DDRF
  900. #define RS485_PORT _mkPort(PORTF)
  901. #define RS485_PIN PINF
  902. #define RS485_BIT PIN7
  903. #elif RS485 == G0_INV
  904. #define RS485_NAME "G0_INV"
  905. #define RS485_INVERT
  906. #define RS485_DDR DDRG
  907. #define RS485_PORT _mkPort(PORTG)
  908. #define RS485_PIN PING
  909. #define RS485_BIT PIN0
  910. #elif RS485 == G1_INV
  911. #define RS485_NAME "G1_INV"
  912. #define RS485_INVERT
  913. #define RS485_DDR DDRG
  914. #define RS485_PORT _mkPort(PORTG)
  915. #define RS485_PIN PING
  916. #define RS485_BIT PIN1
  917. #elif RS485 == G2_INV
  918. #define RS485_NAME "G2_INV"
  919. #define RS485_INVERT
  920. #define RS485_DDR DDRG
  921. #define RS485_PORT _mkPort(PORTG)
  922. #define RS485_PIN PING
  923. #define RS485_BIT PIN2
  924. #elif RS485 == G3_INV
  925. #define RS485_NAME "G3_INV"
  926. #define RS485_INVERT
  927. #define RS485_DDR DDRG
  928. #define RS485_PORT _mkPort(PORTG)
  929. #define RS485_PIN PING
  930. #define RS485_BIT PIN3
  931. #elif RS485 == G4_INV
  932. #define RS485_NAME "G4_INV"
  933. #define RS485_INVERT
  934. #define RS485_DDR DDRG
  935. #define RS485_PORT _mkPort(PORTG)
  936. #define RS485_PIN PING
  937. #define RS485_BIT PIN4
  938. #elif RS485 == G5_INV
  939. #define RS485_NAME "G5_INV"
  940. #define RS485_INVERT
  941. #define RS485_DDR DDRG
  942. #define RS485_PORT _mkPort(PORTG)
  943. #define RS485_PIN PING
  944. #define RS485_BIT PIN5
  945. #elif RS485 == G6_INV
  946. #define RS485_NAME "G6_INV"
  947. #define RS485_INVERT
  948. #define RS485_DDR DDRG
  949. #define RS485_PORT _mkPort(PORTG)
  950. #define RS485_PIN PING
  951. #define RS485_BIT PIN6
  952. #elif RS485 == G7_INV
  953. #define RS485_NAME "G7_INV"
  954. #define RS485_INVERT
  955. #define RS485_DDR DDRG
  956. #define RS485_PORT _mkPort(PORTG)
  957. #define RS485_PIN PING
  958. #define RS485_BIT PIN7
  959. #elif RS485 == H0_INV
  960. #define RS485_NAME "H0_INV"
  961. #define RS485_INVERT
  962. #define RS485_DDR DDRH
  963. #define RS485_PORT _mkPort(PORTH)
  964. #define RS485_PIN PINH
  965. #define RS485_BIT PIN0
  966. #elif RS485 == H1_INV
  967. #define RS485_NAME "H1_INV"
  968. #define RS485_INVERT
  969. #define RS485_DDR DDRH
  970. #define RS485_PORT _mkPort(PORTH)
  971. #define RS485_PIN PINH
  972. #define RS485_BIT PIN1
  973. #elif RS485 == H2_INV
  974. #define RS485_NAME "H2_INV"
  975. #define RS485_INVERT
  976. #define RS485_DDR DDRH
  977. #define RS485_PORT _mkPort(PORTH)
  978. #define RS485_PIN PINH
  979. #define RS485_BIT PIN2
  980. #elif RS485 == H3_INV
  981. #define RS485_NAME "H3_INV"
  982. #define RS485_INVERT
  983. #define RS485_DDR DDRH
  984. #define RS485_PORT _mkPort(PORTH)
  985. #define RS485_PIN PINH
  986. #define RS485_BIT PIN3
  987. #elif RS485 == H4_INV
  988. #define RS485_NAME "H4_INV"
  989. #define RS485_INVERT
  990. #define RS485_DDR DDRH
  991. #define RS485_PORT _mkPort(PORTH)
  992. #define RS485_PIN PINH
  993. #define RS485_BIT PIN4
  994. #elif RS485 == H5_INV
  995. #define RS485_NAME "H5_INV"
  996. #define RS485_INVERT
  997. #define RS485_DDR DDRH
  998. #define RS485_PORT _mkPort(PORTH)
  999. #define RS485_PIN PINH
  1000. #define RS485_BIT PIN5
  1001. #elif RS485 == H6_INV
  1002. #define RS485_NAME "H6_INV"
  1003. #define RS485_INVERT
  1004. #define RS485_DDR DDRH
  1005. #define RS485_PORT _mkPort(PORTH)
  1006. #define RS485_PIN PINH
  1007. #define RS485_BIT PIN6
  1008. #elif RS485 == H7_INV
  1009. #define RS485_NAME "H7_INV"
  1010. #define RS485_INVERT
  1011. #define RS485_DDR DDRH
  1012. #define RS485_PORT _mkPort(PORTH)
  1013. #define RS485_PIN PINH
  1014. #define RS485_BIT PIN7
  1015. #elif RS485 == J0_INV
  1016. #define RS485_NAME "J0_INV"
  1017. #define RS485_INVERT
  1018. #define RS485_DDR DDRJ
  1019. #define RS485_PORT _mkPort(PORTJ)
  1020. #define RS485_PIN PINJ
  1021. #define RS485_BIT PIN0
  1022. #elif RS485 == J1_INV
  1023. #define RS485_NAME "J1_INV"
  1024. #define RS485_INVERT
  1025. #define RS485_DDR DDRJ
  1026. #define RS485_PORT _mkPort(PORTJ)
  1027. #define RS485_PIN PINJ
  1028. #define RS485_BIT PIN1
  1029. #elif RS485 == J2_INV
  1030. #define RS485_NAME "J2_INV"
  1031. #define RS485_INVERT
  1032. #define RS485_DDR DDRJ
  1033. #define RS485_PORT _mkPort(PORTJ)
  1034. #define RS485_PIN PINJ
  1035. #define RS485_BIT PIN2
  1036. #elif RS485 == J3_INV
  1037. #define RS485_NAME "J3_INV"
  1038. #define RS485_INVERT
  1039. #define RS485_DDR DDRJ
  1040. #define RS485_PORT _mkPort(PORTJ)
  1041. #define RS485_PIN PINJ
  1042. #define RS485_BIT PIN3
  1043. #elif RS485 == J4_INV
  1044. #define RS485_NAME "J4_INV"
  1045. #define RS485_INVERT
  1046. #define RS485_DDR DDRJ
  1047. #define RS485_PORT _mkPort(PORTJ)
  1048. #define RS485_PIN PINJ
  1049. #define RS485_BIT PIN4
  1050. #elif RS485 == J5_INV
  1051. #define RS485_NAME "J5_INV"
  1052. #define RS485_INVERT
  1053. #define RS485_DDR DDRJ
  1054. #define RS485_PORT _mkPort(PORTJ)
  1055. #define RS485_PIN PINJ
  1056. #define RS485_BIT PIN5
  1057. #elif RS485 == J6_INV
  1058. #define RS485_NAME "J6_INV"
  1059. #define RS485_INVERT
  1060. #define RS485_DDR DDRJ
  1061. #define RS485_PORT _mkPort(PORTJ)
  1062. #define RS485_PIN PINJ
  1063. #define RS485_BIT PIN6
  1064. #elif RS485 == J7_INV
  1065. #define RS485_NAME "J7_INV"
  1066. #define RS485_INVERT
  1067. #define RS485_DDR DDRJ
  1068. #define RS485_PORT _mkPort(PORTJ)
  1069. #define RS485_PIN PINJ
  1070. #define RS485_BIT PIN7
  1071. #elif RS485 == K0_INV
  1072. #define RS485_NAME "K0_INV"
  1073. #define RS485_INVERT
  1074. #define RS485_DDR DDRK
  1075. #define RS485_PORT _mkPort(PORTK)
  1076. #define RS485_PIN PINK
  1077. #define RS485_BIT PIN0
  1078. #elif RS485 == K1_INV
  1079. #define RS485_NAME "K1_INV"
  1080. #define RS485_INVERT
  1081. #define RS485_DDR DDRK
  1082. #define RS485_PORT _mkPort(PORTK)
  1083. #define RS485_PIN PINK
  1084. #define RS485_BIT PIN1
  1085. #elif RS485 == K2_INV
  1086. #define RS485_NAME "K2_INV"
  1087. #define RS485_INVERT
  1088. #define RS485_DDR DDRK
  1089. #define RS485_PORT _mkPort(PORTK)
  1090. #define RS485_PIN PINK
  1091. #define RS485_BIT PIN2
  1092. #elif RS485 == K3_INV
  1093. #define RS485_NAME "K3_INV"
  1094. #define RS485_INVERT
  1095. #define RS485_DDR DDRK
  1096. #define RS485_PORT _mkPort(PORTK)
  1097. #define RS485_PIN PINK
  1098. #define RS485_BIT PIN3
  1099. #elif RS485 == K4_INV
  1100. #define RS485_NAME "K4_INV"
  1101. #define RS485_INVERT
  1102. #define RS485_DDR DDRK
  1103. #define RS485_PORT _mkPort(PORTK)
  1104. #define RS485_PIN PINK
  1105. #define RS485_BIT PIN4
  1106. #elif RS485 == K5_INV
  1107. #define RS485_NAME "K5_INV"
  1108. #define RS485_INVERT
  1109. #define RS485_DDR DDRK
  1110. #define RS485_PORT _mkPort(PORTK)
  1111. #define RS485_PIN PINK
  1112. #define RS485_BIT PIN5
  1113. #elif RS485 == K6_INV
  1114. #define RS485_NAME "K6_INV"
  1115. #define RS485_INVERT
  1116. #define RS485_DDR DDRK
  1117. #define RS485_PORT _mkPort(PORTK)
  1118. #define RS485_PIN PINK
  1119. #define RS485_BIT PIN6
  1120. #elif RS485 == K7_INV
  1121. #define RS485_NAME "K7_INV"
  1122. #define RS485_INVERT
  1123. #define RS485_DDR DDRK
  1124. #define RS485_PORT _mkPort(PORTK)
  1125. #define RS485_PIN PINK
  1126. #define RS485_BIT PIN7
  1127. #elif RS485 == L0_INV
  1128. #define RS485_NAME "L0_INV"
  1129. #define RS485_INVERT
  1130. #define RS485_DDR DDRL
  1131. #define RS485_PORT _mkPort(PORTL)
  1132. #define RS485_PIN PINL
  1133. #define RS485_BIT PIN0
  1134. #elif RS485 == L1_INV
  1135. #define RS485_NAME "L1_INV"
  1136. #define RS485_INVERT
  1137. #define RS485_DDR DDRL
  1138. #define RS485_PORT _mkPort(PORTL)
  1139. #define RS485_PIN PINL
  1140. #define RS485_BIT PIN1
  1141. #elif RS485 == L2_INV
  1142. #define RS485_NAME "L2_INV"
  1143. #define RS485_INVERT
  1144. #define RS485_DDR DDRL
  1145. #define RS485_PORT _mkPort(PORTL)
  1146. #define RS485_PIN PINL
  1147. #define RS485_BIT PIN2
  1148. #elif RS485 == L3_INV
  1149. #define RS485_NAME "L3_INV"
  1150. #define RS485_INVERT
  1151. #define RS485_DDR DDRL
  1152. #define RS485_PORT _mkPort(PORTL)
  1153. #define RS485_PIN PINL
  1154. #define RS485_BIT PIN3
  1155. #elif RS485 == L4_INV
  1156. #define RS485_NAME "L4_INV"
  1157. #define RS485_INVERT
  1158. #define RS485_DDR DDRL
  1159. #define RS485_PORT _mkPort(PORTL)
  1160. #define RS485_PIN PINL
  1161. #define RS485_BIT PIN4
  1162. #elif RS485 == L5_INV
  1163. #define RS485_NAME "L5_INV"
  1164. #define RS485_INVERT
  1165. #define RS485_DDR DDRL
  1166. #define RS485_PORT _mkPort(PORTL)
  1167. #define RS485_PIN PINL
  1168. #define RS485_BIT PIN5
  1169. #elif RS485 == L6_INV
  1170. #define RS485_NAME "L6_INV"
  1171. #define RS485_INVERT
  1172. #define RS485_DDR DDRL
  1173. #define RS485_PORT _mkPort(PORTL)
  1174. #define RS485_PIN PINL
  1175. #define RS485_BIT PIN6
  1176. #elif RS485 == L7_INV
  1177. #define RS485_NAME "L7_INV"
  1178. #define RS485_INVERT
  1179. #define RS485_DDR DDRL
  1180. #define RS485_PORT _mkPort(PORTL)
  1181. #define RS485_PIN PINL
  1182. #define RS485_BIT PIN7
  1183. #elif RS485 == A0_INV
  1184. #define RS485_NAME "A0_INV"
  1185. #define RS485_INVERT
  1186. #define RS485_DDR DDRA
  1187. #define RS485_PORT _mkPort(PORTA)
  1188. #define RS485_PIN PINA
  1189. #define RS485_BIT PIN0
  1190. #elif RS485 == A1_INV
  1191. #define RS485_NAME "A1_INV"
  1192. #define RS485_INVERT
  1193. #define RS485_DDR DDRA
  1194. #define RS485_PORT _mkPort(PORTA)
  1195. #define RS485_PIN PINA
  1196. #define RS485_BIT PIN1
  1197. #elif RS485 == A2_INV
  1198. #define RS485_NAME "A2_INV"
  1199. #define RS485_INVERT
  1200. #define RS485_DDR DDRA
  1201. #define RS485_PORT _mkPort(PORTA)
  1202. #define RS485_PIN PINA
  1203. #define RS485_BIT PIN2
  1204. #elif RS485 == A3_INV
  1205. #define RS485_NAME "A3_INV"
  1206. #define RS485_INVERT
  1207. #define RS485_DDR DDRA
  1208. #define RS485_PORT _mkPort(PORTA)
  1209. #define RS485_PIN PINA
  1210. #define RS485_BIT PIN3
  1211. #elif RS485 == A4_INV
  1212. #define RS485_NAME "A4_INV"
  1213. #define RS485_INVERT
  1214. #define RS485_DDR DDRA
  1215. #define RS485_PORT _mkPort(PORTA)
  1216. #define RS485_PIN PINA
  1217. #define RS485_BIT PIN4
  1218. #elif RS485 == A5_INV
  1219. #define RS485_NAME "A5_INV"
  1220. #define RS485_INVERT
  1221. #define RS485_DDR DDRA
  1222. #define RS485_PORT _mkPort(PORTA)
  1223. #define RS485_PIN PINA
  1224. #define RS485_BIT PIN5
  1225. #elif RS485 == A6_INV
  1226. #define RS485_NAME "A6_INV"
  1227. #define RS485_INVERT
  1228. #define RS485_DDR DDRA
  1229. #define RS485_PORT _mkPort(PORTA)
  1230. #define RS485_PIN PINA
  1231. #define RS485_BIT PIN6
  1232. #elif RS485 == A7_INV
  1233. #define RS485_NAME "A7_INV"
  1234. #define RS485_INVERT
  1235. #define RS485_DDR DDRA
  1236. #define RS485_PORT _mkPort(PORTA)
  1237. #define RS485_PIN PINA
  1238. #define RS485_BIT PIN7
  1239. #else
  1240. #error -------------------------------------------
  1241. #error Unrecognized RS485 name. Should be like "B5"
  1242. #error or "B5_INV" for active high
  1243. #error -------------------------------------------
  1244. #endif