repository.nut 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. --
  2. -- Copyright (C) 2005-2007 by egnite Software GmbH. All rights reserved.
  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. -- The repository contains an enumerated list
  33. -- of all top-level components.
  34. --
  35. -- $Log$
  36. -- Revision 1.39 2009/03/06 23:54:31 olereinhardt
  37. -- Added gorp library
  38. --
  39. -- Revision 1.38 2009/02/06 15:52:44 haraldkipp
  40. -- Introduced target independent symbols for external interrutps.
  41. --
  42. -- Revision 1.37 2009/01/18 16:44:56 haraldkipp
  43. -- Introduced target independent port numbers.
  44. -- Distinguish between PIO IDs and port numbers.
  45. --
  46. -- Revision 1.36 2008/10/10 11:52:25 haraldkipp
  47. -- Lua added.
  48. --
  49. -- Revision 1.35 2008/10/05 16:58:14 haraldkipp
  50. -- Added new contrib directory for non-BSDL code.
  51. --
  52. -- Revision 1.34 2008/09/23 07:25:05 haraldkipp
  53. -- Added support for remaining AT91SAM7 familiy members.
  54. --
  55. -- Revision 1.33 2008/08/28 11:08:20 haraldkipp
  56. -- Added Lua routines which dynamically return GPIO ports and bits based on
  57. -- the selected target platform.
  58. --
  59. -- Revision 1.32 2008/08/11 11:51:20 thiagocorrea
  60. -- Preliminary Atmega2560 compile options, but not yet supported.
  61. -- It builds, but doesn't seam to run properly at this time.
  62. --
  63. -- Revision 1.31 2008/08/06 12:51:07 haraldkipp
  64. -- Added support for Ethernut 5 (AT91SAM9XE reference design).
  65. --
  66. -- Revision 1.30 2008/07/24 17:05:12 haraldkipp
  67. -- Demonstrates some Configurator capabilities.
  68. --
  69. -- Revision 1.29 2008/07/14 13:04:28 haraldkipp
  70. -- New Ethernut 3 link option with code in RAM and constant data in ROM.
  71. --
  72. -- Revision 1.28 2008/07/09 11:14:46 haraldkipp
  73. -- Changelog corrected, again.
  74. --
  75. -- Revision 1.27 2008/04/01 10:12:08 haraldkipp
  76. -- Added missing at91sam7s entries.
  77. --
  78. -- Revision 1.26 2008/02/15 17:05:52 haraldkipp
  79. -- AT91SAM7SE512 support added. Global MCU list simplifies exclusivity
  80. -- attribute. HW_EBI_AT91 added for MCUs with external bus interface.
  81. --
  82. -- Revision 1.25 2008/01/31 09:11:19 haraldkipp
  83. -- Added ability to upload AT91 flash image via HTTP. Many thanks to
  84. -- Matthias Wilde.
  85. -- Added AVR ports H up to L.
  86. --
  87. -- Revision 1.24 2007/09/11 13:39:45 haraldkipp
  88. -- Configurable startup file for ICCAVR.
  89. --
  90. -- Revision 1.23 2007/09/06 19:54:31 olereinhardt
  91. -- Added ld script selection for eb40a_redboot_ram (EB40A Eval board with
  92. -- redboot bootloader running, changed load address)
  93. --
  94. -- Revision 1.22 2007/04/12 09:09:27 haraldkipp
  95. -- Allow to select empty entry for AT91 ports.
  96. --
  97. -- Revision 1.21 2007/02/15 16:19:44 haraldkipp
  98. -- AT91 PIO IDs added.
  99. --
  100. -- Revision 1.20 2006/10/08 16:40:17 haraldkipp
  101. -- Many thanks to Thiago Correa for adding LCD port configuration.
  102. --
  103. -- Revision 1.19 2006/10/05 17:14:03 haraldkipp
  104. -- Added script, which extracts version information from C source file.
  105. -- This demonstrates the new scripting capabilities of the Configurator.
  106. --
  107. -- Revision 1.18 2006/09/05 12:31:34 haraldkipp
  108. -- Added missing linker script for SAM9260 applications running in external
  109. -- RAM.
  110. --
  111. -- Revision 1.17 2006/08/01 07:34:16 haraldkipp
  112. -- New linker script and new startup file support applications running in
  113. -- flash memory.
  114. --
  115. -- Revision 1.16 2006/02/23 15:40:09 haraldkipp
  116. -- Added choice for 32 bit ports.
  117. --
  118. -- Revision 1.15 2006/01/23 17:31:36 haraldkipp
  119. -- Enhanced description of dev library.
  120. --
  121. -- Revision 1.14 2006/01/22 17:35:22 haraldkipp
  122. -- Baudrate calculation for Ethernut 3 failed if MCU Clock was not specified.
  123. --
  124. -- Revision 1.13 2006/01/05 16:44:58 haraldkipp
  125. -- PLL clock choices added.
  126. --
  127. -- Revision 1.12 2005/10/24 10:01:19 haraldkipp
  128. -- New linker scripts added for AT91 apps running in RAM and ROM.
  129. --
  130. -- Revision 1.11 2005/10/07 22:10:29 hwmaier
  131. -- Added support for PLATFORM macro
  132. --
  133. -- Revision 1.10 2005/07/26 16:14:21 haraldkipp
  134. -- Better title for architecture.
  135. --
  136. -- Revision 1.9 2005/04/05 18:04:17 haraldkipp
  137. -- Support for ARM7 Wolf Board added.
  138. --
  139. -- Revision 1.8 2005/01/22 19:18:37 haraldkipp
  140. -- Changed AVR port configuration names from PORTx to AVRPORTx.
  141. -- Added C++ support contributed by Oliver Schulz (MPI).
  142. --
  143. -- Revision 1.7 2004/11/24 14:47:24 haraldkipp
  144. -- Empty items allow to disable choices
  145. --
  146. -- Revision 1.6 2004/10/03 18:37:39 haraldkipp
  147. -- GBA support
  148. --
  149. -- Revision 1.5 2004/09/07 19:12:57 haraldkipp
  150. -- Linker script support added
  151. --
  152. -- Revision 1.4 2004/09/01 14:09:49 haraldkipp
  153. -- AVR interrupt selection simplified
  154. --
  155. -- Revision 1.3 2004/08/18 13:46:08 haraldkipp
  156. -- Fine with avr-gcc
  157. --
  158. -- Revision 1.2 2004/08/03 15:09:30 haraldkipp
  159. -- Another change of everything
  160. --
  161. -- Revision 1.1 2004/06/07 16:38:43 haraldkipp
  162. -- First release
  163. --
  164. --
  165. mcu_names = {
  166. "MCU_ATMEGA103",
  167. "MCU_ATMEGA128",
  168. "MCU_AT90CAN128",
  169. "MCU_AT90USB1287",
  170. "MCU_ATMEGA2560",
  171. "MCU_ATMEGA2561",
  172. "MCU_AT91SAM9260",
  173. "MCU_AT91SAM9G45",
  174. "MCU_AT91SAM9XE512",
  175. "MCU_AT91SAM7X128",
  176. "MCU_AT91SAM7X256",
  177. "MCU_AT91SAM7X512",
  178. "MCU_AT91SAM7S16",
  179. "MCU_AT91SAM7S32",
  180. "MCU_AT91SAM7S64",
  181. "MCU_AT91SAM7S128",
  182. "MCU_AT91SAM7S256",
  183. "MCU_AT91SAM7S512",
  184. "MCU_AT91SAM7SE32",
  185. "MCU_AT91SAM7SE256",
  186. "MCU_AT91SAM7SE512",
  187. "MCU_AT91R40008",
  188. "MCU_GBA",
  189. "MCU_LINUX_EMU",
  190. "MCU_H8_3068",
  191. "MCU_S3C4510B",
  192. "MCU_AVR32UC3A0512ES",
  193. "MCU_AVR32UC3A0512",
  194. "MCU_AVR32UC3A3256",
  195. "MCU_AVR32UC3B0256",
  196. "MCU_AVR32UC3B164",
  197. "MCU_AVR32UC3L064",
  198. "MCU_STM32F030",
  199. "MCU_STM32F031",
  200. "MCU_STM32F042",
  201. "MCU_STM32F051",
  202. "MCU_STM32F072",
  203. "MCU_STM32F101",
  204. "MCU_STM32F103",
  205. "MCU_STM32F105",
  206. "MCU_STM32F107",
  207. "MCU_STM32F205",
  208. "MCU_STM32F207",
  209. "MCU_STM32F215",
  210. "MCU_STM32F217",
  211. "MCU_STM32F302",
  212. "MCU_STM32F303",
  213. "MCU_STM32F313",
  214. "MCU_STM32F373",
  215. "MCU_STM32F383",
  216. "MCU_STM32F401",
  217. "MCU_STM32F405",
  218. "MCU_STM32F407",
  219. "MCU_STM32F415",
  220. "MCU_STM32F417",
  221. "MCU_STM32F427",
  222. "MCU_STM32F429",
  223. "MCU_STM32F437",
  224. "MCU_STM32L151x6",
  225. "MCU_STM32L151x8",
  226. "MCU_STM32L151xB",
  227. "MCU_STM32L151CC",
  228. "MCU_STM32L151UC",
  229. "MCU_STM32L151RC",
  230. "MCU_STM32L151RCA",
  231. "MCU_STM32L151VCA",
  232. "MCU_STM32L151QC",
  233. "MCU_STM32L151VC",
  234. "MCU_STM32L151xD",
  235. "MCU_STM32L151xE",
  236. "MCU_STM32L152x6",
  237. "MCU_STM32L152x8",
  238. "MCU_STM32L152xB",
  239. "MCU_STM32L152CC",
  240. "MCU_STM32L152UC",
  241. "MCU_STM32L152RC",
  242. "MCU_STM32L152RCY",
  243. "MCU_STM32L152RCA",
  244. "MCU_STM32L152VCA",
  245. "MCU_STM32L152QC",
  246. "MCU_STM32L152VC",
  247. "MCU_STM32L152xD",
  248. "MCU_STM32L152xE",
  249. "MCU_STM32L162RC",
  250. "MCU_STM32L162RCA",
  251. "MCU_STM32L162VC",
  252. "MCU_STM32L162VCA",
  253. "MCU_STM32L162QC",
  254. "MCU_STM32L162xD",
  255. "MCU_STM32L162xE",
  256. "MCU_LM3S9B96",
  257. "MCU_LPC1758",
  258. "MCU_LPC1768",
  259. "MCU_LPC1778",
  260. "MCU_MCF52259",
  261. "MCU_MCF51CN128",
  262. "MCU_ZERO"
  263. }
  264. avr_bit_choice = { " ", "0", "1", "2", "3", "4", "5", "6", "7" }
  265. avr_port_choice =
  266. {
  267. " ",
  268. "AVRPORTA",
  269. "AVRPORTB",
  270. "AVRPORTC",
  271. "AVRPORTD",
  272. "AVRPORTE",
  273. "AVRPORTF",
  274. "AVRPORTG",
  275. "AVRPORTH",
  276. "AVRPORTI",
  277. "AVRPORTJ",
  278. "AVRPORTK",
  279. "AVRPORTL"
  280. }
  281. avr_irq_choice = { " ", "INT0", "INT1", "INT2", "INT3", "INT4", "INT5", "INT6", "INT7" }
  282. iccavr_startup_choice = { "crtenutram", "crtenut", "crtnutram", "crtnut", "crtnutm256" }
  283. mcu_32bit_choice =
  284. {
  285. " ",
  286. "0", "1", "2", "3", "4", "5", "6", "7",
  287. "8", "9", "10", "11", "12", "13", "14", "15",
  288. "16", "17", "18", "19", "20", "21", "22", "23",
  289. "24", "25", "26", "27", "28", "29", "30", "31"
  290. }
  291. stm32_bit_choice =
  292. {
  293. " ",
  294. "0", "1", "2", "3", "4", "5", "6", "7",
  295. "8", "9", "10", "11", "12", "13", "14", "15"
  296. }
  297. mcf5_bit_choice = { " ",
  298. "0", "1", "2", "3", "4", "5", "6", "7" }
  299. gpio_port_choice =
  300. {
  301. " ",
  302. "NUTGPIO_PORTA",
  303. "NUTGPIO_PORTB",
  304. "NUTGPIO_PORTC",
  305. "NUTGPIO_PORTD",
  306. "NUTGPIO_PORTE",
  307. "NUTGPIO_PORTF",
  308. "NUTGPIO_PORTG",
  309. "NUTGPIO_PORTH",
  310. "NUTGPIO_PORTI",
  311. "NUTGPIO_PORTJ",
  312. "NUTGPIO_PORTK",
  313. "NUTGPIO_PORTL"
  314. }
  315. gpio_irq_choice =
  316. {
  317. " ",
  318. "NUTGPIO_EXTINT0",
  319. "NUTGPIO_EXTINT1",
  320. "NUTGPIO_EXTINT2",
  321. "NUTGPIO_EXTINT3",
  322. "NUTGPIO_EXTINT4",
  323. "NUTGPIO_EXTINT5",
  324. "NUTGPIO_EXTINT6",
  325. "NUTGPIO_EXTINT7"
  326. }
  327. at91_pio_id_choice = { " ", "PIO_ID", "PIOA_ID", "PIOB_ID", "PIOC_ID" }
  328. avr32_pio_id_choice = { " ", "PIO_ID", "PIOA_ID", "PIOB_ID", "PIOC_ID" }
  329. pll_clk_choice = { " ", "0", "1", "2", "3", "4" }
  330. hd44780_databits_choice = { " ", "0xFF", "0xF0", "0x0F" }
  331. pca9555_port_choice = { "IOXP_PORT0", "IOXP_PORT1" }
  332. pca9555_pin_choice = { " ", "0", "1", "2", "3", "4", "5", "6", "7" }
  333. --
  334. -- Check for custom configuration.
  335. --
  336. -- Executes custom/custom.nut, if it exists. This allows to extend the
  337. -- configuration without modifying any existing file.
  338. --
  339. -- For example, an application may provide its own file system driver.
  340. -- But mkdir, rmdir and similar function will become available only,
  341. -- if certain requirements are provided. This can be done by creating
  342. -- the file custom.nut with the following contents:
  343. --
  344. -- nutcustom =
  345. -- {
  346. -- {
  347. -- name = "nutcustom_cfs",
  348. -- brief = "CFS",
  349. -- description = "Custom file system driver.",
  350. -- provides = {
  351. -- "NUT_FS",
  352. -- "NUT_FS_READ",
  353. -- "NUT_FS_WRITE",
  354. -- "NUT_FS_DIR"
  355. -- }
  356. -- }
  357. -- }
  358. --
  359. -- Developer's note: The custom directory is reserved for this kind of
  360. -- extensions and must not exist in the official repository. However,
  361. -- it may be included in specialized Nut/OS distributions.
  362. --
  363. function CheckCustomConfig()
  364. local fp
  365. fp = io.open(c_repo_path() .. "/custom/custom.nut", "r")
  366. if fp == nil then
  367. return {}
  368. end
  369. fp:close()
  370. return
  371. {
  372. name = "nutcustom",
  373. brief = "Custom Configuration",
  374. description = "Allows to add custom specific configuration items.\n",
  375. subdir = "custom",
  376. script = "custom/custom.nut"
  377. }
  378. end
  379. repository =
  380. {
  381. {
  382. name = "nutinfo",
  383. brief = "Hardware Platform",
  384. description = "Board specific settings.",
  385. options =
  386. {
  387. {
  388. macro = "PLATFORM",
  389. brief = "Platform Macro",
  390. description = "String constant identifying the target hardware used.\n\n"..
  391. "Examples are ETHERNUT1, ETHERNUT2 etc. "..
  392. "This string constant is passed as a macro definition to "..
  393. "the Makefiles and allows conditional compilation "..
  394. "depending on the hardware used.\n\n"..
  395. "If required, the lower case variant of this string will be used "..
  396. "as a source file name containing board specific functions. Such files "..
  397. "are located in directory arch/MCU/board.",
  398. provides = { "HW_TARGET_BOARD" },
  399. flavor = "booldata",
  400. file = "include/cfg/arch.h",
  401. makedefs = { "PLATFORM", "HWDEF+=-D$(PLATFORM)" }
  402. },
  403. {
  404. macro = "PLATFORM_SUB",
  405. brief = "User Platform Macro",
  406. description = "String constant identifying a user specific hardware that is based on the "..
  407. "PLATFORM macro above.\n\n"..
  408. "This macro can be used if a project is developed for different targets "..
  409. "that are based mainly on the same base project and hardware.\n\n"..
  410. "An example: You develop different EIR applications, same chip, same board, but "..
  411. "one with an OLED, another with an LC-display and a third without display but IR-remote\n\n"..
  412. "This string constant is passed as a macro definition to "..
  413. "the Makefiles and allows conditional compilation "..
  414. "depending on the hardware used.",
  415. flavor = "booldata",
  416. file = "include/cfg/arch.h",
  417. makedefs = { "SUBPLATFORM", "HWDEF+=-D$(SUBPLATFORM)" }
  418. },
  419. {
  420. macro = "NUT_INIT_BOARD",
  421. brief = "Board Initialization",
  422. description = "If selected, a board specific initialization function "..
  423. "is called before system initialization. At this time the C runtime "..
  424. "is basically available and all global and static variables "..
  425. "are set. However, kernel services like memory management, "..
  426. "timers, threads etc. are not available in this stage.\n\n"..
  427. "A related source file must be provided in the "..
  428. "arch/MCU/board/ directory, named after the PLATFORM macro.",
  429. requires = { "HW_TARGET_BOARD" },
  430. provides = { "HW_BOARD_SUPPORT" },
  431. flavor = "boolean",
  432. file = "include/cfg/arch.h",
  433. },
  434. {
  435. macro = "NUT_INIT_IDLE",
  436. brief = "Idle Initialization",
  437. description = "If selected, a board specific initialization function "..
  438. "is called at the beginning of the idle thread. At this time "..
  439. "heap memory management is available and even new threads may be "..
  440. "created. However, context switching will not work and timer "..
  441. "services (including time outs) are not available.\n\n"..
  442. "A related source file must be provided in the "..
  443. "arch/MCU/board/ directory, named after the PLATFORM macro.",
  444. requires = { "HW_TARGET_BOARD" },
  445. provides = { "HW_BOARD_SUPPORT" },
  446. flavor = "boolean",
  447. file = "include/cfg/arch.h",
  448. },
  449. {
  450. macro = "NUT_INIT_MAIN",
  451. brief = "Main Initialization",
  452. description = "If selected, a board specific initialization function "..
  453. "is called immediately before calling the application's main function. "..
  454. "At this time the system is fully functional.\n\n"..
  455. "A related source file must be provided in the "..
  456. "arch/MCU/board/ directory, named after the PLATFORM macro.",
  457. requires = { "HW_TARGET_BOARD" },
  458. provides = { "HW_BOARD_SUPPORT" },
  459. flavor = "boolean",
  460. file = "include/cfg/arch.h",
  461. }
  462. }
  463. },
  464. {
  465. name = "nuttools",
  466. brief = "Tools",
  467. description = "Tool selection.",
  468. script = "tools.nut"
  469. },
  470. {
  471. name = "nutarch",
  472. brief = "Architecture",
  473. description = "Target selection.",
  474. subdir = "arch",
  475. script = "arch/arch.nut"
  476. },
  477. {
  478. name = "nutos",
  479. brief = "RTOS Kernel",
  480. description = "Operating system core functions",
  481. requires = { "HW_TARGET" },
  482. subdir = "os",
  483. script = "os/os.nut"
  484. },
  485. {
  486. name = "nutdev",
  487. brief = "Device Drivers",
  488. description = "This library contains architecture independant...\n"..
  489. "... hardware device drivers, typically supporting external chips.\n"..
  490. "... device driver frameworks, which provide the hardware independant part of a driver\n"..
  491. "... helper routines, which are of general use for device drivers.",
  492. requires = { "HW_TARGET" },
  493. subdir = "dev",
  494. script = "dev/dev.nut"
  495. },
  496. {
  497. name = "nutc",
  498. brief = "C runtime (tool specific)",
  499. description = "Hardware independent C runtime",
  500. requires = { "HW_TARGET" },
  501. subdir = "c",
  502. script = "c/c.nut"
  503. },
  504. {
  505. name = "nutcrt",
  506. brief = "C runtime (target specific)",
  507. description = "Hardware dependent C runtime",
  508. requires = { "HW_TARGET" },
  509. subdir = "crt",
  510. script = "crt/crt.nut"
  511. },
  512. {
  513. name = "nutgorp",
  514. brief = "Gorp: Code snipped library",
  515. description = "Additional libraries and code snippets used all around in NutOS and application code",
  516. requires = { "HW_TARGET" },
  517. subdir = "gorp",
  518. script = "gorp/gorp.nut"
  519. },
  520. {
  521. name = "nutnet",
  522. brief = "Network (general)",
  523. description = "Network functions",
  524. requires = { "HW_TARGET" },
  525. subdir = "net",
  526. script = "net/net.nut"
  527. },
  528. {
  529. name = "nutpro",
  530. brief = "Network (application layer)",
  531. description = "High level network protocols",
  532. requires = { "HW_TARGET" },
  533. subdir = "pro",
  534. script = "pro/pro.nut"
  535. },
  536. {
  537. name = "nutfs",
  538. brief = "File system",
  539. description = "File systems",
  540. requires = { "HW_TARGET" },
  541. subdir = "fs",
  542. script = "fs/fs.nut"
  543. },
  544. {
  545. name = "nutcpp",
  546. brief = "C++ runtime extensions",
  547. description = "C++ runtime extensions",
  548. requires = { "HW_TARGET", "TOOL_CXX" },
  549. subdir = "cpp",
  550. script = "cpp/cpp.nut"
  551. },
  552. {
  553. name = "nutlua",
  554. brief = "Lua Support",
  555. description = "Lua is a powerful, light-weight scripting language. "..
  556. "It offers good support for object-oriented, "..
  557. "functional as well as data-driven programming.\n\n"..
  558. "Currently available with the GNU compiler only.",
  559. requires = { "HW_TARGET" },
  560. subdir = "lua",
  561. script = "lua/lua.nut"
  562. },
  563. {
  564. name = "nutcrypto",
  565. brief = "Cryptographic library",
  566. description = "Cryptographic functions, needed to TLS support",
  567. requires = { "HW_TARGET" },
  568. subdir = "crypto",
  569. script = "crypto/crypto.nut"
  570. },
  571. {
  572. name = "nuttls",
  573. brief = "TLS library",
  574. description = "TLS client and server library. Needs libcrypto",
  575. requires = { "HW_TARGET" },
  576. subdir = "tls",
  577. script = "tls/tls.nut"
  578. },
  579. {
  580. name = "nutcontrib",
  581. brief = "Non-BSDL Code",
  582. description = "Packages in this module are not released under BSD license.\n"..
  583. "More restrictive licenses are acceptable here, but extra effort"..
  584. "is demanded of anyone using the code for commercial purposes.",
  585. requires = { "HW_TARGET" },
  586. subdir = "contrib",
  587. script = "contrib/contrib.nut"
  588. },
  589. CheckCustomConfig()
  590. }
  591. --
  592. -- Read first 8 kBytes from C source file.
  593. --
  594. function GetSourceFileHead(source_path)
  595. local fp, buf
  596. -- Retrieve the repository path by calling a C function provided
  597. -- by the Configurator and read the first 8k of the file.
  598. fp = io.open(c_repo_path() .. "/../" .. source_path, "r")
  599. if fp ~= nil then
  600. buf = fp:read(8192)
  601. fp:close()
  602. end
  603. return buf
  604. end
  605. --
  606. -- Read OS Version from C source file.
  607. --
  608. -- First version of a dynamic item:
  609. -- The string contains a Lua script, which is compiled and executed by the Configurator.
  610. -- This version is deprecated.
  611. -- brief = "--\n".. -- Strings starting with this sequence are executed.
  612. -- "return 'Nut/OS ' .. GetNutOsVersion()\n", -- This is the executed script.
  613. -- Second version of a dynamic item:
  614. -- A function result is combined with a static string. Note, that the function
  615. -- is executed when this script file is loaded and must have been defined
  616. -- previously.
  617. -- brief = "Nut/OS " .. GetNutOsVersion(),
  618. -- Third version of a dynamic item:
  619. -- The value is specified as a function returning a string. In this case any function
  620. -- used in our function body may be defined later.
  621. --
  622. function GetNutOsVersion()
  623. local buf, p1, p2, vers, subvers
  624. -- Try to read the version from a string in os/version.c.
  625. -- This worked until 4.9.7.
  626. buf = GetSourceFileHead("os/version.c")
  627. if buf ~= nil then
  628. p1, p2, vers = string.find(buf, "os_version_string.+\"(.+)\"")
  629. end
  630. -- If this doesn't work, we may have 4.9.8 or later.
  631. -- We will find the hex coded version in include/sys/version.h.
  632. if vers == nil then
  633. buf = GetSourceFileHead("include/sys/version.h")
  634. p1, p2, vers = string.find(buf, "NUT_VERSION_MAJOR%s+(%d+)")
  635. if vers == nil then
  636. vers = "?"
  637. end
  638. vers = vers .. "."
  639. p1, p2, subvers = string.find(buf, "NUT_VERSION_MINOR%s+(%d+)")
  640. if subvers == nil then
  641. subvers = "?"
  642. end
  643. vers = vers .. subvers .. "."
  644. p1, p2, subvers = string.find(buf, "NUT_VERSION_RELEASE%s+(%d+)")
  645. if subvers == nil then
  646. subvers = "?"
  647. end
  648. vers = vers .. subvers .. "."
  649. p1, p2, subvers = string.find(buf, "NUT_VERSION_BUILD%s+(%d+)")
  650. if subvers == nil then
  651. subvers = "?"
  652. end
  653. vers = vers .. subvers
  654. end
  655. return vers or "Unknown"
  656. end
  657. --
  658. -- Retrieve platform specific GPIO banks.
  659. --
  660. function GetGpioBanks()
  661. if c_is_provided("HW_MCU_AVR") then
  662. return GetAvrPorts()
  663. end
  664. if c_is_provided("HW_MCU_AT91") then
  665. if c_is_provided("HW_MCU_AT91R40008") then
  666. return { " " }
  667. else
  668. return { " ", "NUTGPIO_PORTA", "NUTGPIO_PORTB", "NUTGPIO_PORTC" }
  669. end
  670. end
  671. if c_is_provided("HW_MCU_AVR32") then
  672. return GetAvr32PioIds()
  673. end
  674. if c_is_provided("HW_MCU_STM32") then
  675. return GetStm32PioIds()
  676. end
  677. if c_is_provided("HW_MCU_LPC17xx") then
  678. return GetLpc17xxPioIds()
  679. end;
  680. return gpio_port_choice
  681. end
  682. --
  683. -- Retrieve platform specific GPIO port IDs.
  684. --
  685. function GetGpioPortIds()
  686. if c_is_provided("HW_MCU_AVR") then
  687. return avr_port_choice
  688. end
  689. if c_is_provided("HW_MCU_AT91") then
  690. return at91_pio_id_choice
  691. end
  692. if c_is_provided("HW_MCU_AVR32") then
  693. return GetAvr32PioIds()
  694. end
  695. if c_is_provided("HW_MCU_STM32") then
  696. return GetStm32PioIds()
  697. end
  698. if c_is_provided("HW_MCU_LPC17xx") then
  699. return GetLpc17xxPioIds()
  700. end;
  701. if c_is_provided("HW_MCU_COLDFIRE") then
  702. return GetColdfirePioIds()
  703. end;
  704. return { " " }
  705. end
  706. --
  707. -- Retrieve AT91 PIO IDs.
  708. --
  709. function GetAt91PioIds()
  710. if c_is_provided("HW_MCU_AT91R40008") then
  711. return { " ", "PIO_ID" }
  712. end
  713. return { " ", "PIOA_ID", "PIOB_ID", "PIOC_ID" }
  714. end
  715. --
  716. -- Retrieve AVR32 PIO IDs.
  717. --
  718. function GetAvr32PioIds()
  719. return { " ", "PIOA_ID", "PIOB_ID", "PIOC_ID", "PIOD_ID" }
  720. end
  721. --
  722. -- Retrieve STM32 PIO struct pointers.
  723. -- These IDs represet an struct pointer value of the port.
  724. --
  725. function GetStm32Pio()
  726. return { " ", "GPIOA", "GPIOB", "GPIOC", "GPIOD", "GPIOE", "GPIOF", "GPIOG" }
  727. end
  728. --
  729. -- Retrieve STM32 PIO IDs.
  730. -- These IDs represet an struct pointer value of the port.
  731. --
  732. function GetStm32PioIds()
  733. return {
  734. " ",
  735. "NUTGPIO_PORTA",
  736. "NUTGPIO_PORTB",
  737. "NUTGPIO_PORTC",
  738. "NUTGPIO_PORTD",
  739. "NUTGPIO_PORTE",
  740. "NUTGPIO_PORTF",
  741. "NUTGPIO_PORTG",
  742. }
  743. end
  744. --
  745. -- Retrieve STM32 PIO Base.
  746. -- These IDs represet an uint32_t value of the base address of the port.
  747. --
  748. function GetStm32PioBase()
  749. return { " ", "GPIOA_BASE", "GPIOB_BASE", "GPIOC_BASE", "GPIOD_BASE", "GPIOE_BASE", "GPIOF_BASE", "GPIOG_BASE" }
  750. end
  751. --
  752. -- Retrieve LPC17xx PIO IDs.
  753. -- These IDs represet an struct pointer value of the port.
  754. --
  755. function GetLpc17xxPioIds()
  756. return {
  757. " ",
  758. "NUTGPIO_PORT0",
  759. "NUTGPIO_PORT1",
  760. "NUTGPIO_PORT2",
  761. "NUTGPIO_PORT3",
  762. "NUTGPIO_PORT4",
  763. "NUTGPIO_PORT5",
  764. }
  765. end
  766. --
  767. -- Retrieve COLDFIRE PIO IDs.
  768. -- These IDs represet an struct pointer value of the port.
  769. --
  770. function GetColdfirePioIds()
  771. if c_is_provided("HW_MCU_MCF5225X") then
  772. return {
  773. " ",
  774. "PORTTE",
  775. "PORTTF",
  776. "PORTTG",
  777. "PORTTH",
  778. "PORTTI",
  779. "PORTTJ",
  780. "PORTNQ",
  781. "PORTAN",
  782. "PORTAS",
  783. "PORTQS",
  784. "PORTTA",
  785. "PORTTC",
  786. "PORTUA",
  787. "PORTUB",
  788. "PORTUC",
  789. "PORTDD",
  790. }
  791. end
  792. if c_is_provided("HW_MCU_MCF51CN") then
  793. return {
  794. " ",
  795. "PORTA",
  796. "PORTB",
  797. "PORTC",
  798. "PORTD",
  799. "PORTE",
  800. "PORTF",
  801. "PORTG",
  802. "PORTH",
  803. "PORTJ",
  804. }
  805. end
  806. return { " " }
  807. end
  808. --
  809. -- Retrieve AVR Port IDs.
  810. --
  811. function GetAvrPorts()
  812. if c_is_provided("HW_MCU_ATMEGA103") then
  813. return { " ", "AVRPORTA", "AVRPORTB", "AVRPORTC", "AVRPORTD", "AVRPORTE", "AVRPORTF" }
  814. end
  815. if c_is_provided("HW_MCU_ATMEGA128") then
  816. return { " ", "AVRPORTA", "AVRPORTB", "AVRPORTC", "AVRPORTD", "AVRPORTE", "AVRPORTF", "AVRPORTG" }
  817. end
  818. return avr_port_choice
  819. end
  820. --
  821. -- Retrieve IOExpander specific Ports bits.
  822. --
  823. function GetIoxpPorts()
  824. if c_is_provided("DEV_IOEXP") then
  825. return pca9555_port_choice
  826. end
  827. return { " " }
  828. end
  829. --
  830. -- Retrieve IOExpander specific GPIO bits.
  831. --
  832. function GetIoxpBits()
  833. if c_is_provided("DEV_IOEXP") then
  834. return pca9555_pin_choice
  835. end
  836. return { " " }
  837. end
  838. --
  839. -- Retrieve platform specific GPIO bits.
  840. --
  841. function GetGpioBits()
  842. if c_is_provided("HW_MCU_AVR") then
  843. return avr_bit_choice
  844. end
  845. if c_is_provided("HW_MCU_STM32") then
  846. return stm32_bit_choice
  847. end
  848. if c_is_provided("HW_MCU_COLDFIRE") then
  849. return mcf5_bit_choice
  850. end
  851. return mcu_32bit_choice
  852. end
  853. --
  854. -- Retrieve platform specific GPIO header path.
  855. --
  856. function GetGpioHeaderPath()
  857. local basepath
  858. basepath = "include/cfg/arch/"
  859. if c_is_provided("HW_MCU_AVR") then
  860. return basepath .. "avrpio.h"
  861. end
  862. if c_is_provided("HW_MCU_ARM") then
  863. return basepath .. "armpio.h"
  864. end
  865. if c_is_provided("HW_MCU_AVR32") then
  866. return basepath .. "avr32pio.h"
  867. end
  868. if c_is_provided("HW_MCU_LPC17xx") then
  869. return basepath .. "lpc17xxpio.h"
  870. end
  871. if c_is_provided("HW_MCU_STM32") then
  872. return basepath .. "stm32pio.h"
  873. end
  874. if c_is_provided("HW_MCU_COLDFIRE") then
  875. return basepath .. "mcf5pio.h"
  876. end
  877. return basepath .. "pio.h"
  878. end
  879. --
  880. -- Retrieve platform specific GPIO Special Functions
  881. --
  882. function GetAlternativePinsets()
  883. return { "ALTERNATE_PIN_SET1", "ALTERNATE_PIN_SET2", "ALTERNATE_PIN_SET3" }
  884. end