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