chconf.h.ftl 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. [#ftl]
  2. [#--
  3. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio.
  4. This file is part of ChibiOS.
  5. ChibiOS is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. ChibiOS is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. --]
  16. [@pp.dropOutputFile /]
  17. [#import "/@lib/libutils.ftl" as utils /]
  18. [#import "/@lib/liblicense.ftl" as license /]
  19. [@pp.changeOutputFile name="chconf.h" /]
  20. /*
  21. [@license.EmitLicenseAsText /]
  22. */
  23. /**
  24. * @file nil/templates/chconf.h
  25. * @brief Configuration file template.
  26. * @details A copy of this file must be placed in each project directory, it
  27. * contains the application specific kernel settings.
  28. *
  29. * @addtogroup NIL_CONFIG
  30. * @details Kernel related settings and hooks.
  31. * @{
  32. */
  33. #ifndef CHCONF_H
  34. #define CHCONF_H
  35. #define _CHIBIOS_NIL_CONF_
  36. #define _CHIBIOS_NIL_CONF_VER_3_2_
  37. /*===========================================================================*/
  38. /**
  39. * @name Kernel parameters and options
  40. * @{
  41. */
  42. /*===========================================================================*/
  43. /**
  44. * @brief Number of user threads in the application.
  45. * @note This number is not inclusive of the idle thread which is
  46. * Implicitly handled.
  47. */
  48. #define CH_CFG_NUM_THREADS ${doc.CH_CFG_NUM_THREADS!"1"}
  49. /** @} */
  50. /*===========================================================================*/
  51. /**
  52. * @name System timer settings
  53. * @{
  54. */
  55. /*===========================================================================*/
  56. /**
  57. * @brief System time counter resolution.
  58. * @note Allowed values are 16 or 32 bits.
  59. */
  60. #define CH_CFG_ST_RESOLUTION ${doc.CH_CFG_ST_RESOLUTION!"32"}
  61. /**
  62. * @brief System tick frequency.
  63. * @note This value together with the @p CH_CFG_ST_RESOLUTION
  64. * option defines the maximum amount of time allowed for
  65. * timeouts.
  66. */
  67. #define CH_CFG_ST_FREQUENCY ${doc.CH_CFG_ST_FREQUENCY!"1000"}
  68. /**
  69. * @brief Time delta constant for the tick-less mode.
  70. * @note If this value is zero then the system uses the classic
  71. * periodic tick. This value represents the minimum number
  72. * of ticks that is safe to specify in a timeout directive.
  73. * The value one is not valid, timeouts are rounded up to
  74. * this value.
  75. */
  76. #define CH_CFG_ST_TIMEDELTA ${doc.CH_CFG_ST_TIMEDELTA!"2"}
  77. /** @} */
  78. /*===========================================================================*/
  79. /**
  80. * @name Subsystem options
  81. * @{
  82. */
  83. /*===========================================================================*/
  84. /**
  85. * @brief Semaphores APIs.
  86. * @details If enabled then the Semaphores APIs are included in the kernel.
  87. *
  88. * @note The default is @p TRUE.
  89. */
  90. #define CH_CFG_USE_SEMAPHORES ${doc.CH_CFG_USE_SEMAPHORES!"TRUE"}
  91. /**
  92. * @brief Mutexes APIs.
  93. * @details If enabled then the mutexes APIs are included in the kernel.
  94. *
  95. * @note Feature not currently implemented.
  96. * @note The default is @p FALSE.
  97. */
  98. #define CH_CFG_USE_MUTEXES ${doc.CH_CFG_USE_MUTEXES!"FALSE"}
  99. /**
  100. * @brief Events Flags APIs.
  101. * @details If enabled then the event flags APIs are included in the kernel.
  102. *
  103. * @note The default is @p TRUE.
  104. */
  105. #define CH_CFG_USE_EVENTS ${doc.CH_CFG_USE_EVENTS!"TRUE"}
  106. /**
  107. * @brief Mailboxes APIs.
  108. * @details If enabled then the asynchronous messages (mailboxes) APIs are
  109. * included in the kernel.
  110. *
  111. * @note The default is @p TRUE.
  112. * @note Requires @p CH_CFG_USE_SEMAPHORES.
  113. */
  114. #define CH_CFG_USE_MAILBOXES ${doc.CH_CFG_USE_MAILBOXES!"TRUE"}
  115. /**
  116. * @brief Core Memory Manager APIs.
  117. * @details If enabled then the core memory manager APIs are included
  118. * in the kernel.
  119. *
  120. * @note The default is @p TRUE.
  121. */
  122. #define CH_CFG_USE_MEMCORE ${doc.CH_CFG_USE_MEMCORE!"TRUE"}
  123. /**
  124. * @brief Heap Allocator APIs.
  125. * @details If enabled then the memory heap allocator APIs are included
  126. * in the kernel.
  127. *
  128. * @note The default is @p TRUE.
  129. */
  130. #define CH_CFG_USE_HEAP ${doc.CH_CFG_USE_HEAP!"TRUE"}
  131. /**
  132. * @brief Memory Pools Allocator APIs.
  133. * @details If enabled then the memory pools allocator APIs are included
  134. * in the kernel.
  135. *
  136. * @note The default is @p TRUE.
  137. */
  138. #define CH_CFG_USE_MEMPOOLS ${doc.CH_CFG_USE_MEMPOOLS!"TRUE"}
  139. /**
  140. * @brief Objects FIFOs APIs.
  141. * @details If enabled then the objects FIFOs APIs are included
  142. * in the kernel.
  143. *
  144. * @note The default is @p TRUE.
  145. */
  146. #define CH_CFG_USE_OBJ_FIFOS ${doc.CH_CFG_USE_OBJ_FIFOS!"TRUE"}
  147. /**
  148. * @brief Pipes APIs.
  149. * @details If enabled then the pipes APIs are included
  150. * in the kernel.
  151. *
  152. * @note The default is @p TRUE.
  153. */
  154. #define CH_CFG_USE_PIPES ${doc.CH_CFG_USE_PIPES!"TRUE"}
  155. /**
  156. * @brief Managed RAM size.
  157. * @details Size of the RAM area to be managed by the OS. If set to zero
  158. * then the whole available RAM is used. The core memory is made
  159. * available to the heap allocator and/or can be used directly through
  160. * the simplified core memory allocator.
  161. *
  162. * @note In order to let the OS manage the whole RAM the linker script must
  163. * provide the @p __heap_base__ and @p __heap_end__ symbols.
  164. * @note Requires @p CH_CFG_USE_MEMCORE.
  165. */
  166. #define CH_CFG_MEMCORE_SIZE ${doc.CH_CFG_MEMCORE_SIZE!"0"}
  167. /** @} */
  168. /*===========================================================================*/
  169. /**
  170. * @name Objects factory options
  171. * @{
  172. */
  173. /*===========================================================================*/
  174. /**
  175. * @brief Objects Factory APIs.
  176. * @details If enabled then the objects factory APIs are included in the
  177. * kernel.
  178. *
  179. * @note The default is @p FALSE.
  180. */
  181. #define CH_CFG_USE_FACTORY ${doc.CH_CFG_USE_FACTORY!"TRUE"}
  182. /**
  183. * @brief Maximum length for object names.
  184. * @details If the specified length is zero then the name is stored by
  185. * pointer but this could have unintended side effects.
  186. */
  187. #define CH_CFG_FACTORY_MAX_NAMES_LENGTH ${doc.CH_CFG_FACTORY_MAX_NAMES_LENGTH!"8"}
  188. /**
  189. * @brief Enables the registry of generic objects.
  190. */
  191. #define CH_CFG_FACTORY_OBJECTS_REGISTRY ${doc.CH_CFG_FACTORY_OBJECTS_REGISTRY!"TRUE"}
  192. /**
  193. * @brief Enables factory for generic buffers.
  194. */
  195. #define CH_CFG_FACTORY_GENERIC_BUFFERS ${doc.CH_CFG_FACTORY_GENERIC_BUFFERS!"TRUE"}
  196. /**
  197. * @brief Enables factory for semaphores.
  198. */
  199. #define CH_CFG_FACTORY_SEMAPHORES ${doc.CH_CFG_FACTORY_SEMAPHORES!"TRUE"}
  200. /**
  201. * @brief Enables factory for mailboxes.
  202. */
  203. #define CH_CFG_FACTORY_MAILBOXES ${doc.CH_CFG_FACTORY_MAILBOXES!"TRUE"}
  204. /**
  205. * @brief Enables factory for objects FIFOs.
  206. */
  207. #define CH_CFG_FACTORY_OBJ_FIFOS ${doc.CH_CFG_FACTORY_OBJ_FIFOS!"TRUE"}
  208. /**
  209. * @brief Enables factory for Pipes.
  210. */
  211. #define CH_CFG_FACTORY_PIPES ${doc.CH_CFG_FACTORY_PIPES!"TRUE"}
  212. /** @} */
  213. /*===========================================================================*/
  214. /**
  215. * @name Debug options
  216. * @{
  217. */
  218. /*===========================================================================*/
  219. /**
  220. * @brief Debug option, kernel statistics.
  221. *
  222. * @note Feature not currently implemented.
  223. * @note The default is @p FALSE.
  224. */
  225. #define CH_DBG_STATISTICS ${doc.CH_DBG_STATISTICS!"FALSE"}
  226. /**
  227. * @brief Debug option, system state check.
  228. *
  229. * @note The default is @p FALSE.
  230. */
  231. #define CH_DBG_SYSTEM_STATE_CHECK ${doc.CH_DBG_SYSTEM_STATE_CHECK!"FALSE"}
  232. /**
  233. * @brief Debug option, parameters checks.
  234. *
  235. * @note The default is @p FALSE.
  236. */
  237. #define CH_DBG_ENABLE_CHECKS ${doc.CH_DBG_ENABLE_CHECKS!"FALSE"}
  238. /**
  239. * @brief System assertions.
  240. *
  241. * @note The default is @p FALSE.
  242. */
  243. #define CH_DBG_ENABLE_ASSERTS ${doc.CH_DBG_ENABLE_ASSERTS!"FALSE"}
  244. /**
  245. * @brief Stack check.
  246. *
  247. * @note The default is @p FALSE.
  248. */
  249. #define CH_DBG_ENABLE_STACK_CHECK ${doc.CH_DBG_ENABLE_STACK_CHECK!"FALSE"}
  250. /** @} */
  251. /*===========================================================================*/
  252. /**
  253. * @name Kernel hooks
  254. * @{
  255. */
  256. /*===========================================================================*/
  257. /**
  258. * @brief System initialization hook.
  259. */
  260. #if !defined(CH_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__)
  261. #define CH_CFG_SYSTEM_INIT_HOOK() { \
  262. }
  263. #endif
  264. /**
  265. * @brief Threads descriptor structure extension.
  266. * @details User fields added to the end of the @p thread_t structure.
  267. */
  268. #define CH_CFG_THREAD_EXT_FIELDS \
  269. /* Add threads custom fields here.*/
  270. /**
  271. * @brief Threads initialization hook.
  272. */
  273. #define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
  274. /* Add custom threads initialization code here.*/ \
  275. }
  276. /**
  277. * @brief Idle thread enter hook.
  278. * @note This hook is invoked within a critical zone, no OS functions
  279. * should be invoked from here.
  280. * @note This macro can be used to activate a power saving mode.
  281. */
  282. #define CH_CFG_IDLE_ENTER_HOOK() { \
  283. }
  284. /**
  285. * @brief Idle thread leave hook.
  286. * @note This hook is invoked within a critical zone, no OS functions
  287. * should be invoked from here.
  288. * @note This macro can be used to deactivate a power saving mode.
  289. */
  290. #define CH_CFG_IDLE_LEAVE_HOOK() { \
  291. }
  292. /**
  293. * @brief System halt hook.
  294. */
  295. #if !defined(CH_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
  296. #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
  297. }
  298. #endif
  299. /** @} */
  300. /*===========================================================================*/
  301. /* Port-specific settings (override port settings defaulted in nilcore.h). */
  302. /*===========================================================================*/
  303. #endif /* CHCONF_H */
  304. /** @} */