RTEMS 6.1-rc5
Loading...
Searching...
No Matches
stm32h7xx_hal_def.h
Go to the documentation of this file.
1
20/* Define to prevent recursive inclusion -------------------------------------*/
21#ifndef STM32H7xx_HAL_DEF
22#define STM32H7xx_HAL_DEF
23
24#ifdef __cplusplus
25 extern "C" {
26#endif
27
28/* Includes ------------------------------------------------------------------*/
29#include "stm32h7xx.h"
31#include <stddef.h>
32#ifdef __rtems__
33/* this is to avoid definition of log function which conflicts with
34 * freebsd's systm.h log function. Whole theatre just to make sure
35 * we do have float_t available (defined in math.h) which is later
36 * used in HAL */
37#define __math_68881 1
38#endif /* __rtems__ */
39#include <math.h>
40
41/* Exported types ------------------------------------------------------------*/
42
46typedef enum
47{
48 HAL_OK = 0x00,
49 HAL_ERROR = 0x01,
50 HAL_BUSY = 0x02,
51 HAL_TIMEOUT = 0x03
53
57typedef enum
58{
59 HAL_UNLOCKED = 0x00,
60 HAL_LOCKED = 0x01
62
63/* Exported macro ------------------------------------------------------------*/
64
65#define HAL_MAX_DELAY 0xFFFFFFFFU
66
67#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == (BIT))
68#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U)
69
70#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
71 do{ \
72 (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
73 (__DMA_HANDLE__).Parent = (__HANDLE__); \
74 } while(0)
75
76#if !defined(UNUSED)
77#define UNUSED(x) ((void)(x)) /* To avoid gcc/g++ warnings */
78#endif /* UNUSED */
79
95#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0)
96
97#if (USE_RTOS == 1)
98 #error " USE_RTOS should be 0 in the current HAL release "
99#else
100 #define __HAL_LOCK(__HANDLE__) \
101 do{ \
102 if((__HANDLE__)->Lock == HAL_LOCKED) \
103 { \
104 return HAL_BUSY; \
105 } \
106 else \
107 { \
108 (__HANDLE__)->Lock = HAL_LOCKED; \
109 } \
110 }while (0)
111
112 #define __HAL_UNLOCK(__HANDLE__) \
113 do{ \
114 (__HANDLE__)->Lock = HAL_UNLOCKED; \
115 }while (0)
116#endif /* USE_RTOS */
117
118
119#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
120 #ifndef __weak
121 #define __weak __attribute__((weak))
122 #endif
123 #ifndef __packed
124 #define __packed __attribute__((packed))
125 #endif
126#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
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 (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
138 #ifndef __ALIGN_BEGIN
139 #define __ALIGN_BEGIN
140 #endif
141 #ifndef __ALIGN_END
142 #define __ALIGN_END __attribute__ ((aligned (4)))
143 #endif
144#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
145 #ifndef __ALIGN_END
146 #define __ALIGN_END __attribute__ ((aligned (4)))
147 #endif /* __ALIGN_END */
148 #ifndef __ALIGN_BEGIN
149 #define __ALIGN_BEGIN
150 #endif /* __ALIGN_BEGIN */
151#else
152 #ifndef __ALIGN_END
153 #define __ALIGN_END
154 #endif /* __ALIGN_END */
155 #ifndef __ALIGN_BEGIN
156 #if defined (__CC_ARM) /* ARM Compiler V5 */
157 #define __ALIGN_BEGIN __align(4)
158 #elif defined (__ICCARM__) /* IAR Compiler */
159 #define __ALIGN_BEGIN
160 #endif /* __CC_ARM */
161 #endif /* __ALIGN_BEGIN */
162#endif /* __GNUC__ */
163
164/* Macro to get variable aligned on 32-bytes,needed for cache maintenance purpose */
165#if defined (__GNUC__) /* GNU Compiler */
166 #define ALIGN_32BYTES(buf) buf __attribute__ ((aligned (32)))
167#elif defined (__ICCARM__) /* IAR Compiler */
168 #define ALIGN_32BYTES(buf) _Pragma("data_alignment=32") buf
169#elif defined (__CC_ARM) /* ARM Compiler */
170 #define ALIGN_32BYTES(buf) __align(32) buf
171#endif
172
176#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
177/* ARM Compiler V4/V5 and V6
178 --------------------------
179 RAM functions are defined using the toolchain options.
180 Functions that are executed in RAM should reside in a separate source module.
181 Using the 'Options for File' dialog you can simply change the 'Code / Const'
182 area of a module to a memory space in physical RAM.
183 Available memory areas are declared in the 'Target' tab of the 'Options for Target'
184 dialog.
185*/
186#define __RAM_FUNC
187
188#elif defined ( __ICCARM__ )
189/* ICCARM Compiler
190 ---------------
191 RAM functions are defined using a specific toolchain keyword "__ramfunc".
192*/
193#define __RAM_FUNC __ramfunc
194
195#elif defined ( __GNUC__ )
196/* GNU Compiler
197 ------------
198 RAM functions are defined using a specific toolchain attribute
199 "__attribute__((section(".RamFunc")))".
200*/
201#define __RAM_FUNC __attribute__((section(".RamFunc")))
202
203#endif
204
208#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined ( __GNUC__ )
209/* ARM V4/V5 and V6 & GNU Compiler
210 -------------------------------
211*/
212#define __NOINLINE __attribute__ ( (noinline) )
213
214#elif defined ( __ICCARM__ )
215/* ICCARM Compiler
216 ---------------
217*/
218#define __NOINLINE _Pragma("optimize = no_inline")
219
220#endif
221
222
223#ifdef __cplusplus
224}
225#endif
226
227#endif /* STM32H7xx_HAL_DEF */
228
229
This file contains aliases definition for the STM32Cube HAL constants macros and functions maintained...
CMSIS STM32H7xx Device Peripheral Access Layer Header File.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
HAL_LockTypeDef
HAL Lock structures definition.
Definition: stm32h7xx_hal_def.h:58