STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_def.h
Go to the documentation of this file.
1 
39 /* Define to prevent recursive inclusion -------------------------------------*/
40 #ifndef __STM32F7xx_HAL_DEF
41 #define __STM32F7xx_HAL_DEF
42 
43 #ifdef __cplusplus
44  extern "C" {
45 #endif
46 
47 /* Includes ------------------------------------------------------------------*/
48 #include "stm32f7xx.h"
50 #include <stdio.h>
51 /* Exported types ------------------------------------------------------------*/
52 
56 typedef enum
57 {
58  HAL_OK = 0x00U,
59  HAL_ERROR = 0x01U,
60  HAL_BUSY = 0x02U,
61  HAL_TIMEOUT = 0x03U
63 
67 typedef enum
68 {
69  HAL_UNLOCKED = 0x00,
70  HAL_LOCKED = 0x01
72 
73 /* Exported macro ------------------------------------------------------------*/
74 #define HAL_MAX_DELAY 0xFFFFFFFFU
75 
76 #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET)
77 #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET)
78 
79 #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
80  do{ \
81  (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
82  (__DMA_HANDLE__).Parent = (__HANDLE__); \
83  } while(0)
84 
85 #define UNUSED(x) ((void)(x))
86 
102 #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
103 
104 #if (USE_RTOS == 1)
105  /* Reserved for future use */
106  #error "USE_RTOS should be 0 in the current HAL release"
107 #else
108  #define __HAL_LOCK(__HANDLE__) \
109  do{ \
110  if((__HANDLE__)->Lock == HAL_LOCKED) \
111  { \
112  return HAL_BUSY; \
113  } \
114  else \
115  { \
116  (__HANDLE__)->Lock = HAL_LOCKED; \
117  } \
118  }while (0)
119 
120  #define __HAL_UNLOCK(__HANDLE__) \
121  do{ \
122  (__HANDLE__)->Lock = HAL_UNLOCKED; \
123  }while (0)
124 #endif /* USE_RTOS */
125 
126 #if defined ( __GNUC__ )
127  #ifndef __weak
128  #define __weak __attribute__((weak))
129  #endif /* __weak */
130  #ifndef __packed
131  #define __packed __attribute__((__packed__))
132  #endif /* __packed */
133 #endif /* __GNUC__ */
134 
135 
136 /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
137 #if defined (__GNUC__) /* GNU Compiler */
138  #ifndef __ALIGN_END
139  #define __ALIGN_END __attribute__ ((aligned (4)))
140  #endif /* __ALIGN_END */
141  #ifndef __ALIGN_BEGIN
142  #define __ALIGN_BEGIN
143  #endif /* __ALIGN_BEGIN */
144 #else
145  #ifndef __ALIGN_END
146  #define __ALIGN_END
147  #endif /* __ALIGN_END */
148  #ifndef __ALIGN_BEGIN
149  #if defined (__CC_ARM) /* ARM Compiler */
150  #define __ALIGN_BEGIN __align(4)
151  #elif defined (__ICCARM__) /* IAR Compiler */
152  #define __ALIGN_BEGIN
153  #endif /* __CC_ARM */
154  #endif /* __ALIGN_BEGIN */
155 #endif /* __GNUC__ */
156 
157 
161 #if defined ( __CC_ARM )
162 /* ARM Compiler
163  ------------
164  RAM functions are defined using the toolchain options.
165  Functions that are executed in RAM should reside in a separate source module.
166  Using the 'Options for File' dialog you can simply change the 'Code / Const'
167  area of a module to a memory space in physical RAM.
168  Available memory areas are declared in the 'Target' tab of the 'Options for Target'
169  dialog.
170 */
171 #define __RAM_FUNC HAL_StatusTypeDef
172 
173 #elif defined ( __ICCARM__ )
174 /* ICCARM Compiler
175  ---------------
176  RAM functions are defined using a specific toolchain keyword "__ramfunc".
177 */
178 #define __RAM_FUNC __ramfunc HAL_StatusTypeDef
179 
180 #elif defined ( __GNUC__ )
181 /* GNU Compiler
182  ------------
183  RAM functions are defined using a specific toolchain attribute
184  "__attribute__((section(".RamFunc")))".
185 */
186 #define __RAM_FUNC HAL_StatusTypeDef __attribute__((section(".RamFunc")))
187 
188 #endif
189 
193 #if defined ( __CC_ARM ) || defined ( __GNUC__ )
194 /* ARM & GNUCompiler
195  ----------------
196 */
197 #define __NOINLINE __attribute__ ( (noinline) )
198 
199 #elif defined ( __ICCARM__ )
200 /* ICCARM Compiler
201  ---------------
202 */
203 #define __NOINLINE _Pragma("optimize = no_inline")
204 
205 #endif
206 
207 #ifdef __cplusplus
208 }
209 #endif
210 
211 #endif /* ___STM32F7xx_HAL_DEF */
212 
213 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
This file contains aliases definition for the STM32Cube HAL constants macros and functions maintained...
HAL_LockTypeDef
HAL Lock structures definition.
CMSIS STM32F7xx Device Peripheral Access Layer Header File.
HAL_StatusTypeDef
HAL Status structures definition.