ChibiOS/HAL  6.1.0
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_EXT)
54 #define HAL_USE_ETX 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_QSPI)
82 #define HAL_USE_QSPI FALSE
83 #endif
84 
85 #if !defined(HAL_USE_RTC)
86 #define HAL_USE_RTC FALSE
87 #endif
88 
89 #if !defined(HAL_USE_SERIAL)
90 #define HAL_USE_SERIAL FALSE
91 #endif
92 
93 #if !defined(HAL_USE_SDC)
94 #define HAL_USE_SDC FALSE
95 #endif
96 
97 #if !defined(HAL_USE_SPI)
98 #define HAL_USE_SPI 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 /* Low Level HAL support.*/
114 #include "hal_lld.h"
115 
116 /* Abstract interfaces.*/
117 #include "hal_objects.h"
118 #include "hal_streams.h"
119 #include "hal_channels.h"
120 #include "hal_files.h"
121 #include "hal_ioblock.h"
122 #include "hal_mmcsd.h"
123 
124 /* Shared headers.*/
125 #include "hal_buffers.h"
126 #include "hal_queues.h"
127 
128 /* Normal drivers.*/
129 #include "hal_pal.h"
130 #include "hal_adc.h"
131 #include "hal_can.h"
132 #include "hal_crypto.h"
133 #include "hal_dac.h"
134 #include "hal_ext.h"
135 #include "hal_gpt.h"
136 #include "hal_i2c.h"
137 #include "hal_i2s.h"
138 #include "hal_icu.h"
139 #include "hal_mac.h"
140 #include "hal_pwm.h"
141 #include "hal_qspi.h"
142 #include "hal_rtc.h"
143 #include "hal_serial.h"
144 #include "hal_sdc.h"
145 #include "hal_spi.h"
146 #include "hal_uart.h"
147 #include "hal_usb.h"
148 #include "hal_wdg.h"
149 
150 /*
151  * The ST driver is a special case, it is only included if the OSAL is
152  * configured to require it.
153  */
154 #if OSAL_ST_MODE != OSAL_ST_MODE_NONE
155 #include "hal_st.h"
156 #endif
157 
158 /* Complex drivers.*/
159 #include "hal_mmc_spi.h"
160 #include "hal_serial_usb.h"
161 
162 /* Community drivers.*/
163 #if defined(HAL_USE_COMMUNITY) || defined(__DOXYGEN__)
164 #if (HAL_USE_COMMUNITY == TRUE) || defined(__DOXYGEN__)
165 #include "hal_community.h"
166 #endif
167 #endif
168 
169 /*===========================================================================*/
170 /* Driver constants. */
171 /*===========================================================================*/
172 
173 /**
174  * @brief ChibiOS/HAL identification macro.
175  */
176 #define _CHIBIOS_HAL_
177 
178 /**
179  * @brief Stable release flag.
180  */
181 #define CH_HAL_STABLE 1
182 
183 /**
184  * @name ChibiOS/HAL version identification
185  * @{
186  */
187 /**
188  * @brief HAL version string.
189  */
190 #define HAL_VERSION "6.1.0"
191 
192 /**
193  * @brief HAL version major number.
194  */
195 #define CH_HAL_MAJOR 6
196 
197 /**
198  * @brief HAL version minor number.
199  */
200 #define CH_HAL_MINOR 1
201 
202 /**
203  * @brief HAL version patch number.
204  */
205 #define CH_HAL_PATCH 0
206 /** @} */
207 
208 /**
209  * @name Return codes
210  * @{
211  */
212 #define HAL_SUCCESS false
213 #define HAL_FAILED true
214 /** @} */
215 
216 /*===========================================================================*/
217 /* Driver pre-compile time settings. */
218 /*===========================================================================*/
219 
220 /*===========================================================================*/
221 /* Derived constants and error checks. */
222 /*===========================================================================*/
223 
224 /*===========================================================================*/
225 /* Driver data structures and types. */
226 /*===========================================================================*/
227 
228 /*===========================================================================*/
229 /* Driver macros. */
230 /*===========================================================================*/
231 
232 /*===========================================================================*/
233 /* External declarations. */
234 /*===========================================================================*/
235 
236 #ifdef __cplusplus
237 extern "C" {
238 #endif
239  void halInit(void);
240 #ifdef __cplusplus
241 }
242 #endif
243 
244 #endif /* HAL_H */
245 
246 /** @} */
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.
I/O Ports Abstraction Layer macros, types and structures.
EXT Driver macros and structures.
I2C Driver macros and structures.
ICU 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.
QSPI 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.