ChibiOS/HAL  7.1.5
hal.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2018 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 hal.h
19  * @brief HAL subsystem header.
20  *
21  * @addtogroup HAL
22  * @{
23  */
24 
25 #ifndef HAL_H
26 #define HAL_H
27 
28 #include "osal.h"
29 #include "board.h"
30 #include "halconf.h"
31 
32 /* Error checks on the configuration header file.*/
33 #if !defined(HAL_USE_PAL)
34 #define HAL_USE_PAL FALSE
35 #endif
36 
37 #if !defined(HAL_USE_ADC)
38 #define HAL_USE_ADC FALSE
39 #endif
40 
41 #if !defined(HAL_USE_CAN)
42 #define HAL_USE_CAN FALSE
43 #endif
44 
45 #if !defined(HAL_USE_CRY)
46 #define HAL_USE_CRY FALSE
47 #endif
48 
49 #if !defined(HAL_USE_DAC)
50 #define HAL_USE_DAC FALSE
51 #endif
52 
53 #if !defined(HAL_USE_EFL)
54 #define HAL_USE_EFL FALSE
55 #endif
56 
57 #if !defined(HAL_USE_GPT)
58 #define HAL_USE_GPT FALSE
59 #endif
60 
61 #if !defined(HAL_USE_I2C)
62 #define HAL_USE_I2C FALSE
63 #endif
64 
65 #if !defined(HAL_USE_I2S)
66 #define HAL_USE_I2S FALSE
67 #endif
68 
69 #if !defined(HAL_USE_ICU)
70 #define HAL_USE_ICU FALSE
71 #endif
72 
73 #if !defined(HAL_USE_MAC)
74 #define HAL_USE_MAC FALSE
75 #endif
76 
77 #if !defined(HAL_USE_PWM)
78 #define HAL_USE_PWM FALSE
79 #endif
80 
81 #if !defined(HAL_USE_RTC)
82 #define HAL_USE_RTC FALSE
83 #endif
84 
85 #if !defined(HAL_USE_SERIAL)
86 #define HAL_USE_SERIAL FALSE
87 #endif
88 
89 #if !defined(HAL_USE_SDC)
90 #define HAL_USE_SDC FALSE
91 #endif
92 
93 #if !defined(HAL_USE_SIO)
94 #define HAL_USE_SIO FALSE
95 #endif
96 
97 #if !defined(HAL_USE_SPI)
98 #define HAL_USE_SPI FALSE
99 #endif
100 
101 #if !defined(HAL_USE_TRNG)
102 #define HAL_USE_TRNG FALSE
103 #endif
104 
105 #if !defined(HAL_USE_UART)
106 #define HAL_USE_UART FALSE
107 #endif
108 
109 #if !defined(HAL_USE_USB)
110 #define HAL_USE_USB FALSE
111 #endif
112 
113 #if !defined(HAL_USE_WDG)
114 #define HAL_USE_WDG FALSE
115 #endif
116 
117 #if !defined(HAL_USE_WSPI)
118 #define HAL_USE_WSPI FALSE
119 #endif
120 
121 /* Low Level HAL support.*/
122 #include "hal_lld.h"
123 
124 /* Abstract interfaces.*/
125 #include "hal_objects.h"
126 #include "hal_streams.h"
127 #include "hal_channels.h"
128 #include "hal_files.h"
129 #include "hal_ioblock.h"
130 #include "hal_mmcsd.h"
131 #include "hal_persistent.h"
132 #include "hal_flash.h"
133 
134 /* Shared headers.*/
135 #include "hal_buffers.h"
136 #include "hal_queues.h"
137 
138 /* Normal drivers.*/
139 #include "hal_pal.h"
140 #include "hal_adc.h"
141 #include "hal_can.h"
142 #include "hal_crypto.h"
143 #include "hal_dac.h"
144 #include "hal_efl.h"
145 #include "hal_gpt.h"
146 #include "hal_i2c.h"
147 #include "hal_i2s.h"
148 #include "hal_icu.h"
149 #include "hal_mac.h"
150 #include "hal_pwm.h"
151 #include "hal_rtc.h"
152 #include "hal_serial.h"
153 #include "hal_sdc.h"
154 #include "hal_sio.h"
155 #include "hal_spi.h"
156 #include "hal_trng.h"
157 #include "hal_uart.h"
158 #include "hal_usb.h"
159 #include "hal_wdg.h"
160 #include "hal_wspi.h"
161 
162 /*
163  * The ST driver is a special case, it is only included if the OSAL is
164  * configured to require it.
165  */
166 #if OSAL_ST_MODE != OSAL_ST_MODE_NONE
167 #include "hal_st.h"
168 #endif
169 
170 /* Complex drivers.*/
171 #include "hal_mmc_spi.h"
172 #include "hal_serial_usb.h"
173 
174 /* Community drivers.*/
175 #if defined(HAL_USE_COMMUNITY) || defined(__DOXYGEN__)
176 #if (HAL_USE_COMMUNITY == TRUE) || defined(__DOXYGEN__)
177 #include "hal_community.h"
178 #endif
179 #endif
180 
181 /*===========================================================================*/
182 /* Driver constants. */
183 /*===========================================================================*/
184 
185 /**
186  * @brief ChibiOS/HAL identification macro.
187  */
188 #define _CHIBIOS_HAL_
189 
190 /**
191  * @brief Stable release flag.
192  */
193 #define CH_HAL_STABLE 1
194 
195 /**
196  * @name ChibiOS/HAL version identification
197  * @{
198  */
199 /**
200  * @brief HAL version string.
201  */
202 #define HAL_VERSION "7.1.5"
203 
204 /**
205  * @brief HAL version major number.
206  */
207 #define CH_HAL_MAJOR 7
208 
209 /**
210  * @brief HAL version minor number.
211  */
212 #define CH_HAL_MINOR 1
213 
214 /**
215  * @brief HAL version patch number.
216  */
217 #define CH_HAL_PATCH 5
218 /** @} */
219 
220 /**
221  * @name Return codes
222  * @{
223  */
224 /**
225  * @brief HAL operation success.
226  */
227 #define HAL_SUCCESS false
228 /**
229  * @brief HAL operation failed.
230  */
231 #define HAL_FAILED true
232 /** @} */
233 
234 /*===========================================================================*/
235 /* Driver pre-compile time settings. */
236 /*===========================================================================*/
237 
238 /*===========================================================================*/
239 /* Derived constants and error checks. */
240 /*===========================================================================*/
241 
242 /* Configuration file checks.*/
243 #if !defined(_CHIBIOS_HAL_CONF_)
244 #error "invalid configuration file"
245 #endif
246 
247 #if !defined(_CHIBIOS_HAL_CONF_VER_7_1_)
248 #error "obsolete or unknown configuration file"
249 #endif
250 
251 /*===========================================================================*/
252 /* Driver data structures and types. */
253 /*===========================================================================*/
254 
255 /*===========================================================================*/
256 /* Driver macros. */
257 /*===========================================================================*/
258 
259 /*===========================================================================*/
260 /* External declarations. */
261 /*===========================================================================*/
262 
263 #ifdef __cplusplus
264 extern "C" {
265 #endif
266  void halInit(void);
267 #ifdef __cplusplus
268 }
269 #endif
270 
271 #endif /* HAL_H */
272 
273 /** @} */
hal_mmc_spi.h
MMC over SPI driver header.
hal_queues.h
I/O Queues macros and structures.
hal_can.h
CAN Driver macros and structures.
hal_files.h
Data files.
hal_i2s.h
I2S Driver macros and structures.
hal_gpt.h
GPT Driver macros and structures.
hal_serial.h
Serial Driver macros and structures.
hal_flash.h
Generic flash driver class header.
hal_wdg.h
WDG Driver macros and structures.
hal_mac.h
MAC Driver macros and structures.
hal_pal.h
I/O Ports Abstraction Layer macros, types and structures.
hal_st.h
ST Driver macros and structures.
hal_pwm.h
PWM Driver macros and structures.
halInit
void halInit(void)
HAL initialization.
Definition: hal.c:56
hal_adc.h
ADC Driver macros and structures.
osal.h
OSAL module header.
hal_serial_usb.h
Serial over USB Driver macros and structures.
hal_i2c.h
I2C Driver macros and structures.
hal_mmcsd.h
MMC/SD cards common header.
hal_channels.h
I/O channels access.
hal_sio.h
SIO Driver macros and structures.
hal_buffers.h
I/O Buffers macros and structures.
hal_spi.h
SPI Driver macros and structures.
halconf.h
HAL configuration header.
hal_efl.h
Embedded Flash Driver macros and structures.
hal_icu.h
ICU Driver macros and structures.
hal_trng.h
TRNG Driver macros and structures.
hal_streams.h
Data streams.
hal_persistent.h
Generic persistent storage class header.
hal_objects.h
Base object.
hal_wspi.h
WSPI Driver macros and structures.
hal_uart.h
UART Driver macros and structures.
hal_ioblock.h
I/O block devices access.
hal_usb.h
USB Driver macros and structures.
hal_sdc.h
SDC Driver macros and structures.
hal_rtc.h
RTC Driver macros and structures.
hal_crypto.h
Cryptographic Driver macros and structures.
hal_dac.h
DAC Driver macros and structures.
hal_lld.h
PLATFORM HAL subsystem low level driver header.