ChibiOS 21.11.5
halconf.h
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2006-2026 Giovanni Di Sirio.
3
4 Licensed under the Apache License, Version 2.0 (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
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef HALCONF_H
29#define HALCONF_H
30
31#define _CHIBIOS_HAL_CONF_
32#define _CHIBIOS_HAL_CONF_VER_9_1_
33
34#include "mcuconf.h"
35
36/**
37 * @brief Enables the HAL safety subsystem.
38 */
39#if !defined(HAL_USE_SAFETY) || defined(__DOXYGEN__)
40#define HAL_USE_SAFETY FALSE
41#endif
42
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/**
51 * @brief Enables the ADC subsystem.
52 */
53#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
54#define HAL_USE_ADC TRUE
55#endif
56
57/**
58 * @brief Enables the CAN subsystem.
59 */
60#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
61#define HAL_USE_CAN TRUE
62#endif
63
64/**
65 * @brief Enables the cryptographic subsystem.
66 */
67#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
68#define HAL_USE_CRY TRUE
69#endif
70
71/**
72 * @brief Enables the DAC subsystem.
73 */
74#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
75#define HAL_USE_DAC TRUE
76#endif
77
78/**
79 * @brief Enables the EFlash subsystem.
80 */
81#if !defined(HAL_USE_EFL) || defined(__DOXYGEN__)
82#define HAL_USE_EFL TRUE
83#endif
84
85/**
86 * @brief Enables the GPT subsystem.
87 */
88#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
89#define HAL_USE_GPT TRUE
90#endif
91
92/**
93 * @brief Enables the I2C subsystem.
94 */
95#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
96#define HAL_USE_I2C TRUE
97#endif
98
99/**
100 * @brief Enables the I2S subsystem.
101 */
102#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
103#define HAL_USE_I2S TRUE
104#endif
105
106/**
107 * @brief Enables the ICU subsystem.
108 */
109#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
110#define HAL_USE_ICU TRUE
111#endif
112
113/**
114 * @brief Enables the MAC subsystem.
115 */
116#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
117#define HAL_USE_MAC TRUE
118#endif
119
120/**
121 * @brief Enables the MMC_SPI subsystem.
122 */
123#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
124#define HAL_USE_MMC_SPI TRUE
125#endif
126
127/**
128 * @brief Enables the PWM subsystem.
129 */
130#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
131#define HAL_USE_PWM TRUE
132#endif
133
134/**
135 * @brief Enables the RTC subsystem.
136 */
137#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
138#define HAL_USE_RTC TRUE
139#endif
140
141/**
142 * @brief Enables the SDC subsystem.
143 */
144#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
145#define HAL_USE_SDC TRUE
146#endif
147
148/**
149 * @brief Enables the SERIAL subsystem.
150 */
151#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
152#define HAL_USE_SERIAL TRUE
153#endif
154
155/**
156 * @brief Enables the SERIAL over USB subsystem.
157 */
158#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
159#define HAL_USE_SERIAL_USB TRUE
160#endif
161
162/**
163 * @brief Enables the SIO subsystem.
164 */
165#if !defined(HAL_USE_SIO) || defined(__DOXYGEN__)
166#define HAL_USE_SIO TRUE
167#endif
168
169/**
170 * @brief Enables the SPI subsystem.
171 */
172#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
173#define HAL_USE_SPI TRUE
174#endif
175
176/**
177 * @brief Enables the TRNG subsystem.
178 */
179#if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__)
180#define HAL_USE_TRNG TRUE
181#endif
182
183/**
184 * @brief Enables the UART subsystem.
185 */
186#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
187#define HAL_USE_UART TRUE
188#endif
189
190/**
191 * @brief Enables the USB subsystem.
192 */
193#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
194#define HAL_USE_USB TRUE
195#endif
196
197/**
198 * @brief Enables the WDG subsystem.
199 */
200#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
201#define HAL_USE_WDG TRUE
202#endif
203
204/**
205 * @brief Enables the WSPI subsystem.
206 */
207#if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__)
208#define HAL_USE_WSPI TRUE
209#endif
210
211/*===========================================================================*/
212/* PAL driver related settings. */
213/*===========================================================================*/
214
215/**
216 * @brief Enables synchronous APIs.
217 * @note Disabling this option saves both code and data space.
218 */
219#if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__)
220#define PAL_USE_CALLBACKS FALSE
221#endif
222
223/**
224 * @brief Enables synchronous APIs.
225 * @note Disabling this option saves both code and data space.
226 */
227#if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__)
228#define PAL_USE_WAIT FALSE
229#endif
230
231/*===========================================================================*/
232/* ADC driver related settings. */
233/*===========================================================================*/
234
235/**
236 * @brief Enables synchronous APIs.
237 * @note Disabling this option saves both code and data space.
238 */
239#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
240#define ADC_USE_WAIT TRUE
241#endif
242
243/**
244 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
245 * @note Disabling this option saves both code and data space.
246 */
247#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
248#define ADC_USE_MUTUAL_EXCLUSION TRUE
249#endif
250
251/*===========================================================================*/
252/* CAN driver related settings. */
253/*===========================================================================*/
254
255/**
256 * @brief Sleep mode related APIs inclusion switch.
257 */
258#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
259#define CAN_USE_SLEEP_MODE TRUE
260#endif
261
262/**
263 * @brief Enforces the driver to use direct callbacks rather than OSAL events.
264 */
265#if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__)
266#define CAN_ENFORCE_USE_CALLBACKS FALSE
267#endif
268
269/*===========================================================================*/
270/* CRY driver related settings. */
271/*===========================================================================*/
272
273/**
274 * @brief Enables the SW fall-back of the cryptographic driver.
275 * @details When enabled, this option, activates a fall-back software
276 * implementation for algorithms not supported by the underlying
277 * hardware.
278 * @note Fall-back implementations may not be present for all algorithms.
279 */
280#if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__)
281#define HAL_CRY_USE_FALLBACK FALSE
282#endif
283
284/**
285 * @brief Makes the driver forcibly use the fall-back implementations.
286 */
287#if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__)
288#define HAL_CRY_ENFORCE_FALLBACK FALSE
289#endif
290
291/*===========================================================================*/
292/* DAC driver related settings. */
293/*===========================================================================*/
294
295/**
296 * @brief Enables synchronous APIs.
297 * @note Disabling this option saves both code and data space.
298 */
299#if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__)
300#define DAC_USE_WAIT TRUE
301#endif
302
303/**
304 * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs.
305 * @note Disabling this option saves both code and data space.
306 */
307#if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
308#define DAC_USE_MUTUAL_EXCLUSION TRUE
309#endif
310
311/*===========================================================================*/
312/* I2C driver related settings. */
313/*===========================================================================*/
314
315/**
316 * @brief Slave mode API enable switch.
317 * @note The low level driver must support this capability.
318 */
319#if !defined(I2C_ENABLE_SLAVE_MODE)
320#define I2C_ENABLE_SLAVE_MODE FALSE
321#endif
322
323/**
324 * @brief Enables the mutual exclusion APIs on the I2C bus.
325 */
326#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
327#define I2C_USE_MUTUAL_EXCLUSION TRUE
328#endif
329
330/*===========================================================================*/
331/* MAC driver related settings. */
332/*===========================================================================*/
333
334/**
335 * @brief Enables the zero-copy API.
336 */
337#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
338#define MAC_USE_ZERO_COPY TRUE
339#endif
340
341/**
342 * @brief Enables an event sources for incoming packets.
343 */
344#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
345#define MAC_USE_EVENTS TRUE
346#endif
347
348/*===========================================================================*/
349/* MMC_SPI driver related settings. */
350/*===========================================================================*/
351
352/**
353 * @brief Timeout before assuming a failure while waiting for card idle.
354 * @note Time is in milliseconds.
355 */
356#if !defined(MMC_IDLE_TIMEOUT_MS) || defined(__DOXYGEN__)
357#define MMC_IDLE_TIMEOUT_MS 1000
358#endif
359
360/**
361 * @brief Mutual exclusion on the SPI bus.
362 */
363#if !defined(MMC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
364#define MMC_USE_MUTUAL_EXCLUSION TRUE
365#endif
366
367/*===========================================================================*/
368/* SDC driver related settings. */
369/*===========================================================================*/
370
371/**
372 * @brief Number of initialization attempts before rejecting the card.
373 * @note Attempts are performed at 10mS intervals.
374 */
375#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
376#define SDC_INIT_RETRY 100
377#endif
378
379/**
380 * @brief Include support for MMC cards.
381 * @note MMC support is not yet implemented so this option must be kept
382 * at @p FALSE.
383 */
384#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
385#define SDC_MMC_SUPPORT TRUE
386#endif
387
388/**
389 * @brief Delays insertions.
390 * @details If enabled this options inserts delays into the MMC waiting
391 * routines releasing some extra CPU time for the threads with
392 * lower priority, this may slow down the driver a bit however.
393 */
394#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
395#define SDC_NICE_WAITING TRUE
396#endif
397
398/**
399 * @brief OCR initialization constant for V20 cards.
400 */
401#if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__)
402#define SDC_INIT_OCR_V20 0x50FF8000U
403#endif
404
405/**
406 * @brief OCR initialization constant for non-V20 cards.
407 */
408#if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__)
409#define SDC_INIT_OCR 0x80100000U
410#endif
411
412/*===========================================================================*/
413/* SERIAL driver related settings. */
414/*===========================================================================*/
415
416/**
417 * @brief Default bit rate.
418 * @details Configuration parameter, this is the baud rate selected for the
419 * default configuration.
420 */
421#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
422#define SERIAL_DEFAULT_BITRATE 38400
423#endif
424
425/**
426 * @brief Serial buffers size.
427 * @details Configuration parameter, you can change the depth of the queue
428 * buffers depending on the requirements of your application.
429 * @note The default is 16 bytes for both the transmission and receive
430 * buffers.
431 */
432#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
433#define SERIAL_BUFFERS_SIZE 16
434#endif
435
436/*===========================================================================*/
437/* SIO driver related settings. */
438/*===========================================================================*/
439
440/**
441 * @brief Default bit rate.
442 * @details Configuration parameter, this is the baud rate selected for the
443 * default configuration.
444 */
445#if !defined(SIO_DEFAULT_BITRATE) || defined(__DOXYGEN__)
446#define SIO_DEFAULT_BITRATE 38400
447#endif
448
449/**
450 * @brief Support for thread synchronization API.
451 */
452#if !defined(SIO_USE_SYNCHRONIZATION) || defined(__DOXYGEN__)
453#define SIO_USE_SYNCHRONIZATION TRUE
454#endif
455
456/*===========================================================================*/
457/* SERIAL_USB driver related setting. */
458/*===========================================================================*/
459
460/**
461 * @brief Serial over USB buffers size.
462 * @details Configuration parameter, the buffer size must be a multiple of
463 * the USB data endpoint maximum packet size.
464 * @note The default is 256 bytes for both the transmission and receive
465 * buffers.
466 */
467#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
468#define SERIAL_USB_BUFFERS_SIZE 256
469#endif
470
471/**
472 * @brief Serial over USB number of buffers.
473 * @note The default is 2 buffers.
474 */
475#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
476#define SERIAL_USB_BUFFERS_NUMBER 2
477#endif
478
479/*===========================================================================*/
480/* SPI driver related settings. */
481/*===========================================================================*/
482
483/**
484 * @brief Enables synchronous APIs.
485 * @note Disabling this option saves both code and data space.
486 */
487#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
488#define SPI_USE_WAIT TRUE
489#endif
490
491/**
492 * @brief Inserts an assertion on function errors before returning.
493 */
494#if !defined(SPI_USE_ASSERT_ON_ERROR) || defined(__DOXYGEN__)
495#define SPI_USE_ASSERT_ON_ERROR TRUE
496#endif
497
498/**
499 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
500 * @note Disabling this option saves both code and data space.
501 */
502#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
503#define SPI_USE_MUTUAL_EXCLUSION TRUE
504#endif
505
506/**
507 * @brief Handling method for SPI CS line.
508 * @note Disabling this option saves both code and data space.
509 */
510#if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__)
511#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
512#endif
513
514/*===========================================================================*/
515/* UART driver related settings. */
516/*===========================================================================*/
517
518/**
519 * @brief Enables synchronous APIs.
520 * @note Disabling this option saves both code and data space.
521 */
522#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
523#define UART_USE_WAIT TRUE
524#endif
525
526/**
527 * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
528 * @note Disabling this option saves both code and data space.
529 */
530#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
531#define UART_USE_MUTUAL_EXCLUSION TRUE
532#endif
533
534/*===========================================================================*/
535/* USB driver related settings. */
536/*===========================================================================*/
537
538/**
539 * @brief Enables synchronous APIs.
540 * @note Disabling this option saves both code and data space.
541 */
542#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
543#define USB_USE_WAIT TRUE
544#endif
545
546/*===========================================================================*/
547/* WSPI driver related settings. */
548/*===========================================================================*/
549
550/**
551 * @brief Enables synchronous APIs.
552 * @note Disabling this option saves both code and data space.
553 */
554#if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__)
555#define WSPI_USE_WAIT TRUE
556#endif
557
558/**
559 * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs.
560 * @note Disabling this option saves both code and data space.
561 */
562#if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
563#define WSPI_USE_MUTUAL_EXCLUSION TRUE
564#endif
565
566#endif /* HALCONF_H */
567
568/** @} */