stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h
Go to the documentation of this file.
1 
21 /* Define to prevent recursive inclusion -------------------------------------*/
22 #ifndef __STM32F4xx_HAL_DEF
23 #define __STM32F4xx_HAL_DEF
24 
25 #ifdef __cplusplus
26  extern "C" {
27 #endif
28 
29 /* Includes ------------------------------------------------------------------*/
30 #include "stm32f4xx.h"
31 #include "Legacy/stm32_hal_legacy.h"
32 #include <stddef.h>
33 #include <stdint.h>
34 
35 /* Exported types ------------------------------------------------------------*/
36 
40 typedef enum
41 {
42  HAL_OK = 0x00U,
43  HAL_ERROR = 0x01U,
44  HAL_BUSY = 0x02U,
45  HAL_TIMEOUT = 0x03U
47 
51 typedef enum
52 {
53  HAL_UNLOCKED = 0x00U,
54  HAL_LOCKED = 0x01U
56 
57 /* Exported macro ------------------------------------------------------------*/
58 
59 #define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */
60 
61 #define HAL_MAX_DELAY 0xFFFFFFFFU
62 
63 #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == (BIT))
64 #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U)
65 
66 #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
67  do{ \
68  (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
69  (__DMA_HANDLE__).Parent = (__HANDLE__); \
70  } while(0U)
71 
87 #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
88 
89 #if (USE_RTOS == 1U)
90  /* Reserved for future use */
91  #error "USE_RTOS should be 0 in the current HAL release"
92 #else
93  #define __HAL_LOCK(__HANDLE__) \
94  do{ \
95  if((__HANDLE__)->Lock == HAL_LOCKED) \
96  { \
97  return HAL_BUSY; \
98  } \
99  else \
100  { \
101  (__HANDLE__)->Lock = HAL_LOCKED; \
102  } \
103  }while (0U)
104 
105  #define __HAL_UNLOCK(__HANDLE__) \
106  do{ \
107  (__HANDLE__)->Lock = HAL_UNLOCKED; \
108  }while (0U)
109 #endif /* USE_RTOS */
110 
111 #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
112  #ifndef __weak
113  #define __weak __attribute__((weak))
114  #endif /* __weak */
115  #ifndef __packed
116  #define __packed __attribute__((__packed__))
117  #endif /* __packed */
118 #endif /* __GNUC__ */
119 
120 
121 /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
122 #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
123  #ifndef __ALIGN_END
124 #define __ALIGN_END __attribute__ ((aligned (4)))
125  #endif /* __ALIGN_END */
126  #ifndef __ALIGN_BEGIN
127  #define __ALIGN_BEGIN
128  #endif /* __ALIGN_BEGIN */
129 #else
130  #ifndef __ALIGN_END
131  #define __ALIGN_END
132  #endif /* __ALIGN_END */
133  #ifndef __ALIGN_BEGIN
134  #if defined (__CC_ARM) /* ARM Compiler */
135 #define __ALIGN_BEGIN __align(4)
136  #elif defined (__ICCARM__) /* IAR Compiler */
137  #define __ALIGN_BEGIN
138  #endif /* __CC_ARM */
139  #endif /* __ALIGN_BEGIN */
140 #endif /* __GNUC__ */
141 
142 
146 #if defined ( __CC_ARM )
147 /* ARM Compiler
148  ------------
149  RAM functions are defined using the toolchain options.
150  Functions that are executed in RAM should reside in a separate source module.
151  Using the 'Options for File' dialog you can simply change the 'Code / Const'
152  area of a module to a memory space in physical RAM.
153  Available memory areas are declared in the 'Target' tab of the 'Options for Target'
154  dialog.
155 */
156 #define __RAM_FUNC
157 
158 #elif defined ( __ICCARM__ )
159 /* ICCARM Compiler
160  ---------------
161  RAM functions are defined using a specific toolchain keyword "__ramfunc".
162 */
163 #define __RAM_FUNC __ramfunc
164 
165 #elif defined ( __GNUC__ )
166 /* GNU Compiler
167  ------------
168  RAM functions are defined using a specific toolchain attribute
169  "__attribute__((section(".RamFunc")))".
170 */
171 #define __RAM_FUNC __attribute__((section(".RamFunc")))
172 
173 #endif
174 
178 #if defined ( __CC_ARM ) || defined ( __GNUC__ )
179 /* ARM & GNUCompiler
180  ----------------
181 */
182 #define __NOINLINE __attribute__ ( (noinline) )
183 
184 #elif defined ( __ICCARM__ )
185 /* ICCARM Compiler
186  ---------------
187 */
188 #define __NOINLINE _Pragma("optimize = no_inline")
189 
190 #endif
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
196 #endif /* ___STM32F4xx_HAL_DEF */
197 
198 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
HAL_UNLOCKED
@ HAL_UNLOCKED
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:53
HAL_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
HAL_LockTypeDef
HAL_LockTypeDef
HAL Lock structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:51
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
HAL_LOCKED
@ HAL_LOCKED
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:54
HAL_BUSY
@ HAL_BUSY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:44
HAL_TIMEOUT
@ HAL_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:45


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:52