Subversion Repositories ChibiGauge

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*
  2.     ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
  3.                  2011,2012 Giovanni Di Sirio.
  4.  
  5.     This file is part of ChibiOS/RT.
  6.  
  7.     ChibiOS/RT is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation; either version 3 of the License, or
  10.     (at your option) any later version.
  11.  
  12.     ChibiOS/RT is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.  
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19.  
  20.                                       ---
  21.  
  22.     A special exception to the GPL can be applied should you wish to distribute
  23.     a combined work that includes ChibiOS/RT, without being obliged to provide
  24.     the source code for any proprietary components. See the file exception.txt
  25.     for full details of how and when the exception can be applied.
  26. */
  27.  
  28. /**
  29.  * @file    templates/halconf.h
  30.  * @brief   HAL configuration header.
  31.  * @details HAL configuration file, this file allows to enable or disable the
  32.  *          various device drivers from your application. You may also use
  33.  *          this file in order to override the device drivers default settings.
  34.  *
  35.  * @addtogroup HAL_CONF
  36.  * @{
  37.  */
  38.  
  39. #ifndef _HALCONF_H_
  40. #define _HALCONF_H_
  41.  
  42. #include "mcuconf.h"
  43.  
  44. /* Need to do this somewhere */
  45.  
  46. /**
  47.  * @brief   Enables the TM subsystem.
  48.  */
  49. #if !defined(HAL_USE_TM) || defined(__DOXYGEN__)
  50. #define HAL_USE_TM                  TRUE
  51. #endif
  52.  
  53. /**
  54.  * @brief   Enables the PAL subsystem.
  55.  */
  56. #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
  57. #define HAL_USE_PAL                 TRUE
  58. #endif
  59.  
  60. /**
  61.  * @brief   Enables the ADC subsystem.
  62.  */
  63. #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
  64. #define HAL_USE_ADC                 TRUE
  65. #endif
  66.  
  67. /**
  68.  * @brief   Enables the CAN subsystem.
  69.  */
  70. #if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
  71. #define HAL_USE_CAN                 FALSE
  72. #endif
  73.  
  74. /**
  75.  * @brief   Enables the EXT subsystem.
  76.  */
  77. #if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
  78. #define HAL_USE_EXT                 FALSE
  79. #endif
  80.  
  81. /**
  82.  * @brief   Enables the GPT subsystem.
  83.  */
  84. #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
  85. #define HAL_USE_GPT                 FALSE
  86. #endif
  87.  
  88. /**
  89.  * @brief   Enables the I2C subsystem.
  90.  */
  91. #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
  92. #define HAL_USE_I2C                 TRUE
  93. #endif
  94.  
  95. /**
  96.  * @brief   Enables the ICU subsystem.
  97.  */
  98. #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
  99. #define HAL_USE_ICU                 FALSE
  100. #endif
  101.  
  102. /**
  103.  * @brief   Enables the MAC subsystem.
  104.  */
  105. #if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
  106. #define HAL_USE_MAC                 FALSE
  107. #endif
  108.  
  109. /**
  110.  * @brief   Enables the MMC_SPI subsystem.
  111.  */
  112. #if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
  113. #define HAL_USE_MMC_SPI            FALSE
  114. #endif
  115.  
  116. /**
  117.  * @brief   Enables the PWM subsystem.
  118.  */
  119. #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
  120. #define HAL_USE_PWM                 FALSE
  121. #endif
  122.  
  123. /**
  124.  * @brief   Enables the RTC subsystem.
  125.  */
  126. #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
  127. #define HAL_USE_RTC                 FALSE
  128. #endif
  129.  
  130. /**
  131.  * @brief   Enables the SDC subsystem.
  132.  */
  133. #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
  134. #define HAL_USE_SDC                 FALSE
  135. #endif
  136.  
  137. /**
  138.  * @brief   Enables the SERIAL subsystem.
  139.  */
  140. #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
  141. #define HAL_USE_SERIAL              TRUE
  142. #endif
  143.  
  144. /**
  145.  * @brief   Enables the SERIAL over USB subsystem.
  146.  */
  147. #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
  148. #define HAL_USE_SERIAL_USB          TRUE
  149. #endif
  150.  
  151. #define HAL_USE_BULK_USB TRUE
  152.  
  153. /**
  154.  * @brief   Enables the dual CDC mode on single inteface of the USB subsystem.
  155.  */
  156. #if !defined(HAL_USE_USB_DUAL_CDC) || defined(__DOXYGEN__)
  157. #define  HAL_USE_USB_DUAL_CDC  FALSE
  158. #endif
  159.  
  160.  
  161.  
  162. /**
  163.  * @brief   Enables the SPI subsystem.
  164.  */
  165. #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
  166. #define HAL_USE_SPI                 TRUE
  167. #endif
  168.  
  169. /**
  170.  * @brief   Enables the UART subsystem.
  171.  */
  172. #if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
  173. #define HAL_USE_UART                FALSE
  174. #endif
  175.  
  176. /**
  177.  * @brief   Enables the USB subsystem.
  178.  */
  179. #if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
  180. #define HAL_USE_USB                 TRUE
  181. #endif
  182.  
  183. /*===========================================================================*/
  184. /* ADC driver related settings.                                              */
  185. /*===========================================================================*/
  186.  
  187. /**
  188.  * @brief   Enables synchronous APIs.
  189.  * @note    Disabling this option saves both code and data space.
  190.  */
  191. #if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
  192. #define ADC_USE_WAIT                TRUE
  193. #endif
  194.  
  195. /**
  196.  * @brief   Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
  197.  * @note    Disabling this option saves both code and data space.
  198.  */
  199. #if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  200. #define ADC_USE_MUTUAL_EXCLUSION    TRUE
  201. #endif
  202.  
  203. /*===========================================================================*/
  204. /* CAN driver related settings.                                              */
  205. /*===========================================================================*/
  206.  
  207. /**
  208.  * @brief   Sleep mode related APIs inclusion switch.
  209.  */
  210. #if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
  211. #define CAN_USE_SLEEP_MODE          TRUE
  212. #endif
  213.  
  214. /*===========================================================================*/
  215. /* I2C driver related settings.                                              */
  216. /*===========================================================================*/
  217.  
  218. /**
  219.  * @brief   Enables the mutual exclusion APIs on the I2C bus.
  220.  */
  221. #if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  222. #define I2C_USE_MUTUAL_EXCLUSION    TRUE
  223. #endif
  224.  
  225. /*===========================================================================*/
  226. /* MAC driver related settings.                                              */
  227. /*===========================================================================*/
  228.  
  229. /**
  230.  * @brief   Enables an event sources for incoming packets.
  231.  */
  232. #if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
  233. #define MAC_USE_EVENTS              TRUE
  234. #endif
  235.  
  236. /*===========================================================================*/
  237. /* MMC_SPI driver related settings.                                          */
  238. /*===========================================================================*/
  239.  
  240. /**
  241.  * @brief   Block size for MMC transfers.
  242.  */
  243. #if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__)
  244. #define MMC_SECTOR_SIZE             512
  245. #endif
  246.  
  247. /**
  248.  * @brief   Delays insertions.
  249.  * @details If enabled this options inserts delays into the MMC waiting
  250.  *          routines releasing some extra CPU time for the threads with
  251.  *          lower priority, this may slow down the driver a bit however.
  252.  *          This option is recommended also if the SPI driver does not
  253.  *          use a DMA channel and heavily loads the CPU.
  254.  */
  255. #if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
  256. #define MMC_NICE_WAITING            TRUE
  257. #endif
  258.  
  259. /**
  260.  * @brief   Number of positive insertion queries before generating the
  261.  *          insertion event.
  262.  */
  263. #if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__)
  264. #define MMC_POLLING_INTERVAL        10
  265. #endif
  266.  
  267. /**
  268.  * @brief   Interval, in milliseconds, between insertion queries.
  269.  */
  270. #if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__)
  271. #define MMC_POLLING_DELAY           10
  272. #endif
  273.  
  274. /**
  275.  * @brief   Uses the SPI polled API for small data transfers.
  276.  * @details Polled transfers usually improve performance because it
  277.  *          saves two context switches and interrupt servicing. Note
  278.  *          that this option has no effect on large transfers which
  279.  *          are always performed using DMAs/IRQs.
  280.  */
  281. #if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__)
  282. #define MMC_USE_SPI_POLLING         TRUE
  283. #endif
  284.  
  285. /*===========================================================================*/
  286. /* SDC driver related settings.                                              */
  287. /*===========================================================================*/
  288.  
  289. /**
  290.  * @brief   Number of initialization attempts before rejecting the card.
  291.  * @note    Attempts are performed at 10mS intervals.
  292.  */
  293. #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
  294. #define SDC_INIT_RETRY              100
  295. #endif
  296.  
  297. /**
  298.  * @brief   Include support for MMC cards.
  299.  * @note    MMC support is not yet implemented so this option must be kept
  300.  *          at @p FALSE.
  301.  */
  302. #if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
  303. #define SDC_MMC_SUPPORT             FALSE
  304. #endif
  305.  
  306. /**
  307.  * @brief   Delays insertions.
  308.  * @details If enabled this options inserts delays into the MMC waiting
  309.  *          routines releasing some extra CPU time for the threads with
  310.  *          lower priority, this may slow down the driver a bit however.
  311.  */
  312. #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
  313. #define SDC_NICE_WAITING            TRUE
  314. #endif
  315.  
  316. /*===========================================================================*/
  317. /* SERIAL driver related settings.                                           */
  318. /*===========================================================================*/
  319.  
  320. /**
  321.  * @brief   Default bit rate.
  322.  * @details Configuration parameter, this is the baud rate selected for the
  323.  *          default configuration.
  324.  */
  325. #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
  326. #define SERIAL_DEFAULT_BITRATE      38400
  327. #endif
  328.  
  329. /**
  330.  * @brief   Serial buffers size.
  331.  * @details Configuration parameter, you can change the depth of the queue
  332.  *          buffers depending on the requirements of your application.
  333.  * @note    The default is 64 bytes for both the transmission and receive
  334.  *          buffers.
  335.  */
  336. #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
  337. #define SERIAL_BUFFERS_SIZE         16
  338. #endif
  339.  
  340. /*===========================================================================*/
  341. /* SPI driver related settings.                                              */
  342. /*===========================================================================*/
  343.  
  344. /**
  345.  * @brief   Enables synchronous APIs.
  346.  * @note    Disabling this option saves both code and data space.
  347.  */
  348. #if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
  349. #define SPI_USE_WAIT                TRUE
  350. #endif
  351.  
  352. /**
  353.  * @brief   Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
  354.  * @note    Disabling this option saves both code and data space.
  355.  */
  356. #if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
  357. #define SPI_USE_MUTUAL_EXCLUSION    TRUE
  358. #endif
  359.  
  360. #endif /* _HALCONF_H_ */
  361.  
  362. /** @} */
  363.