mikroSDK Reference Manual
stm32f7xx_hal_def.h
Go to the documentation of this file.
1
21/* Define to prevent recursive inclusion -------------------------------------*/
22#ifndef __STM32F7xx_HAL_DEF
23#define __STM32F7xx_HAL_DEF
24
25#ifdef __cplusplus
26 extern "C" {
27#endif
28
29/* Includes ------------------------------------------------------------------*/
30#include "stm32f7xx.h"
32#include <stddef.h>
33
34/* Exported types ------------------------------------------------------------*/
35
39typedef enum
40{
41 HAL_OK = 0x00U,
42 HAL_ERROR = 0x01U,
43 HAL_BUSY = 0x02U,
44 HAL_TIMEOUT = 0x03U
46
50typedef enum
51{
52 HAL_UNLOCKED = 0x00U,
53 HAL_LOCKED = 0x01U
55
56/* Exported macro ------------------------------------------------------------*/
57
58#define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */
59
60#define HAL_MAX_DELAY 0xFFFFFFFFU
61
62#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == (BIT))
63#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U)
64
65#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
66 do{ \
67 (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
68 (__DMA_HANDLE__).Parent = (__HANDLE__); \
69 } while(0)
70
86#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
87
88#if (USE_RTOS == 1U)
89 /* Reserved for future use */
90 #error "USE_RTOS should be 0 in the current HAL release"
91#else
92 #define __HAL_LOCK(__HANDLE__) \
93 do{ \
94 if((__HANDLE__)->Lock == HAL_LOCKED) \
95 { \
96 return HAL_BUSY; \
97 } \
98 else \
99 { \
100 (__HANDLE__)->Lock = HAL_LOCKED; \
101 } \
102 }while (0U)
103
104 #define __HAL_UNLOCK(__HANDLE__) \
105 do{ \
106 (__HANDLE__)->Lock = HAL_UNLOCKED; \
107 }while (0U)
108#endif /* USE_RTOS */
109
110#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
111 #ifndef __weak
112 #define __weak __attribute__((weak))
113 #endif
114 #ifndef __packed
115 #define __packed __attribute__((packed))
116 #endif
117#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
118 #ifndef __weak
119 #define __weak __attribute__((weak))
120 #endif /* __weak */
121 #ifndef __packed
122 #define __packed __attribute__((__packed__))
123 #endif /* __packed */
124#endif /* __GNUC__ */
125
126
127/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
128#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
129 #ifndef __ALIGN_BEGIN
130 #define __ALIGN_BEGIN
131 #endif
132 #ifndef __ALIGN_END
133 #define __ALIGN_END __attribute__ ((aligned (4)))
134 #endif
135#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
136 #ifndef __ALIGN_END
137 #define __ALIGN_END __attribute__ ((aligned (4)))
138 #endif /* __ALIGN_END */
139 #ifndef __ALIGN_BEGIN
140 #define __ALIGN_BEGIN
141 #endif /* __ALIGN_BEGIN */
142#else
143 #ifndef __ALIGN_END
144 #define __ALIGN_END
145 #endif /* __ALIGN_END */
146 #ifndef __ALIGN_BEGIN
147 #if defined (__CC_ARM) /* ARM Compiler V5*/
148 #define __ALIGN_BEGIN __align(4)
149 #elif defined (__ICCARM__) /* IAR Compiler */
150 #define __ALIGN_BEGIN
151 #endif /* __CC_ARM */
152 #endif /* __ALIGN_BEGIN */
153#endif /* __GNUC__ */
154
155/* Macro to get variable aligned on 32-bytes,needed for cache maintenance purpose */
156#if defined (__GNUC__) /* GNU Compiler */
157 #define ALIGN_32BYTES(buf) buf __attribute__ ((aligned (32)))
158#elif defined (__ICCARM__) /* IAR Compiler */
159 #define ALIGN_32BYTES(buf) _Pragma("data_alignment=32") buf
160#elif defined (__CC_ARM) /* ARM Compiler */
161 #define ALIGN_32BYTES(buf) __align(32) buf
162#endif
163
167#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
168/* ARM Compiler V4/V5 and V6
169 --------------------------
170 RAM functions are defined using the toolchain options.
171 Functions that are executed in RAM should reside in a separate source module.
172 Using the 'Options for File' dialog you can simply change the 'Code / Const'
173 area of a module to a memory space in physical RAM.
174 Available memory areas are declared in the 'Target' tab of the 'Options for Target'
175 dialog.
176*/
177#define __RAM_FUNC
178
179#elif defined ( __ICCARM__ )
180/* ICCARM Compiler
181 ---------------
182 RAM functions are defined using a specific toolchain keyword "__ramfunc".
183*/
184#define __RAM_FUNC __ramfunc
185
186#elif defined ( __GNUC__ )
187/* GNU Compiler
188 ------------
189 RAM functions are defined using a specific toolchain attribute
190 "__attribute__((section(".RamFunc")))".
191*/
192#define __RAM_FUNC __attribute__((section(".RamFunc")))
193
194#endif
195
199#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined ( __GNUC__ )
200/* ARM V4/V5 and V6 & GNU Compiler
201 -------------------------------
202*/
203#define __NOINLINE __attribute__ ( (noinline) )
204
205#elif defined ( __ICCARM__ )
206/* ICCARM Compiler
207 ---------------
208*/
209#define __NOINLINE _Pragma("optimize = no_inline")
210
211#endif
212
213#ifdef __cplusplus
214}
215#endif
216
217#endif /* ___STM32F7xx_HAL_DEF */
218
219/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
This file contains aliases definition for the STM32Cube HAL constants macros and functions maintained...
CMSIS STM32F7xx Device Peripheral Access Layer Header File.
HAL_StatusTypeDef
HAL Status structures definition
Definition stm32f7xx_hal_def.h:40
HAL_LockTypeDef
HAL Lock structures definition
Definition stm32f7xx_hal_def.h:51