PD Buddy Sink Firmware
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.

halconf.h 12KB

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