halconf.h.ftl 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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="halconf.h" /]
  20. /*
  21. [@license.EmitLicenseAsText /]
  22. */
  23. /**
  24. * @file templates/halconf.h
  25. * @brief HAL configuration header.
  26. * @details HAL configuration file, this file allows to enable or disable the
  27. * various device drivers from your application. You may also use
  28. * this file in order to override the device drivers default settings.
  29. *
  30. * @addtogroup HAL_CONF
  31. * @{
  32. */
  33. #ifndef HALCONF_H
  34. #define HALCONF_H
  35. #define _CHIBIOS_HAL_CONF_
  36. #define _CHIBIOS_HAL_CONF_VER_7_0_
  37. #include "mcuconf.h"
  38. /**
  39. * @brief Enables the PAL subsystem.
  40. */
  41. #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
  42. #define HAL_USE_PAL ${doc.HAL_USE_PAL!"TRUE"}
  43. #endif
  44. /**
  45. * @brief Enables the ADC subsystem.
  46. */
  47. #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
  48. #define HAL_USE_ADC ${doc.HAL_USE_ADC!"FALSE"}
  49. #endif
  50. /**
  51. * @brief Enables the CAN subsystem.
  52. */
  53. #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
  54. #define HAL_USE_CAN ${doc.HAL_USE_CAN!"FALSE"}
  55. #endif
  56. /**
  57. * @brief Enables the cryptographic subsystem.
  58. */
  59. #if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
  60. #define HAL_USE_CRY ${doc.HAL_USE_CRY!"FALSE"}
  61. #endif
  62. /**
  63. * @brief Enables the DAC subsystem.
  64. */
  65. #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
  66. #define HAL_USE_DAC ${doc.HAL_USE_DAC!"FALSE"}
  67. #endif
  68. /**
  69. * @brief Enables the GPT subsystem.
  70. */
  71. #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
  72. #define HAL_USE_GPT ${doc.HAL_USE_GPT!"FALSE"}
  73. #endif
  74. /**
  75. * @brief Enables the I2C subsystem.
  76. */
  77. #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
  78. #define HAL_USE_I2C ${doc.HAL_USE_I2C!"FALSE"}
  79. #endif
  80. /**
  81. * @brief Enables the I2S subsystem.
  82. */
  83. #if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
  84. #define HAL_USE_I2S ${doc.HAL_USE_I2S!"FALSE"}
  85. #endif
  86. /**
  87. * @brief Enables the ICU subsystem.
  88. */
  89. #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
  90. #define HAL_USE_ICU ${doc.HAL_USE_ICU!"FALSE"}
  91. #endif
  92. /**
  93. * @brief Enables the MAC subsystem.
  94. */
  95. #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
  96. #define HAL_USE_MAC ${doc.HAL_USE_MAC!"FALSE"}
  97. #endif
  98. /**
  99. * @brief Enables the MMC_SPI subsystem.
  100. */
  101. #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
  102. #define HAL_USE_MMC_SPI ${doc.HAL_USE_MMC_SPI!"FALSE"}
  103. #endif
  104. /**
  105. * @brief Enables the PWM subsystem.
  106. */
  107. #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
  108. #define HAL_USE_PWM ${doc.HAL_USE_PWM!"FALSE"}
  109. #endif
  110. /**
  111. * @brief Enables the RTC subsystem.
  112. */
  113. #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
  114. #define HAL_USE_RTC ${doc.HAL_USE_RTC!"FALSE"}
  115. #endif
  116. /**
  117. * @brief Enables the SDC subsystem.
  118. */
  119. #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
  120. #define HAL_USE_SDC ${doc.HAL_USE_SDC!"FALSE"}
  121. #endif
  122. /**
  123. * @brief Enables the SERIAL subsystem.
  124. */
  125. #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
  126. #define HAL_USE_SERIAL ${doc.HAL_USE_SERIAL!"TRUE"}
  127. #endif
  128. /**
  129. * @brief Enables the SERIAL over USB subsystem.
  130. */
  131. #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
  132. #define HAL_USE_SERIAL_USB ${doc.HAL_USE_SERIAL_USB!"FALSE"}
  133. #endif
  134. /**
  135. * @brief Enables the SIO subsystem.
  136. */
  137. #if !defined(HAL_USE_SIO) || defined(__DOXYGEN__)
  138. #define HAL_USE_SIO ${doc.HAL_USE_SIO!"FALSE"}
  139. #endif
  140. /**
  141. * @brief Enables the SPI subsystem.
  142. */
  143. #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
  144. #define HAL_USE_SPI ${doc.HAL_USE_SPI!"FALSE"}
  145. #endif
  146. /**
  147. * @brief Enables the TRNG subsystem.
  148. */
  149. #if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__)
  150. #define HAL_USE_TRNG ${doc.HAL_USE_TRNG!"FALSE"}
  151. #endif
  152. /**
  153. * @brief Enables the UART subsystem.
  154. */
  155. #if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
  156. #define HAL_USE_UART ${doc.HAL_USE_UART!"FALSE"}
  157. #endif
  158. /**
  159. * @brief Enables the USB subsystem.
  160. */
  161. #if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
  162. #define HAL_USE_USB ${doc.HAL_USE_USB!"FALSE"}
  163. #endif
  164. /**
  165. * @brief Enables the WDG subsystem.
  166. */
  167. #if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
  168. #define HAL_USE_WDG ${doc.HAL_USE_WDG!"FALSE"}
  169. #endif
  170. /**
  171. * @brief Enables the WSPI subsystem.
  172. */
  173. #if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__)
  174. #define HAL_USE_WSPI ${doc.HAL_USE_WSPI!"FALSE"}
  175. #endif
  176. /*===========================================================================*/
  177. /* PAL driver related settings. */
  178. /*===========================================================================*/
  179. /**
  180. * @brief Enables synchronous APIs.
  181. * @note Disabling this option saves both code and data space.
  182. */
  183. #if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__)
  184. #define PAL_USE_CALLBACKS ${doc.PAL_USE_CALLBACKS!"FALSE"}
  185. #endif
  186. /**
  187. * @brief Enables synchronous APIs.
  188. * @note Disabling this option saves both code and data space.
  189. */
  190. #if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__)
  191. #define PAL_USE_WAIT ${doc.PAL_USE_WAIT!"FALSE"}
  192. #endif
  193. /*===========================================================================*/
  194. /* ADC driver related settings. */
  195. /*===========================================================================*/
  196. /**
  197. * @brief Enables synchronous APIs.
  198. * @note Disabling this option saves both code and data space.
  199. */
  200. #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
  201. #define ADC_USE_WAIT ${doc.ADC_USE_WAIT!"TRUE"}
  202. #endif
  203. /**
  204. * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
  205. * @note Disabling this option saves both code and data space.
  206. */
  207. #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  208. #define ADC_USE_MUTUAL_EXCLUSION ${doc.ADC_USE_MUTUAL_EXCLUSION!"TRUE"}
  209. #endif
  210. /*===========================================================================*/
  211. /* CAN driver related settings. */
  212. /*===========================================================================*/
  213. /**
  214. * @brief Sleep mode related APIs inclusion switch.
  215. */
  216. #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
  217. #define CAN_USE_SLEEP_MODE ${doc.CAN_USE_SLEEP_MODE!"TRUE"}
  218. #endif
  219. /**
  220. * @brief Enforces the driver to use direct callbacks rather than OSAL events.
  221. */
  222. #if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__)
  223. #define CAN_ENFORCE_USE_CALLBACKS ${doc.CAN_ENFORCE_USE_CALLBACKS!"FALSE"}
  224. #endif
  225. /*===========================================================================*/
  226. /* CRY driver related settings. */
  227. /*===========================================================================*/
  228. /**
  229. * @brief Enables the SW fall-back of the cryptographic driver.
  230. * @details When enabled, this option, activates a fall-back software
  231. * implementation for algorithms not supported by the underlying
  232. * hardware.
  233. * @note Fall-back implementations may not be present for all algorithms.
  234. */
  235. #if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__)
  236. #define HAL_CRY_USE_FALLBACK ${doc.HAL_CRY_USE_FALLBACK!"FALSE"}
  237. #endif
  238. /**
  239. * @brief Makes the driver forcibly use the fall-back implementations.
  240. */
  241. #if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__)
  242. #define HAL_CRY_ENFORCE_FALLBACK ${doc.HAL_CRY_ENFORCE_FALLBACK!"FALSE"}
  243. #endif
  244. /*===========================================================================*/
  245. /* DAC driver related settings. */
  246. /*===========================================================================*/
  247. /**
  248. * @brief Enables synchronous APIs.
  249. * @note Disabling this option saves both code and data space.
  250. */
  251. #if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__)
  252. #define DAC_USE_WAIT ${doc.DAC_USE_WAIT!"TRUE"}
  253. #endif
  254. /**
  255. * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs.
  256. * @note Disabling this option saves both code and data space.
  257. */
  258. #if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  259. #define DAC_USE_MUTUAL_EXCLUSION ${doc.DAC_USE_MUTUAL_EXCLUSION!"TRUE"}
  260. #endif
  261. /*===========================================================================*/
  262. /* I2C driver related settings. */
  263. /*===========================================================================*/
  264. /**
  265. * @brief Enables the mutual exclusion APIs on the I2C bus.
  266. */
  267. #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  268. #define I2C_USE_MUTUAL_EXCLUSION ${doc.I2C_USE_MUTUAL_EXCLUSION!"TRUE"}
  269. #endif
  270. /*===========================================================================*/
  271. /* MAC driver related settings. */
  272. /*===========================================================================*/
  273. /**
  274. * @brief Enables the zero-copy API.
  275. */
  276. #if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
  277. #define MAC_USE_ZERO_COPY ${doc.MAC_USE_ZERO_COPY!"FALSE"}
  278. #endif
  279. /**
  280. * @brief Enables an event sources for incoming packets.
  281. */
  282. #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
  283. #define MAC_USE_EVENTS ${doc.MAC_USE_EVENTS!"FALSE"}
  284. #endif
  285. /*===========================================================================*/
  286. /* MMC_SPI driver related settings. */
  287. /*===========================================================================*/
  288. /**
  289. * @brief Delays insertions.
  290. * @details If enabled this options inserts delays into the MMC waiting
  291. * routines releasing some extra CPU time for the threads with
  292. * lower priority, this may slow down the driver a bit however.
  293. * This option is recommended also if the SPI driver does not
  294. * use a DMA channel and heavily loads the CPU.
  295. */
  296. #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
  297. #define MMC_NICE_WAITING ${doc.MMC_NICE_WAITING!"TRUE"}
  298. #endif
  299. /*===========================================================================*/
  300. /* SDC driver related settings. */
  301. /*===========================================================================*/
  302. /**
  303. * @brief Number of initialization attempts before rejecting the card.
  304. * @note Attempts are performed at 10mS intervals.
  305. */
  306. #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
  307. #define SDC_INIT_RETRY ${doc.SDC_INIT_RETRY!"100"}
  308. #endif
  309. /**
  310. * @brief Include support for MMC cards.
  311. * @note MMC support is not yet implemented so this option must be kept
  312. * at @p FALSE.
  313. */
  314. #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
  315. #define SDC_MMC_SUPPORT ${doc.SDC_MMC_SUPPORT!"FALSE"}
  316. #endif
  317. /**
  318. * @brief Delays insertions.
  319. * @details If enabled this options inserts delays into the MMC waiting
  320. * routines releasing some extra CPU time for the threads with
  321. * lower priority, this may slow down the driver a bit however.
  322. */
  323. #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
  324. #define SDC_NICE_WAITING ${doc.SDC_NICE_WAITING!"TRUE"}
  325. #endif
  326. /**
  327. * @brief OCR initialization constant for V20 cards.
  328. */
  329. #if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__)
  330. #define SDC_INIT_OCR_V20 ${doc.SDC_INIT_OCR_V20!"0x50FF8000U"}
  331. #endif
  332. /**
  333. * @brief OCR initialization constant for non-V20 cards.
  334. */
  335. #if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__)
  336. #define SDC_INIT_OCR ${doc.SDC_INIT_OCR!"0x80100000U"}
  337. #endif
  338. /*===========================================================================*/
  339. /* SERIAL driver related settings. */
  340. /*===========================================================================*/
  341. /**
  342. * @brief Default bit rate.
  343. * @details Configuration parameter, this is the baud rate selected for the
  344. * default configuration.
  345. */
  346. #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
  347. #define SERIAL_DEFAULT_BITRATE ${doc.SERIAL_DEFAULT_BITRATE!"38400"}
  348. #endif
  349. /**
  350. * @brief Serial buffers size.
  351. * @details Configuration parameter, you can change the depth of the queue
  352. * buffers depending on the requirements of your application.
  353. * @note The default is 16 bytes for both the transmission and receive
  354. * buffers.
  355. */
  356. #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
  357. #define SERIAL_BUFFERS_SIZE ${doc.SERIAL_BUFFERS_SIZE!"16"}
  358. #endif
  359. /*===========================================================================*/
  360. /* SERIAL_USB driver related setting. */
  361. /*===========================================================================*/
  362. /**
  363. * @brief Serial over USB buffers size.
  364. * @details Configuration parameter, the buffer size must be a multiple of
  365. * the USB data endpoint maximum packet size.
  366. * @note The default is 256 bytes for both the transmission and receive
  367. * buffers.
  368. */
  369. #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
  370. #define SERIAL_USB_BUFFERS_SIZE ${doc.SERIAL_USB_BUFFERS_SIZE!"256"}
  371. #endif
  372. /**
  373. * @brief Serial over USB number of buffers.
  374. * @note The default is 2 buffers.
  375. */
  376. #if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
  377. #define SERIAL_USB_BUFFERS_NUMBER ${doc.SERIAL_USB_BUFFERS_NUMBER!"2"}
  378. #endif
  379. /*===========================================================================*/
  380. /* SPI driver related settings. */
  381. /*===========================================================================*/
  382. /**
  383. * @brief Enables synchronous APIs.
  384. * @note Disabling this option saves both code and data space.
  385. */
  386. #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
  387. #define SPI_USE_WAIT ${doc.SPI_USE_WAIT!"TRUE"}
  388. #endif
  389. /**
  390. * @brief Enables circular transfers APIs.
  391. * @note Disabling this option saves both code and data space.
  392. */
  393. #if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__)
  394. #define SPI_USE_CIRCULAR ${doc.SPI_USE_CIRCULAR!"FALSE"}
  395. #endif
  396. /**
  397. * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
  398. * @note Disabling this option saves both code and data space.
  399. */
  400. #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  401. #define SPI_USE_MUTUAL_EXCLUSION ${doc.SPI_USE_MUTUAL_EXCLUSION!"TRUE"}
  402. #endif
  403. /**
  404. * @brief Handling method for SPI CS line.
  405. * @note Disabling this option saves both code and data space.
  406. */
  407. #if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__)
  408. #define SPI_SELECT_MODE ${doc.SPI_SELECT_MODE!"SPI_SELECT_MODE_PAD"}
  409. #endif
  410. /*===========================================================================*/
  411. /* UART driver related settings. */
  412. /*===========================================================================*/
  413. /**
  414. * @brief Enables synchronous APIs.
  415. * @note Disabling this option saves both code and data space.
  416. */
  417. #if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
  418. #define UART_USE_WAIT ${doc.UART_USE_WAIT!"FALSE"}
  419. #endif
  420. /**
  421. * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
  422. * @note Disabling this option saves both code and data space.
  423. */
  424. #if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  425. #define UART_USE_MUTUAL_EXCLUSION ${doc.UART_USE_MUTUAL_EXCLUSION!"FALSE"}
  426. #endif
  427. /*===========================================================================*/
  428. /* USB driver related settings. */
  429. /*===========================================================================*/
  430. /**
  431. * @brief Enables synchronous APIs.
  432. * @note Disabling this option saves both code and data space.
  433. */
  434. #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
  435. #define USB_USE_WAIT ${doc.USB_USE_WAIT!"FALSE"}
  436. #endif
  437. /*===========================================================================*/
  438. /* WSPI driver related settings. */
  439. /*===========================================================================*/
  440. /**
  441. * @brief Enables synchronous APIs.
  442. * @note Disabling this option saves both code and data space.
  443. */
  444. #if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__)
  445. #define WSPI_USE_WAIT ${doc.WSPI_USE_WAIT!"TRUE"}
  446. #endif
  447. /**
  448. * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs.
  449. * @note Disabling this option saves both code and data space.
  450. */
  451. #if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  452. #define WSPI_USE_MUTUAL_EXCLUSION ${doc.WSPI_USE_MUTUAL_EXCLUSION!"TRUE"}
  453. #endif
  454. #endif /* HALCONF_H */
  455. /** @} */