You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

524 lines
16 KiB

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