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