coldfire_dev.nut 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. nutarch_m68k_coldfire_devices =
  2. {
  3. --
  4. -- I2C Bus Default
  5. --
  6. {
  7. name = "nutarch_m68k_coldfire_devices_i2c",
  8. brief = "I2C Bus Default",
  9. description = "Choose which I2C bus will be used as a default.\n"..
  10. "TwiXxx() Macros will be reconfigured to use this bus.\n"..
  11. "This is for compatibility with old Nut/OS.",
  12. requires = { "DEV_TWI" },
  13. options =
  14. {
  15. {
  16. macro = "I2C0_AS_DEFAULT",
  17. brief = "I2C Bus 0 Controller",
  18. description = "TwiXxx() Macros will be reconfigured to use I2C Bus 0 Controller.",
  19. exclusivity = { "I2C0_AS_DEFAULT", "I2C1_AS_DEFAULT" },
  20. flavor = "booldata",
  21. file = "include/cfg/twi.h"
  22. },
  23. {
  24. macro = "I2C1_AS_DEFAULT",
  25. brief = "I2C Bus 1 Controller",
  26. description = "TwiXxx() Macros will be reconfigured to use I2C Bus 1 Controller.",
  27. exclusivity = { "I2C0_AS_DEFAULT", "I2C1_AS_DEFAULT" },
  28. flavor = "booldata",
  29. file = "include/cfg/twi.h"
  30. },
  31. },
  32. },
  33. --
  34. -- I2C Bus 0 Configuration
  35. --
  36. {
  37. name = "nutarch_m68k_coldfire_devices_i2c0",
  38. brief = "I2C Bus 0 Controller",
  39. description = "Coldfire hardware I2C support.",
  40. requires = { "HW_I2C_COLDFIRE", "HW_I2C0" },
  41. provides = { "DEV_TWI" },
  42. sources = { "m68k/coldfire/dev/common/mcf5_i2c.c",
  43. "m68k/coldfire/dev/common/mcf5_i2c0.c" },
  44. options =
  45. {
  46. {
  47. macro = "I2C0_SCL_PORTPIN",
  48. brief = "I2C0 SCL Pin selection",
  49. type = "enumerated",
  50. description =
  51. function()
  52. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_i2c0_scl_pins_descr; end;
  53. end,
  54. choices =
  55. function()
  56. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_i2c0_scl_pins; end;
  57. end,
  58. file = "include/cfg/twi.h"
  59. },
  60. {
  61. macro = "I2C0_SDA_PORTPIN",
  62. brief = "I2C0 SDA Pin selection",
  63. type = "enumerated",
  64. description =
  65. function()
  66. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_i2c0_sda_pins_descr; end;
  67. end,
  68. choices =
  69. function()
  70. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_i2c0_sda_pins; end;
  71. end,
  72. file = "include/cfg/twi.h"
  73. },
  74. {
  75. macro = "I2C0_DEFAULT_SPEED",
  76. brief = "Default Speed",
  77. description = "Default speed for this bus. Different speeds can be set by software.\n",
  78. default = "100",
  79. file = "include/cfg/twi.h"
  80. },
  81. },
  82. },
  83. --
  84. -- I2C Bus 1 Configuration
  85. --
  86. {
  87. name = "nutarch_m68k_coldfire_devices_i2c1",
  88. brief = "I2C Bus 1 Controller",
  89. description = "Coldfire hardware I2C support.",
  90. requires = { "HW_I2C_COLDFIRE", "HW_I2C1" },
  91. provides = { "DEV_TWI" },
  92. sources = { "m68k/coldfire/dev/common/mcf5_i2c.c",
  93. "m68k/coldfire/dev/common/mcf5_i2c1.c" },
  94. options =
  95. {
  96. {
  97. macro = "I2C1_SCL_PORTPIN",
  98. brief = "I2C1 SCL Pin selection",
  99. type = "enumerated",
  100. description =
  101. function()
  102. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_i2c1_scl_pins_descr; end;
  103. end,
  104. choices =
  105. function()
  106. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_i2c1_scl_pins; end;
  107. end,
  108. file = "include/cfg/twi.h"
  109. },
  110. {
  111. macro = "I2C1_SDA_PORTPIN",
  112. brief = "I2C1 SDA Pin selection",
  113. type = "enumerated",
  114. description =
  115. function()
  116. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_i2c1_sda_pins_descr; end;
  117. end,
  118. choices =
  119. function()
  120. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_i2c1_sda_pins; end;
  121. end,
  122. file = "include/cfg/twi.h"
  123. },
  124. {
  125. macro = "I2C1_DEFAULT_SPEED",
  126. brief = "Default Speed",
  127. description = "Default speed for this bus. Different speeds can be set by software.\n",
  128. default = "100",
  129. file = "include/cfg/twi.h"
  130. },
  131. },
  132. },
  133. --
  134. -- SCI Debug Output
  135. --
  136. {
  137. name = "nutarch_m68k_coldfire_devices_sci_debug",
  138. brief = "SCI Debug Output",
  139. description = "In current implementation the SCI (Serial Communication Interface) is used as an UART device only.\n\n"..
  140. "This simple SCI output driver uses polling instead of interrupts "..
  141. "and can be used within interrupt routines.\n"..
  142. "It is mainly used for debugging and tracing.\n\n"..
  143. "This driver uses only RXD and TXD pins which are configured in SCIn Drivers below.\n\n"..
  144. "Call one of following functions:\n"..
  145. "\tNutRegisterDevice(&devDebug1, 0, 0) for SCI1\n"..
  146. "\tNutRegisterDevice(&devDebug2, 0, 0) for SCI2\n"..
  147. "\t...\n"..
  148. "\tNutRegisterDevice(&devDebugn, 0, 0) for SCIn\n\n"..
  149. "Then you can use any of the stdio functions to open device sci0, sci1, ..., scin.\n"..
  150. "",
  151. requires = { "HW_SCI_COLDFIRE" },
  152. provides = { "DEV_UART", "DEV_FILE", "DEV_WRITE" },
  153. sources = { "m68k/coldfire/dev/common/mcf5_sci_debug.c"},
  154. },
  155. --
  156. -- SCI1 Interface
  157. --
  158. {
  159. name = "nutarch_m68k_coldfire_devices_sci1",
  160. brief = "SCI1 Driver",
  161. description = "In current implementation the SCI (Serial Communication Interface) is used as an UART device only.\n\n"..
  162. "Hardware specific UART driver. Implements hardware "..
  163. "functions for the generic USART driver framework.",
  164. requires = { "HW_SCI_COLDFIRE", "HW_SCI1" },
  165. provides = { "DEV_UART", "DEV_UART_SPECIFIC" },
  166. -- sources = { "m68k/coldfire/dev/common/mcf5_sci1.c" },
  167. options =
  168. {
  169. {
  170. macro = "SCI1_TXD_PORTPIN",
  171. brief = "SCI1 TXD Pin selection",
  172. type = "enumerated",
  173. description =
  174. function()
  175. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci1_txd_pins_descr; end;
  176. end,
  177. choices =
  178. function()
  179. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci1_txd_pins end;
  180. end,
  181. file = "include/cfg/sci.h"
  182. },
  183. {
  184. macro = "SCI1_RXD_PORTPIN",
  185. brief = "SCI1 RXD Pin selection",
  186. type = "enumerated",
  187. description =
  188. function()
  189. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci1_rxd_pins_descr; end;
  190. end,
  191. choices =
  192. function()
  193. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci1_rxd_pins end;
  194. end,
  195. file = "include/cfg/sci.h"
  196. },
  197. },
  198. },
  199. --
  200. -- SCI2 Interface
  201. --
  202. {
  203. name = "nutarch_m68k_coldfire_devices_sci2",
  204. brief = "SCI2 Driver",
  205. description = "In current implementation the SCI (Serial Communication Interface) is used as an UART device only.\n\n"..
  206. "Hardware specific UART driver. Implements hardware "..
  207. "functions for the generic USART driver framework.",
  208. requires = { "HW_SCI_COLDFIRE", "HW_SCI2" },
  209. provides = { "DEV_UART", "DEV_UART_SPECIFIC" },
  210. -- sources = { "m68k/coldfire/dev/common/mcf5_sci2.c" },
  211. options =
  212. {
  213. {
  214. macro = "SCI2_TXD_PORTPIN",
  215. brief = "SCI2 TXD Pin selection",
  216. type = "enumerated",
  217. description =
  218. function()
  219. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci2_txd_pins_descr; end;
  220. end,
  221. choices =
  222. function()
  223. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci2_txd_pins end;
  224. end,
  225. file = "include/cfg/sci.h"
  226. },
  227. {
  228. macro = "SCI2_RXD_PORTPIN",
  229. brief = "SCI2 RXD Pin selection",
  230. type = "enumerated",
  231. description =
  232. function()
  233. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci2_rxd_pins_descr; end;
  234. end,
  235. choices =
  236. function()
  237. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci2_rxd_pins end;
  238. end,
  239. file = "include/cfg/sci.h"
  240. },
  241. },
  242. },
  243. --
  244. -- SCI3 Interface
  245. --
  246. {
  247. name = "nutarch_m68k_coldfire_devices_sci3",
  248. brief = "SCI3 Driver",
  249. description = "In current implementation the SCI (Serial Communication Interface) is used as an UART device only.\n\n"..
  250. "Hardware specific UART driver. Implements hardware "..
  251. "functions for the generic USART driver framework.",
  252. requires = { "HW_SCI_COLDFIRE", "HW_SCI3" },
  253. provides = { "DEV_UART", "DEV_UART_SPECIFIC" },
  254. -- sources = { "m68k/coldfire/dev/common/mcf5_sci3.c" },
  255. options =
  256. {
  257. {
  258. macro = "SCI3_TXD_PORTPIN",
  259. brief = "SCI3 TXD Pin selection",
  260. type = "enumerated",
  261. description =
  262. function()
  263. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci3_txd_pins_descr; end;
  264. end,
  265. choices =
  266. function()
  267. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci3_txd_pins end;
  268. end,
  269. file = "include/cfg/sci.h"
  270. },
  271. {
  272. macro = "SCI3_RXD_PORTPIN",
  273. brief = "SCI3 RXD Pin selection",
  274. type = "enumerated",
  275. description =
  276. function()
  277. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci3_rxd_pins_descr; end;
  278. end,
  279. choices =
  280. function()
  281. if c_is_provided("HW_MCU_MCF51CN") then return mcf51cn_sci3_rxd_pins end;
  282. end,
  283. file = "include/cfg/sci.h"
  284. },
  285. },
  286. },
  287. --
  288. -- UART Debug Output
  289. --
  290. {
  291. name = "nutarch_m68k_coldfire_devices_uart_debug",
  292. brief = "UART Debug Output",
  293. description = "This simple UART output driver uses polling instead of interrupts "..
  294. "and can be used within interrupt routines.\n"..
  295. "It is mainly used for debugging and tracing.\n\n"..
  296. "This driver uses only RXD and TXD pins which are configured in UARTn Drivers below.\n\n"..
  297. "Call one of following functions:\n"..
  298. "\tNutRegisterDevice(&devDebug0, 0, 0) for UART0\n"..
  299. "\tNutRegisterDevice(&devDebug1, 0, 0) for UART1\n"..
  300. "\t...\n"..
  301. "\tNutRegisterDevice(&devDebugn, 0, 0) for UARTn\n\n"..
  302. "Then you can use any of the stdio functions to open device uart0, uart1, ..., uartn.\n"..
  303. "",
  304. requires = { "HW_UART_COLDFIRE" },
  305. provides = { "DEV_UART", "DEV_FILE", "DEV_WRITE" },
  306. sources = { "m68k/coldfire/dev/common/mcf5_uart_debug.c"},
  307. },
  308. --
  309. -- UART0 Interface
  310. --
  311. {
  312. name = "nutarch_m68k_coldfire_devices_uart0",
  313. brief = "UART0 Driver",
  314. description = "Hardware specific UART driver. Implements hardware "..
  315. "functions for the generic driver framework.",
  316. requires = { "HW_UART_COLDFIRE", "HW_UART0" },
  317. provides = { "DEV_UART", "DEV_UART_SPECIFIC" },
  318. sources = { "m68k/coldfire/dev/common/mcf5_uart0.c" },
  319. options =
  320. {
  321. {
  322. macro = "UART0_TXD_PORTPIN",
  323. brief = "UART0 TXD Pin selection",
  324. type = "enumerated",
  325. description =
  326. function()
  327. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart0_txd_pins_descr; end;
  328. end,
  329. choices =
  330. function()
  331. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart0_txd_pins end;
  332. end,
  333. file = "include/cfg/uart.h"
  334. },
  335. {
  336. macro = "UART0_RXD_PORTPIN",
  337. brief = "UART0 RXD Pin selection",
  338. type = "enumerated",
  339. description =
  340. function()
  341. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart0_rxd_pins_descr; end;
  342. end,
  343. choices =
  344. function()
  345. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart0_rxd_pins end;
  346. end,
  347. file = "include/cfg/uart.h"
  348. },
  349. {
  350. macro = "UART0_RTS_PORTPIN",
  351. brief = "UART0 RTS Pin selection",
  352. flavor = "booldata",
  353. type = "enumerated",
  354. description =
  355. function()
  356. local base_descr = "When selected, the driver will support RTS hardware handshake.\n";
  357. if c_is_provided("HW_MCU_MCF5225X") then return base_descr .. mcf5225x_uart0_rts_pins_descr; end;
  358. end,
  359. choices =
  360. function()
  361. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart0_rts_pins end;
  362. end,
  363. file = "include/cfg/uart.h"
  364. },
  365. {
  366. macro = "UART0_CTS_PORTPIN",
  367. brief = "UART0 CTS Pin selection",
  368. flavor = "booldata",
  369. type = "enumerated",
  370. description =
  371. function()
  372. local base_descr = "When selected, the driver will support CTS hardware handshake.\n";
  373. if c_is_provided("HW_MCU_MCF5225X") then return base_descr .. mcf5225x_uart0_cts_pins_descr; end;
  374. end,
  375. choices =
  376. function()
  377. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart0_cts_pins end;
  378. end,
  379. file = "include/cfg/uart.h"
  380. },
  381. {
  382. macro = "UART0_HARDWARE_HDX",
  383. brief = "Half Duplex Mode",
  384. description = "When selected, the driver will be configured for half-duplex mode.\n",
  385. flavor = "booldata",
  386. file = "include/cfg/uart.h"
  387. },
  388. {
  389. macro = "UART0_XONXOFF",
  390. brief = "XON/XOFF Protocol",
  391. description = "When selected, the driver will support software XON/XOFF protocol.",
  392. flavor = "booldata",
  393. file = "include/cfg/uart.h"
  394. },
  395. {
  396. macro = "UART0_HDX_CTRL",
  397. brief = "HDX Control (Half/Full duplex)",
  398. description = "When selected a GPIO pin and/or Board specific functions may be configured for Half/Full duplex control.",
  399. flavor = "booldata",
  400. provides = { "UART0_HDX_CTRL" },
  401. file = "include/cfg/uart.h",
  402. },
  403. {
  404. macro = "UART0_HDX_CTRL_BOARD_SPEC",
  405. brief = "HDX Control Board specific",
  406. description = "When selected, following board specific function may be implemented for Half/Full duplex control:\n"..
  407. "TODO + path to board file",
  408. requires = { "UART0_HDX_CTRL" },
  409. flavor = "booldata",
  410. file = "include/cfg/uart.h"
  411. },
  412. {
  413. macro = "UART0_HDX_CTRL_INV",
  414. brief = "HDX Control Invert",
  415. description = "Sets the HDX signal as active low.\n",
  416. requires = { "UART0_HDX_CTRL" },
  417. flavor = "booldata",
  418. file = "include/cfg/uart.h"
  419. },
  420. {
  421. macro = "UART0_HDX_CTRL_PORT",
  422. brief = "HDX Control Port",
  423. description = "Select the port of the HDX signal.\n",
  424. requires = { "UART0_HDX_CTRL" },
  425. flavor = "booldata",
  426. type = "enumerated",
  427. choices = function() return GetGpioPortIds() end,
  428. file = "include/cfg/uart.h"
  429. },
  430. {
  431. macro = "UART0_HDX_CTRL_PIN",
  432. brief = "HDX Control Pin",
  433. description = "Select the pin for the HDX signal.\n",
  434. requires = { "UART0_HDX_CTRL" },
  435. flavor = "booldata",
  436. type = "enumerated",
  437. choices = function() return GetGpioBits() end,
  438. file = "include/cfg/uart.h"
  439. },
  440. {
  441. macro = "UART0_RS485_CTRL",
  442. brief = "RS485 direction control",
  443. description = "When selected a GPIO pin(s) and/or Board specific functions may be configured for RS485 direction control.",
  444. flavor = "booldata",
  445. provides = { "UART0_RS485_CTRL" },
  446. file = "include/cfg/uart.h"
  447. },
  448. {
  449. macro = "UART0_RS485_CTRL_BOARD_SPEC",
  450. brief = "RS485 Control Board specific",
  451. description = "When selected, following board specific function may be implemented for RS485 direction control:\n"..
  452. "TODO",
  453. requires = { "UART0_RS485_CTRL" },
  454. flavor = "booldata",
  455. file = "include/cfg/uart.h"
  456. },
  457. {
  458. macro = "UART0_RS485_CTRL_DE_INV",
  459. brief = "RS485 DE Control Invert",
  460. description = "Sets the DE signal as active low.\n",
  461. requires = { "UART0_RS485_CTRL" },
  462. flavor = "booldata",
  463. file = "include/cfg/uart.h"
  464. },
  465. {
  466. macro = "UART0_RS485_CTRL_DE_PORT",
  467. brief = "RS485 DE Control Port",
  468. description = "Select the port of the DE signal.\n",
  469. requires = { "UART0_RS485_CTRL" },
  470. flavor = "booldata",
  471. type = "enumerated",
  472. choices = function() return GetGpioPortIds() end,
  473. file = "include/cfg/uart.h"
  474. },
  475. {
  476. macro = "UART0_RS485_CTRL_DE_PIN",
  477. brief = "RS485 DE Control Pin",
  478. description = "Select the pin for the DE signal.\n",
  479. requires = { "UART0_RS485_CTRL" },
  480. flavor = "booldata",
  481. type = "enumerated",
  482. choices = function() return GetGpioBits() end,
  483. file = "include/cfg/uart.h"
  484. },
  485. {
  486. macro = "UART0_RS485_CTRL_RE_INV",
  487. brief = "RS485 /RE Control Invert",
  488. description = "Sets the RE signal as active high.\n",
  489. requires = { "UART0_RS485_CTRL" },
  490. flavor = "booldata",
  491. file = "include/cfg/uart.h"
  492. },
  493. {
  494. macro = "UART0_RS485_CTRL_RE_PORT",
  495. brief = "RS485 /RE Control Port",
  496. description = "Select the port of the /RE signal.\n",
  497. requires = { "UART0_RS485_CTRL" },
  498. flavor = "booldata",
  499. type = "enumerated",
  500. choices = function() return GetGpioPortIds() end,
  501. file = "include/cfg/uart.h"
  502. },
  503. {
  504. macro = "UART0_RS485_CTRL_RE_PIN",
  505. brief = "RS485 /RE Control Pin",
  506. description = "Select the pin for the /RE signal.\n",
  507. requires = { "UART0_RS485_CTRL" },
  508. flavor = "booldata",
  509. type = "enumerated",
  510. choices = function() return GetGpioBits() end,
  511. file = "include/cfg/uart.h"
  512. },
  513. },
  514. },
  515. --
  516. -- UART1 Interface
  517. --
  518. {
  519. name = "nutarch_m68k_coldfire_devices_uart1",
  520. brief = "UART1 Driver",
  521. description = "Hardware specific UART driver. Implements hardware "..
  522. "functions for the generic driver framework.",
  523. requires = { "HW_UART_COLDFIRE", "HW_UART1" },
  524. provides = { "DEV_UART", "DEV_UART_SPECIFIC" },
  525. sources = { "m68k/coldfire/dev/common/mcf5_uart1.c" },
  526. options =
  527. {
  528. {
  529. macro = "UART1_TXD_PORTPIN",
  530. brief = "UART1 TXD Pin selection",
  531. type = "enumerated",
  532. description =
  533. function()
  534. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart1_txd_pins_descr; end;
  535. end,
  536. choices =
  537. function()
  538. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart1_txd_pins end;
  539. end,
  540. file = "include/cfg/uart.h"
  541. },
  542. {
  543. macro = "UART1_RXD_PORTPIN",
  544. brief = "UART1 RXD Pin selection",
  545. type = "enumerated",
  546. description =
  547. function()
  548. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart1_rxd_pins_descr; end;
  549. end,
  550. choices =
  551. function()
  552. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart1_rxd_pins end;
  553. end,
  554. file = "include/cfg/uart.h"
  555. },
  556. {
  557. macro = "UART1_RTS_PORTPIN",
  558. brief = "UART1 RTS Pin selection",
  559. flavor = "booldata",
  560. type = "enumerated",
  561. description =
  562. function()
  563. local base_descr = "When selected, the driver will support RTS hardware handshake.\n";
  564. if c_is_provided("HW_MCU_MCF5225X") then return base_descr .. mcf5225x_uart1_rts_pins_descr; end;
  565. end,
  566. choices =
  567. function()
  568. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart1_rts_pins end;
  569. end,
  570. file = "include/cfg/uart.h"
  571. },
  572. {
  573. macro = "UART1_CTS_PORTPIN",
  574. brief = "UART1 CTS Pin selection",
  575. flavor = "booldata",
  576. type = "enumerated",
  577. description =
  578. function()
  579. local base_descr = "When selected, the driver will support CTS hardware handshake.\n";
  580. if c_is_provided("HW_MCU_MCF5225X") then return base_descr .. mcf5225x_uart1_cts_pins_descr; end;
  581. end,
  582. choices =
  583. function()
  584. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart1_cts_pins end;
  585. end,
  586. file = "include/cfg/uart.h"
  587. },
  588. {
  589. macro = "UART1_HARDWARE_HDX",
  590. brief = "Half Duplex Mode",
  591. description = "When selected, the driver will be configured for half-duplex mode.\n",
  592. flavor = "booldata",
  593. file = "include/cfg/uart.h"
  594. },
  595. {
  596. macro = "UART1_XONXOFF",
  597. brief = "XON/XOFF Protocol",
  598. description = "When selected, the driver will support software XON/XOFF protocol.",
  599. flavor = "booldata",
  600. file = "include/cfg/uart.h"
  601. },
  602. {
  603. macro = "UART1_HDX_CTRL",
  604. brief = "HDX Control (Half/Full duplex)",
  605. description = "When selected a GPIO pin and/or Board specific functions may be configured for Half/Full duplex control.",
  606. flavor = "booldata",
  607. provides = { "UART1_HDX_CTRL" },
  608. file = "include/cfg/uart.h",
  609. },
  610. {
  611. macro = "UART1_HDX_CTRL_BOARD_SPEC",
  612. brief = "HDX Control Board specific",
  613. description = "When selected, following board specific function may be implemented for Half/Full duplex control:\n"..
  614. "TODO + path to board file",
  615. requires = { "UART1_HDX_CTRL" },
  616. flavor = "booldata",
  617. file = "include/cfg/uart.h"
  618. },
  619. {
  620. macro = "UART1_HDX_CTRL_INV",
  621. brief = "HDX Control Invert",
  622. description = "Sets the HDX signal as active low.\n",
  623. requires = { "UART1_HDX_CTRL" },
  624. flavor = "booldata",
  625. file = "include/cfg/uart.h"
  626. },
  627. {
  628. macro = "UART1_HDX_CTRL_PORT",
  629. brief = "HDX Control Port",
  630. description = "Select the port of the HDX signal.\n",
  631. requires = { "UART1_HDX_CTRL" },
  632. flavor = "booldata",
  633. type = "enumerated",
  634. choices = function() return GetGpioPortIds() end,
  635. file = "include/cfg/uart.h"
  636. },
  637. {
  638. macro = "UART1_HDX_CTRL_PIN",
  639. brief = "HDX Control Pin",
  640. description = "Select the pin for the HDX signal.\n",
  641. requires = { "UART1_HDX_CTRL" },
  642. flavor = "booldata",
  643. type = "enumerated",
  644. choices = function() return GetGpioBits() end,
  645. file = "include/cfg/uart.h"
  646. },
  647. {
  648. macro = "UART1_RS485_CTRL",
  649. brief = "RS485 direction control",
  650. description = "When selected a GPIO pin(s) and/or Board specific functions may be configured for RS485 direction control.",
  651. flavor = "booldata",
  652. provides = { "UART1_RS485_CTRL" },
  653. file = "include/cfg/uart.h"
  654. },
  655. {
  656. macro = "UART1_RS485_CTRL_BOARD_SPEC",
  657. brief = "RS485 Control Board specific",
  658. description = "When selected, following board specific function may be implemented for RS485 direction control:\n"..
  659. "TODO",
  660. requires = { "UART1_RS485_CTRL" },
  661. flavor = "booldata",
  662. file = "include/cfg/uart.h"
  663. },
  664. {
  665. macro = "UART1_RS485_CTRL_DE_INV",
  666. brief = "RS485 DE Control Invert",
  667. description = "Sets the DE signal as active low.\n",
  668. requires = { "UART1_RS485_CTRL" },
  669. flavor = "booldata",
  670. file = "include/cfg/uart.h"
  671. },
  672. {
  673. macro = "UART1_RS485_CTRL_DE_PORT",
  674. brief = "RS485 DE Control Port",
  675. description = "Select the port of the DE signal.\n",
  676. requires = { "UART1_RS485_CTRL" },
  677. flavor = "booldata",
  678. type = "enumerated",
  679. choices = function() return GetGpioPortIds() end,
  680. file = "include/cfg/uart.h"
  681. },
  682. {
  683. macro = "UART1_RS485_CTRL_DE_PIN",
  684. brief = "RS485 DE Control Pin",
  685. description = "Select the pin for the DE signal.\n",
  686. requires = { "UART1_RS485_CTRL" },
  687. flavor = "booldata",
  688. type = "enumerated",
  689. choices = function() return GetGpioBits() end,
  690. file = "include/cfg/uart.h"
  691. },
  692. {
  693. macro = "UART1_RS485_CTRL_RE_INV",
  694. brief = "RS485 /RE Control Invert",
  695. description = "Sets the RE signal as active high.\n",
  696. requires = { "UART1_RS485_CTRL" },
  697. flavor = "booldata",
  698. file = "include/cfg/uart.h"
  699. },
  700. {
  701. macro = "UART1_RS485_CTRL_RE_PORT",
  702. brief = "RS485 /RE Control Port",
  703. description = "Select the port of the /RE signal.\n",
  704. requires = { "UART1_RS485_CTRL" },
  705. flavor = "booldata",
  706. type = "enumerated",
  707. choices = function() return GetGpioPortIds() end,
  708. file = "include/cfg/uart.h"
  709. },
  710. {
  711. macro = "UART1_RS485_CTRL_RE_PIN",
  712. brief = "RS485 /RE Control Pin",
  713. description = "Select the pin for the /RE signal.\n",
  714. requires = { "UART1_RS485_CTRL" },
  715. flavor = "booldata",
  716. type = "enumerated",
  717. choices = function() return GetGpioBits() end,
  718. file = "include/cfg/uart.h"
  719. },
  720. },
  721. },
  722. --
  723. -- UART2 Interface
  724. --
  725. {
  726. name = "nutarch_m68k_coldfire_devices_uart2",
  727. brief = "UART2 Driver",
  728. description = "Hardware specific UART driver. Implements hardware "..
  729. "functions for the generic driver framework.",
  730. requires = { "HW_UART_COLDFIRE", "HW_UART2" },
  731. provides = { "DEV_UART", "DEV_UART_SPECIFIC" },
  732. sources = { "m68k/coldfire/dev/common/mcf5_uart2.c" },
  733. options =
  734. {
  735. {
  736. macro = "UART2_TXD_PORTPIN",
  737. brief = "UART2 TXD Pin selection",
  738. type = "enumerated",
  739. description =
  740. function()
  741. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart2_txd_pins_descr; end;
  742. end,
  743. choices =
  744. function()
  745. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart2_txd_pins end;
  746. end,
  747. file = "include/cfg/uart.h"
  748. },
  749. {
  750. macro = "UART2_RXD_PORTPIN",
  751. brief = "UART2 RXD Pin selection",
  752. type = "enumerated",
  753. description =
  754. function()
  755. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart2_rxd_pins_descr; end;
  756. end,
  757. choices =
  758. function()
  759. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart2_rxd_pins end;
  760. end,
  761. file = "include/cfg/uart.h"
  762. },
  763. {
  764. macro = "UART2_RTS_PORTPIN",
  765. brief = "UART2 RTS Pin selection",
  766. flavor = "booldata",
  767. type = "enumerated",
  768. description =
  769. function()
  770. local base_descr = "When selected, the driver will support RTS hardware handshake.\n";
  771. if c_is_provided("HW_MCU_MCF5225X") then return base_descr .. mcf5225x_uart2_rts_pins_descr; end;
  772. end,
  773. choices =
  774. function()
  775. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart2_rts_pins end;
  776. end,
  777. file = "include/cfg/uart.h"
  778. },
  779. {
  780. macro = "UART2_CTS_PORTPIN",
  781. brief = "UART2 CTS Pin selection",
  782. flavor = "booldata",
  783. type = "enumerated",
  784. description =
  785. function()
  786. local base_descr = "When selected, the driver will support CTS hardware handshake.\n";
  787. if c_is_provided("HW_MCU_MCF5225X") then return base_descr .. mcf5225x_uart2_cts_pins_descr; end;
  788. end,
  789. choices =
  790. function()
  791. if c_is_provided("HW_MCU_MCF5225X") then return mcf5225x_uart2_cts_pins end;
  792. end,
  793. file = "include/cfg/uart.h"
  794. },
  795. {
  796. macro = "UART2_HARDWARE_HDX",
  797. brief = "Half Duplex Mode",
  798. description = "When selected, the driver will be configured for half-duplex mode.\n",
  799. flavor = "booldata",
  800. file = "include/cfg/uart.h"
  801. },
  802. {
  803. macro = "UART2_XONXOFF",
  804. brief = "XON/XOFF Protocol",
  805. description = "When selected, the driver will support software XON/XOFF protocol.",
  806. flavor = "booldata",
  807. file = "include/cfg/uart.h"
  808. },
  809. {
  810. macro = "UART2_HDX_CTRL",
  811. brief = "HDX Control (Half/Full duplex)",
  812. description = "When selected a GPIO pin and/or Board specific functions may be configured for Half/Full duplex control.",
  813. flavor = "booldata",
  814. provides = { "UART2_HDX_CTRL" },
  815. file = "include/cfg/uart.h",
  816. },
  817. {
  818. macro = "UART2_HDX_CTRL_BOARD_SPEC",
  819. brief = "HDX Control Board specific",
  820. description = "When selected, following board specific function may be implemented for Half/Full duplex control:\n"..
  821. "TODO + path to board file",
  822. requires = { "UART2_HDX_CTRL" },
  823. flavor = "booldata",
  824. file = "include/cfg/uart.h"
  825. },
  826. {
  827. macro = "UART2_HDX_CTRL_INV",
  828. brief = "HDX Control Invert",
  829. description = "Sets the HDX signal as active low.\n",
  830. requires = { "UART2_HDX_CTRL" },
  831. flavor = "booldata",
  832. file = "include/cfg/uart.h"
  833. },
  834. {
  835. macro = "UART2_HDX_CTRL_PORT",
  836. brief = "HDX Control Port",
  837. description = "Select the port of the HDX signal.\n",
  838. requires = { "UART2_HDX_CTRL" },
  839. flavor = "booldata",
  840. type = "enumerated",
  841. choices = function() return GetGpioPortIds() end,
  842. file = "include/cfg/uart.h"
  843. },
  844. {
  845. macro = "UART2_HDX_CTRL_PIN",
  846. brief = "HDX Control Pin",
  847. description = "Select the pin for the HDX signal.\n",
  848. requires = { "UART2_HDX_CTRL" },
  849. flavor = "booldata",
  850. type = "enumerated",
  851. choices = function() return GetGpioBits() end,
  852. file = "include/cfg/uart.h"
  853. },
  854. {
  855. macro = "UART2_RS485_CTRL",
  856. brief = "RS485 direction control",
  857. description = "When selected a GPIO pin(s) and/or Board specific functions may be configured for RS485 direction control.",
  858. flavor = "booldata",
  859. provides = { "UART2_RS485_CTRL" },
  860. file = "include/cfg/uart.h"
  861. },
  862. {
  863. macro = "UART2_RS485_CTRL_BOARD_SPEC",
  864. brief = "RS485 Control Board specific",
  865. description = "When selected, following board specific function may be implemented for RS485 direction control:\n"..
  866. "TODO",
  867. requires = { "UART2_RS485_CTRL" },
  868. flavor = "booldata",
  869. file = "include/cfg/uart.h"
  870. },
  871. {
  872. macro = "UART2_RS485_CTRL_DE_INV",
  873. brief = "RS485 DE Control Invert",
  874. description = "Sets the DE signal as active low.\n",
  875. requires = { "UART2_RS485_CTRL" },
  876. flavor = "booldata",
  877. file = "include/cfg/uart.h"
  878. },
  879. {
  880. macro = "UART2_RS485_CTRL_DE_PORT",
  881. brief = "RS485 DE Control Port",
  882. description = "Select the port of the DE signal.\n",
  883. requires = { "UART2_RS485_CTRL" },
  884. flavor = "booldata",
  885. type = "enumerated",
  886. choices = function() return GetGpioPortIds() end,
  887. file = "include/cfg/uart.h"
  888. },
  889. {
  890. macro = "UART2_RS485_CTRL_DE_PIN",
  891. brief = "RS485 DE Control Pin",
  892. description = "Select the pin for the DE signal.\n",
  893. requires = { "UART2_RS485_CTRL" },
  894. flavor = "booldata",
  895. type = "enumerated",
  896. choices = function() return GetGpioBits() end,
  897. file = "include/cfg/uart.h"
  898. },
  899. {
  900. macro = "UART2_RS485_CTRL_RE_INV",
  901. brief = "RS485 /RE Control Invert",
  902. description = "Sets the RE signal as active high.\n",
  903. requires = { "UART2_RS485_CTRL" },
  904. flavor = "booldata",
  905. file = "include/cfg/uart.h"
  906. },
  907. {
  908. macro = "UART2_RS485_CTRL_RE_PORT",
  909. brief = "RS485 /RE Control Port",
  910. description = "Select the port of the /RE signal.\n",
  911. requires = { "UART2_RS485_CTRL" },
  912. flavor = "booldata",
  913. type = "enumerated",
  914. choices = function() return GetGpioPortIds() end,
  915. file = "include/cfg/uart.h"
  916. },
  917. {
  918. macro = "UART2_RS485_CTRL_RE_PIN",
  919. brief = "RS485 /RE Control Pin",
  920. description = "Select the pin for the /RE signal.\n",
  921. requires = { "UART2_RS485_CTRL" },
  922. flavor = "booldata",
  923. type = "enumerated",
  924. choices = function() return GetGpioBits() end,
  925. file = "include/cfg/uart.h"
  926. },
  927. },
  928. },
  929. }