hal.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file hal.h
  15. * @brief HAL subsystem header.
  16. *
  17. * @addtogroup HAL
  18. * @{
  19. */
  20. #ifndef HAL_H
  21. #define HAL_H
  22. #include "osal.h"
  23. #include "board.h"
  24. #include "halconf.h"
  25. /* Error checks on the configuration header file.*/
  26. #if !defined(HAL_USE_PAL)
  27. #define HAL_USE_PAL FALSE
  28. #endif
  29. #if !defined(HAL_USE_ADC)
  30. #define HAL_USE_ADC FALSE
  31. #endif
  32. #if !defined(HAL_USE_CAN)
  33. #define HAL_USE_CAN FALSE
  34. #endif
  35. #if !defined(HAL_USE_CRY)
  36. #define HAL_USE_CRY FALSE
  37. #endif
  38. #if !defined(HAL_USE_DAC)
  39. #define HAL_USE_DAC FALSE
  40. #endif
  41. #if !defined(HAL_USE_GPT)
  42. #define HAL_USE_GPT FALSE
  43. #endif
  44. #if !defined(HAL_USE_I2C)
  45. #define HAL_USE_I2C FALSE
  46. #endif
  47. #if !defined(HAL_USE_I2S)
  48. #define HAL_USE_I2S FALSE
  49. #endif
  50. #if !defined(HAL_USE_ICU)
  51. #define HAL_USE_ICU FALSE
  52. #endif
  53. #if !defined(HAL_USE_EICU)
  54. #define HAL_USE_EICU FALSE
  55. #endif
  56. #if !defined(HAL_USE_MAC)
  57. #define HAL_USE_MAC FALSE
  58. #endif
  59. #if !defined(HAL_USE_PWM)
  60. #define HAL_USE_PWM FALSE
  61. #endif
  62. #if !defined(HAL_USE_RTC)
  63. #define HAL_USE_RTC FALSE
  64. #endif
  65. #if !defined(HAL_USE_SERIAL)
  66. #define HAL_USE_SERIAL FALSE
  67. #endif
  68. #if !defined(HAL_USE_SDC)
  69. #define HAL_USE_SDC FALSE
  70. #endif
  71. #if !defined(HAL_USE_SIO)
  72. #define HAL_USE_SIO FALSE
  73. #endif
  74. #if !defined(HAL_USE_SPI)
  75. #define HAL_USE_SPI FALSE
  76. #endif
  77. #if !defined(HAL_USE_TRNG)
  78. #define HAL_USE_TRNG FALSE
  79. #endif
  80. #if !defined(HAL_USE_UART)
  81. #define HAL_USE_UART FALSE
  82. #endif
  83. #if !defined(HAL_USE_USB)
  84. #define HAL_USE_USB FALSE
  85. #endif
  86. #if !defined(HAL_USE_WDG)
  87. #define HAL_USE_WDG FALSE
  88. #endif
  89. #if !defined(HAL_USE_WSPI)
  90. #define HAL_USE_WSPI FALSE
  91. #endif
  92. /* Low Level HAL support.*/
  93. #include "hal_lld.h"
  94. /* Abstract interfaces.*/
  95. #include "hal_objects.h"
  96. #include "hal_streams.h"
  97. #include "hal_channels.h"
  98. #include "hal_files.h"
  99. #include "hal_ioblock.h"
  100. #include "hal_mmcsd.h"
  101. #include "hal_persistent.h"
  102. /* Shared headers.*/
  103. #include "hal_buffers.h"
  104. #include "hal_queues.h"
  105. /* Normal drivers.*/
  106. #include "hal_pal.h"
  107. #include "hal_adc.h"
  108. #include "hal_can.h"
  109. #include "hal_crypto.h"
  110. #include "hal_dac.h"
  111. #include "hal_gpt.h"
  112. #include "hal_i2c.h"
  113. #include "hal_i2s.h"
  114. #include "hal_icu.h"
  115. #include "hal_eicu.h"
  116. #include "hal_mac.h"
  117. #include "hal_pwm.h"
  118. #include "hal_rtc.h"
  119. #include "hal_serial.h"
  120. #include "hal_sdc.h"
  121. #include "hal_sio.h"
  122. #include "hal_spi.h"
  123. #include "hal_trng.h"
  124. #include "hal_uart.h"
  125. #include "hal_usb.h"
  126. #include "hal_wdg.h"
  127. #include "hal_wspi.h"
  128. /*
  129. * The ST driver is a special case, it is only included if the OSAL is
  130. * configured to require it.
  131. */
  132. #if OSAL_ST_MODE != OSAL_ST_MODE_NONE
  133. #include "hal_st.h"
  134. #endif
  135. /* Complex drivers.*/
  136. #include "hal_mmc_spi.h"
  137. #include "hal_serial_usb.h"
  138. /* Community drivers.*/
  139. #if defined(HAL_USE_COMMUNITY) || defined(__DOXYGEN__)
  140. #if (HAL_USE_COMMUNITY == TRUE) || defined(__DOXYGEN__)
  141. #include "hal_community.h"
  142. #endif
  143. #endif
  144. /*===========================================================================*/
  145. /* Driver constants. */
  146. /*===========================================================================*/
  147. /**
  148. * @brief ChibiOS/HAL identification macro.
  149. */
  150. #define _CHIBIOS_HAL_
  151. /**
  152. * @brief Stable release flag.
  153. */
  154. #define CH_HAL_STABLE 1
  155. /**
  156. * @name ChibiOS/HAL version identification
  157. * @{
  158. */
  159. /**
  160. * @brief HAL version string.
  161. */
  162. #define HAL_VERSION "7.0.0"
  163. /**
  164. * @brief HAL version major number.
  165. */
  166. #define CH_HAL_MAJOR 7
  167. /**
  168. * @brief HAL version minor number.
  169. */
  170. #define CH_HAL_MINOR 0
  171. /**
  172. * @brief HAL version patch number.
  173. */
  174. #define CH_HAL_PATCH 0
  175. /** @} */
  176. /**
  177. * @name Return codes
  178. * @{
  179. */
  180. #define HAL_SUCCESS false
  181. #define HAL_FAILED true
  182. /** @} */
  183. /*===========================================================================*/
  184. /* Driver pre-compile time settings. */
  185. /*===========================================================================*/
  186. /*===========================================================================*/
  187. /* Derived constants and error checks. */
  188. /*===========================================================================*/
  189. /* Configuration file checks.*/
  190. #if !defined(_CHIBIOS_HAL_CONF_)
  191. #error "invalid configuration file"
  192. #endif
  193. #if !defined(_CHIBIOS_HAL_CONF_VER_7_0_)
  194. #error "obsolete or unknown configuration file"
  195. #endif
  196. /*===========================================================================*/
  197. /* Driver data structures and types. */
  198. /*===========================================================================*/
  199. /*===========================================================================*/
  200. /* Driver macros. */
  201. /*===========================================================================*/
  202. /*===========================================================================*/
  203. /* External declarations. */
  204. /*===========================================================================*/
  205. #ifdef __cplusplus
  206. extern "C" {
  207. #endif
  208. void halInit(void);
  209. #ifdef __cplusplus
  210. }
  211. #endif
  212. #endif /* HAL_H */
  213. /** @} */