halconf.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. /*
  2. ChibiOS - Copyright (C) 2006..2015 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. #pragma once
  24. #include "mcuconf.h"
  25. /**
  26. * @brief Enables the PAL subsystem.
  27. */
  28. #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
  29. #define HAL_USE_PAL TRUE
  30. #endif
  31. /**
  32. * @brief Enables the ADC subsystem.
  33. */
  34. #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
  35. #define HAL_USE_ADC FALSE
  36. #endif
  37. /**
  38. * @brief Enables the CAN subsystem.
  39. */
  40. #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
  41. #define HAL_USE_CAN FALSE
  42. #endif
  43. /**
  44. * @brief Enables the DAC subsystem.
  45. */
  46. #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
  47. #define HAL_USE_DAC FALSE
  48. #endif
  49. /**
  50. * @brief Enables the EXT subsystem.
  51. */
  52. #if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
  53. #define HAL_USE_EXT FALSE
  54. #endif
  55. /**
  56. * @brief Enables the GPT subsystem.
  57. */
  58. #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
  59. #define HAL_USE_GPT FALSE
  60. #endif
  61. /**
  62. * @brief Enables the I2C subsystem.
  63. */
  64. #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
  65. #define HAL_USE_I2C FALSE
  66. #endif
  67. /**
  68. * @brief Enables the I2S subsystem.
  69. */
  70. #if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
  71. #define HAL_USE_I2S FALSE
  72. #endif
  73. /**
  74. * @brief Enables the ICU subsystem.
  75. */
  76. #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
  77. #define HAL_USE_ICU FALSE
  78. #endif
  79. /**
  80. * @brief Enables the MAC subsystem.
  81. */
  82. #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
  83. #define HAL_USE_MAC FALSE
  84. #endif
  85. /**
  86. * @brief Enables the MMC_SPI subsystem.
  87. */
  88. #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
  89. #define HAL_USE_MMC_SPI FALSE
  90. #endif
  91. /**
  92. * @brief Enables the PWM subsystem.
  93. */
  94. #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
  95. #define HAL_USE_PWM FALSE
  96. #endif
  97. /**
  98. * @brief Enables the RTC subsystem.
  99. */
  100. #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
  101. #define HAL_USE_RTC FALSE
  102. #endif
  103. /**
  104. * @brief Enables the SDC subsystem.
  105. */
  106. #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
  107. #define HAL_USE_SDC FALSE
  108. #endif
  109. /**
  110. * @brief Enables the SERIAL subsystem.
  111. */
  112. #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
  113. #define HAL_USE_SERIAL FALSE
  114. #endif
  115. /**
  116. * @brief Enables the SERIAL over USB subsystem.
  117. */
  118. #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
  119. #define HAL_USE_SERIAL_USB FALSE
  120. #endif
  121. /**
  122. * @brief Enables the SPI subsystem.
  123. */
  124. #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
  125. #define HAL_USE_SPI FALSE
  126. #endif
  127. /**
  128. * @brief Enables the UART subsystem.
  129. */
  130. #if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
  131. #define HAL_USE_UART FALSE
  132. #endif
  133. /**
  134. * @brief Enables the USB subsystem.
  135. */
  136. #if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
  137. #define HAL_USE_USB TRUE
  138. #endif
  139. /**
  140. * @brief Enables the WDG subsystem.
  141. */
  142. #if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
  143. #define HAL_USE_WDG FALSE
  144. #endif
  145. /*===========================================================================*/
  146. /* ADC driver related settings. */
  147. /*===========================================================================*/
  148. /**
  149. * @brief Enables synchronous APIs.
  150. * @note Disabling this option saves both code and data space.
  151. */
  152. #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
  153. #define ADC_USE_WAIT TRUE
  154. #endif
  155. /**
  156. * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
  157. * @note Disabling this option saves both code and data space.
  158. */
  159. #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  160. #define ADC_USE_MUTUAL_EXCLUSION TRUE
  161. #endif
  162. /*===========================================================================*/
  163. /* CAN driver related settings. */
  164. /*===========================================================================*/
  165. /**
  166. * @brief Sleep mode related APIs inclusion switch.
  167. */
  168. #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
  169. #define CAN_USE_SLEEP_MODE TRUE
  170. #endif
  171. /*===========================================================================*/
  172. /* I2C driver related settings. */
  173. /*===========================================================================*/
  174. /**
  175. * @brief Enables the mutual exclusion APIs on the I2C bus.
  176. */
  177. #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  178. #define I2C_USE_MUTUAL_EXCLUSION TRUE
  179. #endif
  180. /*===========================================================================*/
  181. /* MAC driver related settings. */
  182. /*===========================================================================*/
  183. /**
  184. * @brief Enables an event sources for incoming packets.
  185. */
  186. #if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
  187. #define MAC_USE_ZERO_COPY FALSE
  188. #endif
  189. /**
  190. * @brief Enables an event sources for incoming packets.
  191. */
  192. #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
  193. #define MAC_USE_EVENTS TRUE
  194. #endif
  195. /*===========================================================================*/
  196. /* MMC_SPI driver related settings. */
  197. /*===========================================================================*/
  198. /**
  199. * @brief Delays insertions.
  200. * @details If enabled this options inserts delays into the MMC waiting
  201. * routines releasing some extra CPU time for the threads with
  202. * lower priority, this may slow down the driver a bit however.
  203. * This option is recommended also if the SPI driver does not
  204. * use a DMA channel and heavily loads the CPU.
  205. */
  206. #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
  207. #define MMC_NICE_WAITING TRUE
  208. #endif
  209. /*===========================================================================*/
  210. /* SDC driver related settings. */
  211. /*===========================================================================*/
  212. /**
  213. * @brief Number of initialization attempts before rejecting the card.
  214. * @note Attempts are performed at 10mS intervals.
  215. */
  216. #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
  217. #define SDC_INIT_RETRY 100
  218. #endif
  219. /**
  220. * @brief Include support for MMC cards.
  221. * @note MMC support is not yet implemented so this option must be kept
  222. * at @p FALSE.
  223. */
  224. #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
  225. #define SDC_MMC_SUPPORT FALSE
  226. #endif
  227. /**
  228. * @brief Delays insertions.
  229. * @details If enabled this options inserts delays into the MMC waiting
  230. * routines releasing some extra CPU time for the threads with
  231. * lower priority, this may slow down the driver a bit however.
  232. */
  233. #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
  234. #define SDC_NICE_WAITING TRUE
  235. #endif
  236. /*===========================================================================*/
  237. /* SERIAL driver related settings. */
  238. /*===========================================================================*/
  239. /**
  240. * @brief Default bit rate.
  241. * @details Configuration parameter, this is the baud rate selected for the
  242. * default configuration.
  243. */
  244. #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
  245. #define SERIAL_DEFAULT_BITRATE 38400
  246. #endif
  247. /**
  248. * @brief Serial buffers size.
  249. * @details Configuration parameter, you can change the depth of the queue
  250. * buffers depending on the requirements of your application.
  251. * @note The default is 64 bytes for both the transmission and receive
  252. * buffers.
  253. */
  254. #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
  255. #define SERIAL_BUFFERS_SIZE 16
  256. #endif
  257. /*===========================================================================*/
  258. /* SERIAL_USB driver related setting. */
  259. /*===========================================================================*/
  260. /**
  261. * @brief Serial over USB buffers size.
  262. * @details Configuration parameter, the buffer size must be a multiple of
  263. * the USB data endpoint maximum packet size.
  264. * @note The default is 64 bytes for both the transmission and receive
  265. * buffers.
  266. */
  267. #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
  268. #define SERIAL_USB_BUFFERS_SIZE 1
  269. #endif
  270. /*===========================================================================*/
  271. /* SPI driver related settings. */
  272. /*===========================================================================*/
  273. /**
  274. * @brief Enables synchronous APIs.
  275. * @note Disabling this option saves both code and data space.
  276. */
  277. #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
  278. #define SPI_USE_WAIT TRUE
  279. #endif
  280. /**
  281. * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
  282. * @note Disabling this option saves both code and data space.
  283. */
  284. #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  285. #define SPI_USE_MUTUAL_EXCLUSION TRUE
  286. #endif
  287. /*===========================================================================*/
  288. /* USB driver related settings. */
  289. /*===========================================================================*/
  290. /**
  291. * @brief Enables synchronous APIs.
  292. * @note Disabling this option saves both code and data space.
  293. */
  294. #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
  295. #define USB_USE_WAIT TRUE
  296. #endif
  297. /** @} */