lpc17xxdev.nut 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. --
  2. -- Copyright (C) 2012 Ole Reinhardt <ole.reinhardt@embedded-it.de>
  3. --
  4. -- Redistribution and use in source and binary forms, with or without
  5. -- modification, are permitted provided that the following conditions
  6. -- are met:
  7. --
  8. -- 1. Redistributions of source code must retain the above copyright
  9. -- notice, this list of conditions and the following disclaimer.
  10. -- 2. Redistributions in binary form must reproduce the above copyright
  11. -- notice, this list of conditions and the following disclaimer in the
  12. -- documentation and/or other materials provided with the distribution.
  13. -- 3. Neither the name of the copyright holders nor the names of
  14. -- contributors may be used to endorse or promote products derived
  15. -- from this software without specific prior written permission.
  16. --
  17. -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. -- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. -- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. -- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. -- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. -- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. -- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. -- AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. -- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. -- SUCH DAMAGE.
  29. --
  30. -- For additional information see http://www.ethernut.de/
  31. --
  32. nutarch_cm3_lpc17xx_devices =
  33. {
  34. -- ***********************************
  35. --
  36. -- LPC17xx Device Drivers
  37. --
  38. -- ***********************************
  39. --
  40. -- LPC176x DEBUG Macro (Low-Level Debug UART definition)
  41. --
  42. {
  43. name = "nutarch_cm3_lpc17xx_debugmacro",
  44. brief = "LPC17xx Low-Level Debug UART macros for use in exception handlers",
  45. description = "Polling UART function (macro) to use in exception hanlders\n",
  46. requires = { "HW_UART0_LPC17xx", "HW_UART1_LPC17xx", "HW_UART2_LPC17xx", "HW_UART3_LPC17xx" },
  47. provides = { "DEBUG_MACRO"},
  48. sources = { "cm3/cmsis/cortex_debug.c" },
  49. options =
  50. {
  51. {
  52. macro = "DEBUG_MACRO",
  53. brief = "Enabled",
  54. description = "Check to enable debug output of exception handlers",
  55. flavor = "boolean",
  56. file = "include/cfg/cortex_debug.h"
  57. },
  58. {
  59. macro = "DEBUG_BACKTRACE",
  60. brief = "Enable call backtrace (experimental)",
  61. description = "Check to enable call stack back trace in case of an exception.\n\n"..
  62. "In case of an exception the last 128 words on the stack will\n"..
  63. "be printed out and a call trace will be generated and printed out\n"..
  64. "(Address of the function entry and offset in the function).\n"..
  65. "Together with the .map file and / or the assembler listing\n"..
  66. "the call trace allows you to trace back your code flow in\n"..
  67. "which led to the exception. The assembler listing can be\n"..
  68. "created by 'arm-none-eabi-objdump -d myfile.elf'\n\n"..
  69. "This function is highly experimental and relies on a very\n"..
  70. "defined function entry code and existance of a stack\n"..
  71. "frame pointer\n"..
  72. "To ensure the correct function layout this option disables\n"..
  73. "compiler optimisation and enables a stack frame pointer\n"..
  74. "generation. The following compiler options will be set:\n\n"..
  75. "-O0 -mtpcs-frame -mtpcs-leaf-frame -fno-omit-frame-pointer\n\n"..
  76. "This will enlarge the resulkting binary size significantly\n"..
  77. "any may influence execution performance.\n\n"..
  78. "The backtrace will only work for functions compiled with\n"..
  79. "above compiler parameters. E.g. it will very likely not work"..
  80. "for any newlib functions.\n",
  81. flavor = "boolean",
  82. makedefs = { "MDEBUG+=-O0 -mtpcs-frame -mtpcs-leaf-frame -fno-omit-frame-pointer" },
  83. file = "include/cfg/cortex_debug.h"
  84. },
  85. {
  86. macro = "DEBUG_UART_NR",
  87. brief = "Debug UART",
  88. description = "Select the UART to use for low level debugging",
  89. type = "enumerated",
  90. choices = { "LPC_UART0", "LPC_UART1", "LPC_UART2", "LPC_UART3" },
  91. default = "LPC_UART0",
  92. file = "include/cfg/cortex_debug.h"
  93. }
  94. }
  95. },
  96. --
  97. -- LPC17xx RTC
  98. --
  99. {
  100. name = "nutarch_cm3_lpc17xx_rtc",
  101. brief = "LPC17xx RTC Driver",
  102. description = "LPC17xx RTC driver.",
  103. requires = { "HW_RTC_LPC17xx" },
  104. provides = { "DEV_RTC" },
  105. sources = { "cm3/dev/nxp/lpc17xx_rtc.c"},
  106. },
  107. --
  108. -- LPC17xx Watchdog Timer
  109. --
  110. {
  111. name = "nutarch_cm3_lpc17xx_wdt",
  112. brief = "LPC17xx Watchdog Timer",
  113. requires = { "HW_WDT_LPC17xx" },
  114. sources = { "cm3/dev/nxp/lpc17xx_wdt.c"}
  115. },
  116. --
  117. -- LPC17xx Flash Memory Controller
  118. --
  119. {
  120. name = "nutarch_cm3_lpc17xx_iap",
  121. brief = "LPC17xx In Application Flash Programming API (IAP)",
  122. description = "Routines for setup and programming LPC17x series internal FLASH.\n",
  123. requires = { "HW_FLASH_LPC17xx" },
  124. sources = { "cm3/dev/nxp/lpc17xx_iap.c" }
  125. },
  126. --
  127. -- LPC17xx General purpose DMA Controller
  128. --
  129. {
  130. name = "nutarch_cm3_lpc17xx_gpdma",
  131. brief = "LPC17xx General purpose DMA Controller API",
  132. description = "Routines for setup and programming LPC17x series GPDMA controller.\n",
  133. requires = { "HW_GPDMA_LPC17xx" },
  134. sources = { "cm3/dev/nxp/lpc17xx_gpdma.c"}
  135. },
  136. --
  137. -- LPC17xx SSP Controller 0, 1, 2
  138. --
  139. {
  140. name = "nutarch_cm3_lpc176x_ssp",
  141. brief = "SSP Bus 0, 1, (2)",
  142. description = "LPC176x SSP-SPI driver, currently implemented as polling driver \n"..
  143. "without interrupt or dma usage\n",
  144. requires = { "HW_SSP_LPC17xx" },
  145. provides = { "SPIBUS_CONTROLLER" },
  146. sources = { "cm3/dev/nxp/lpc17xx_ssp.c" },
  147. },
  148. --
  149. -- LPC17xx EMAC
  150. --
  151. {
  152. name = "nutarch_cm3_lpc17xx_emac",
  153. brief = "LPC17xx EMAC Driver",
  154. description = "LAN driver for LPC176x, LPC177x_8x etc.",
  155. requires = { "HW_EMAC_LPC17xx", "NUT_EVENT", "NUT_TIMER" },
  156. provides = { "NET_MAC" },
  157. sources = { "cm3/dev/nxp/lpc17xx_emac.c"},
  158. options =
  159. {
  160. {
  161. macro = "NUT_THREAD_NICRXSTACK",
  162. brief = "Receiver Thread Stack",
  163. description = "Number of bytes to be allocated for the stack of the NIC receive thread.",
  164. flavor = "booldata",
  165. type = "integer",
  166. file = "include/cfg/dev.h"
  167. },
  168. {
  169. macro = "EMAC_RX_BUFFERS",
  170. brief = "Receive Buffers",
  171. description = "Number of 128 byte receive buffers.\n"..
  172. "Increase to handle high traffic situations.\n"..
  173. "Decrease to handle low memory situations.\n"..
  174. "Default is 32.\n",
  175. flavor = "booldata",
  176. type = "integer",
  177. file = "include/cfg/dev.h"
  178. },
  179. {
  180. macro = "EMAC_TX_BUFSIZ",
  181. brief = "Transmit Buffer Size",
  182. description = "The driver will allocate two transmit buffers.\n"..
  183. "Can be decreased in low memory situations. Be aware, "..
  184. "that this may break your network application. Do not "..
  185. "change this without exactly knowing the consequences.\n"..
  186. "Default is 1536.\n",
  187. flavor = "booldata",
  188. type = "integer",
  189. file = "include/cfg/dev.h"
  190. },
  191. {
  192. macro = "EMAC_LINK_LOOPS",
  193. brief = "Link Polling Loops",
  194. description = "This simple implementation runs a dumb polling loop "..
  195. "while waiting for the Ethernet link status.\n"..
  196. "If you experience link problems, increasing this value "..
  197. "may help.\n"..
  198. "Default is 10000.\n",
  199. flavor = "booldata",
  200. type = "integer",
  201. file = "include/cfg/dev.h"
  202. },
  203. }
  204. },
  205. --
  206. -- LPC17xx Signal handler
  207. --
  208. {
  209. name = "nutarch_cm3_lpc17xx_sig",
  210. brief = "LPC17xx Signals ",
  211. description = "Helper to create the sig_DEVXX entries",
  212. sources = { "cm3/dev/nxp/ih_lpc17xx.c"},
  213. options =
  214. {
  215. {
  216. macro = "HW_WDT_LPC17xx",
  217. brief = "WDT Availability",
  218. description = "WDT Availability",
  219. requires = { "HW_WDT_LPC17xx" },
  220. default = "1",
  221. type = "integer",
  222. file = "include/cfg/devices.h"
  223. },
  224. {
  225. macro = "HW_UART0_LPC17xx",
  226. brief = "UART 0 Availability",
  227. description = "UART 0 Availability",
  228. requires = { "HW_UART0_LPC17xx" },
  229. default = "1",
  230. type = "integer",
  231. file = "include/cfg/devices.h"
  232. },
  233. {
  234. macro = "HW_UART1_LPC17xx",
  235. brief = "UART 1 Availability",
  236. description = "UART 1 Availability",
  237. requires = { "HW_UART1_LPC17xx" },
  238. default = "1",
  239. type = "integer",
  240. file = "include/cfg/devices.h"
  241. },
  242. {
  243. macro = "HW_UART2_LPC17xx",
  244. brief = "UART 2 Availability",
  245. description = "UART 2 Availability",
  246. requires = { "HW_UART2_LPC17xx" },
  247. default = "1",
  248. type = "integer",
  249. file = "include/cfg/devices.h"
  250. },
  251. {
  252. macro = "HW_UART3_LPC17xx",
  253. brief = "UART 3 Availability",
  254. description = "UART 3 Availability",
  255. requires = { "HW_UART3_LPC17xx" },
  256. default = "1",
  257. type = "integer",
  258. file = "include/cfg/devices.h"
  259. },
  260. {
  261. macro = "HW_UART4_LPC17xx",
  262. brief = "UART 4 Availability",
  263. description = "UART 4 Availability",
  264. requires = { "HW_UART4_LPC17xx" },
  265. default = "1",
  266. type = "integer",
  267. file = "include/cfg/devices.h"
  268. },
  269. {
  270. macro = "HW_I2C0_LPC17xx",
  271. brief = "I2C 0 Availability",
  272. description = "I2C 0 Availability",
  273. requires = { "HW_I2C0_LPC17xx" },
  274. default = "1",
  275. type = "integer",
  276. file = "include/cfg/devices.h"
  277. },
  278. {
  279. macro = "HW_I2C1_LPC17xx",
  280. brief = "I2C 1 Availability",
  281. description = "I2C 1 Availability",
  282. requires = { "HW_I2C1_LPC17xx" },
  283. default = "1",
  284. type = "integer",
  285. file = "include/cfg/devices.h"
  286. },
  287. {
  288. macro = "HW_I2C2_LPC17xx",
  289. brief = "I2C 2 Availability",
  290. description = "I2C 2 Availability",
  291. requires = { "HW_I2C2_LPC17xx" },
  292. default = "1",
  293. type = "integer",
  294. file = "include/cfg/devices.h"
  295. },
  296. {
  297. macro = "HW_SSP0_LPC17xx",
  298. brief = "SSP0 Availability",
  299. description = "SSP0 Availability",
  300. requires = { "HW_SSP0_LPC17xx" },
  301. default = "1",
  302. type = "integer",
  303. file = "include/cfg/devices.h"
  304. },
  305. {
  306. macro = "HW_SSP1_LPC17xx",
  307. brief = "SSP1 Availability",
  308. description = "SSP1 Availability",
  309. requires = { "HW_SSP1_LPC17xx" },
  310. default = "1",
  311. type = "integer",
  312. file = "include/cfg/devices.h"
  313. },
  314. {
  315. macro = "HW_SSP2_LPC17xx",
  316. brief = "SSP2 Availability",
  317. description = "SSP2 Availability",
  318. requires = { "HW_SSP2_LPC17xx" },
  319. default = "1",
  320. type = "integer",
  321. file = "include/cfg/devices.h"
  322. },
  323. {
  324. macro = "HW_RTC_LPC17xx",
  325. brief = "RTC Availability",
  326. description = "RTC Availability",
  327. requires = { "HW_RTC_LPC17xx" },
  328. default = "1",
  329. type = "integer",
  330. file = "include/cfg/devices.h"
  331. },
  332. {
  333. macro = "HW_MCI_LPC177x_8x",
  334. brief = "MCI Availability for LPC177x_8x",
  335. description = "MCI Availability",
  336. requires = { "HW_MCI_LPC177x_8x" },
  337. default = "1",
  338. type = "integer",
  339. file = "include/cfg/devices.h"
  340. },
  341. {
  342. macro = "HW_EMAC_LPC17xx",
  343. brief = "EMAC Availability",
  344. description = "EMAC Availability",
  345. requires = { "HW_EMAC_LPC17xx" },
  346. default = "1",
  347. type = "integer",
  348. file = "include/cfg/devices.h"
  349. },
  350. {
  351. macro = "HW_GPIO_LPC177x_8x",
  352. brief = "GPIO Availability for LPC177x_8x",
  353. description = "GPIO Availability for LPC177x_8x",
  354. requires = { "HW_GPIO_LPC177x_8x" },
  355. default = "1",
  356. type = "integer",
  357. file = "include/cfg/devices.h"
  358. },
  359. {
  360. macro = "HW_GPDMA_LPC17xx",
  361. brief = "GPDMA Availability",
  362. description = "GPDMA Availability",
  363. requires = { "HW_GPDMA_LPC17xx" },
  364. default = "1",
  365. type = "integer",
  366. file = "include/cfg/devices.h"
  367. },
  368. }
  369. }
  370. }