halconf.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. /*
  2. ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file templates/halconf.h
  15. * @brief HAL configuration header.
  16. * @details HAL configuration file, this file allows to enable or disable the
  17. * various device drivers from your application. You may also use
  18. * this file in order to override the device drivers default settings.
  19. *
  20. * @addtogroup HAL_CONF
  21. * @{
  22. */
  23. #ifndef HALCONF_H
  24. #define HALCONF_H
  25. #include "mcuconf.h"
  26. /**
  27. * @brief Enables the PAL subsystem.
  28. */
  29. #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
  30. #define HAL_USE_PAL TRUE
  31. #endif
  32. /**
  33. * @brief Enables the ADC subsystem.
  34. */
  35. #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
  36. #define HAL_USE_ADC FALSE
  37. #endif
  38. /**
  39. * @brief Enables the CAN subsystem.
  40. */
  41. #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
  42. #define HAL_USE_CAN FALSE
  43. #endif
  44. /**
  45. * @brief Enables the DAC subsystem.
  46. */
  47. #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
  48. #define HAL_USE_DAC TRUE
  49. #endif
  50. /**
  51. * @brief Enables the EXT subsystem.
  52. */
  53. #if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
  54. #define HAL_USE_EXT FALSE
  55. #endif
  56. /**
  57. * @brief Enables the GPT subsystem.
  58. */
  59. #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
  60. #define HAL_USE_GPT TRUE
  61. #endif
  62. /**
  63. * @brief Enables the I2C subsystem.
  64. */
  65. #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
  66. #define HAL_USE_I2C TRUE
  67. #endif
  68. /**
  69. * @brief Enables the I2C Slave subsystem.
  70. */
  71. #if !defined(HAL_USE_I2C_SLAVE) || defined(__DOXYGEN__)
  72. #define HAL_USE_I2C_SLAVE TRUE
  73. #endif
  74. /**
  75. * @brief Enables the I2S subsystem.
  76. */
  77. #if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
  78. #define HAL_USE_I2S FALSE
  79. #endif
  80. /**
  81. * @brief Enables the ICU subsystem.
  82. */
  83. #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
  84. #define HAL_USE_ICU FALSE
  85. #endif
  86. /**
  87. * @brief Enables the MAC subsystem.
  88. */
  89. #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
  90. #define HAL_USE_MAC FALSE
  91. #endif
  92. /**
  93. * @brief Enables the MMC_SPI subsystem.
  94. */
  95. #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
  96. #define HAL_USE_MMC_SPI FALSE
  97. #endif
  98. /**
  99. * @brief Enables the PWM subsystem.
  100. */
  101. #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
  102. #define HAL_USE_PWM FALSE
  103. #endif
  104. /**
  105. * @brief Enables the QSPI subsystem.
  106. */
  107. #if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
  108. #define HAL_USE_QSPI FALSE
  109. #endif
  110. /**
  111. * @brief Enables the RTC subsystem.
  112. */
  113. #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
  114. #define 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 FALSE
  121. #endif
  122. /**
  123. * @brief Enables the SERIAL subsystem.
  124. */
  125. #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
  126. #define HAL_USE_SERIAL FALSE
  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 TRUE
  133. #endif
  134. /**
  135. * @brief Enables the SPI subsystem.
  136. */
  137. #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
  138. #define HAL_USE_SPI FALSE
  139. #endif
  140. /**
  141. * @brief Enables the UART subsystem.
  142. */
  143. #if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
  144. #define HAL_USE_UART FALSE
  145. #endif
  146. /**
  147. * @brief Enables the USB subsystem.
  148. */
  149. #if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
  150. #define HAL_USE_USB TRUE
  151. #endif
  152. /**
  153. * @brief Enables the WDG subsystem.
  154. */
  155. #if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
  156. #define HAL_USE_WDG FALSE
  157. #endif
  158. /*===========================================================================*/
  159. /* ADC driver related settings. */
  160. /*===========================================================================*/
  161. /**
  162. * @brief Enables synchronous APIs.
  163. * @note Disabling this option saves both code and data space.
  164. */
  165. #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
  166. #define ADC_USE_WAIT TRUE
  167. #endif
  168. /**
  169. * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
  170. * @note Disabling this option saves both code and data space.
  171. */
  172. #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  173. #define ADC_USE_MUTUAL_EXCLUSION TRUE
  174. #endif
  175. /*===========================================================================*/
  176. /* CAN driver related settings. */
  177. /*===========================================================================*/
  178. /**
  179. * @brief Sleep mode related APIs inclusion switch.
  180. */
  181. #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
  182. #define CAN_USE_SLEEP_MODE TRUE
  183. #endif
  184. /*===========================================================================*/
  185. /* I2C driver related settings. */
  186. /*===========================================================================*/
  187. /**
  188. * @brief Enables the mutual exclusion APIs on the I2C bus.
  189. */
  190. #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  191. #define I2C_USE_MUTUAL_EXCLUSION TRUE
  192. #endif
  193. /*===========================================================================*/
  194. /* MAC driver related settings. */
  195. /*===========================================================================*/
  196. /**
  197. * @brief Enables an event sources for incoming packets.
  198. */
  199. #if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
  200. #define MAC_USE_ZERO_COPY FALSE
  201. #endif
  202. /**
  203. * @brief Enables an event sources for incoming packets.
  204. */
  205. #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
  206. #define MAC_USE_EVENTS TRUE
  207. #endif
  208. /*===========================================================================*/
  209. /* MMC_SPI driver related settings. */
  210. /*===========================================================================*/
  211. /**
  212. * @brief Delays insertions.
  213. * @details If enabled this options inserts delays into the MMC waiting
  214. * routines releasing some extra CPU time for the threads with
  215. * lower priority, this may slow down the driver a bit however.
  216. * This option is recommended also if the SPI driver does not
  217. * use a DMA channel and heavily loads the CPU.
  218. */
  219. #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
  220. #define MMC_NICE_WAITING TRUE
  221. #endif
  222. /*===========================================================================*/
  223. /* SDC driver related settings. */
  224. /*===========================================================================*/
  225. /**
  226. * @brief Number of initialization attempts before rejecting the card.
  227. * @note Attempts are performed at 10mS intervals.
  228. */
  229. #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
  230. #define SDC_INIT_RETRY 100
  231. #endif
  232. /**
  233. * @brief Include support for MMC cards.
  234. * @note MMC support is not yet implemented so this option must be kept
  235. * at @p FALSE.
  236. */
  237. #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
  238. #define SDC_MMC_SUPPORT FALSE
  239. #endif
  240. /**
  241. * @brief Delays insertions.
  242. * @details If enabled this options inserts delays into the MMC waiting
  243. * routines releasing some extra CPU time for the threads with
  244. * lower priority, this may slow down the driver a bit however.
  245. */
  246. #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
  247. #define SDC_NICE_WAITING TRUE
  248. #endif
  249. /*===========================================================================*/
  250. /* SERIAL driver related settings. */
  251. /*===========================================================================*/
  252. /**
  253. * @brief Default bit rate.
  254. * @details Configuration parameter, this is the baud rate selected for the
  255. * default configuration.
  256. */
  257. #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
  258. #define SERIAL_DEFAULT_BITRATE 38400
  259. #endif
  260. /**
  261. * @brief Serial buffers size.
  262. * @details Configuration parameter, you can change the depth of the queue
  263. * buffers depending on the requirements of your application.
  264. * @note The default is 16 bytes for both the transmission and receive
  265. * buffers.
  266. */
  267. #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
  268. #define SERIAL_BUFFERS_SIZE 16
  269. #endif
  270. /*===========================================================================*/
  271. /* SERIAL_USB driver related setting. */
  272. /*===========================================================================*/
  273. /**
  274. * @brief Serial over USB buffers size.
  275. * @details Configuration parameter, the buffer size must be a multiple of
  276. * the USB data endpoint maximum packet size.
  277. * @note The default is 256 bytes for both the transmission and receive
  278. * buffers.
  279. */
  280. #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
  281. #define SERIAL_USB_BUFFERS_SIZE 1
  282. #endif
  283. /**
  284. * @brief Serial over USB number of buffers.
  285. * @note The default is 2 buffers.
  286. */
  287. #if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
  288. #define SERIAL_USB_BUFFERS_NUMBER 2
  289. #endif
  290. /*===========================================================================*/
  291. /* SPI driver related settings. */
  292. /*===========================================================================*/
  293. /**
  294. * @brief Enables synchronous APIs.
  295. * @note Disabling this option saves both code and data space.
  296. */
  297. #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
  298. #define SPI_USE_WAIT TRUE
  299. #endif
  300. /**
  301. * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
  302. * @note Disabling this option saves both code and data space.
  303. */
  304. #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  305. #define SPI_USE_MUTUAL_EXCLUSION TRUE
  306. #endif
  307. /*===========================================================================*/
  308. /* UART driver related settings. */
  309. /*===========================================================================*/
  310. /**
  311. * @brief Enables synchronous APIs.
  312. * @note Disabling this option saves both code and data space.
  313. */
  314. #if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
  315. #define UART_USE_WAIT FALSE
  316. #endif
  317. /**
  318. * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
  319. * @note Disabling this option saves both code and data space.
  320. */
  321. #if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  322. #define UART_USE_MUTUAL_EXCLUSION FALSE
  323. #endif
  324. /*===========================================================================*/
  325. /* USB driver related settings. */
  326. /*===========================================================================*/
  327. /**
  328. * @brief Enables synchronous APIs.
  329. * @note Disabling this option saves both code and data space.
  330. */
  331. #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
  332. #define USB_USE_WAIT TRUE
  333. #endif
  334. #endif /* HALCONF_H */
  335. /** @} */