File indexing completed on 2025-05-11 08:23:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef STM32H7xx_HAL_DEF
0022 #define STM32H7xx_HAL_DEF
0023
0024 #ifdef __cplusplus
0025 extern "C" {
0026 #endif
0027
0028
0029 #include "stm32h7xx.h"
0030 #include "Legacy/stm32_hal_legacy.h"
0031 #include <stddef.h>
0032 #ifdef __rtems__
0033
0034
0035
0036
0037 #define __math_68881 1
0038 #endif
0039 #include <math.h>
0040
0041
0042
0043
0044
0045
0046 typedef enum
0047 {
0048 HAL_OK = 0x00,
0049 HAL_ERROR = 0x01,
0050 HAL_BUSY = 0x02,
0051 HAL_TIMEOUT = 0x03
0052 } HAL_StatusTypeDef;
0053
0054
0055
0056
0057 typedef enum
0058 {
0059 HAL_UNLOCKED = 0x00,
0060 HAL_LOCKED = 0x01
0061 } HAL_LockTypeDef;
0062
0063
0064
0065 #define HAL_MAX_DELAY 0xFFFFFFFFU
0066
0067 #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == (BIT))
0068 #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U)
0069
0070 #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
0071 do{ \
0072 (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
0073 (__DMA_HANDLE__).Parent = (__HANDLE__); \
0074 } while(0)
0075
0076 #if !defined(UNUSED)
0077 #define UNUSED(x) ((void)(x))
0078 #endif
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095 #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0)
0096
0097 #if (USE_RTOS == 1)
0098 #error " USE_RTOS should be 0 in the current HAL release "
0099 #else
0100 #define __HAL_LOCK(__HANDLE__) \
0101 do{ \
0102 if((__HANDLE__)->Lock == HAL_LOCKED) \
0103 { \
0104 return HAL_BUSY; \
0105 } \
0106 else \
0107 { \
0108 (__HANDLE__)->Lock = HAL_LOCKED; \
0109 } \
0110 }while (0)
0111
0112 #define __HAL_UNLOCK(__HANDLE__) \
0113 do{ \
0114 (__HANDLE__)->Lock = HAL_UNLOCKED; \
0115 }while (0)
0116 #endif
0117
0118
0119 #if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
0120 #ifndef __weak
0121 #define __weak __attribute__((weak))
0122 #endif
0123 #ifndef __packed
0124 #define __packed __attribute__((packed))
0125 #endif
0126 #elif defined ( __GNUC__ ) && !defined (__CC_ARM)
0127 #ifndef __weak
0128 #define __weak __attribute__((weak))
0129 #endif
0130 #ifndef __packed
0131 #define __packed __attribute__((__packed__))
0132 #endif
0133 #endif
0134
0135
0136
0137 #if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
0138 #ifndef __ALIGN_BEGIN
0139 #define __ALIGN_BEGIN
0140 #endif
0141 #ifndef __ALIGN_END
0142 #define __ALIGN_END __attribute__ ((aligned (4)))
0143 #endif
0144 #elif defined ( __GNUC__ ) && !defined (__CC_ARM)
0145 #ifndef __ALIGN_END
0146 #define __ALIGN_END __attribute__ ((aligned (4)))
0147 #endif
0148 #ifndef __ALIGN_BEGIN
0149 #define __ALIGN_BEGIN
0150 #endif
0151 #else
0152 #ifndef __ALIGN_END
0153 #define __ALIGN_END
0154 #endif
0155 #ifndef __ALIGN_BEGIN
0156 #if defined (__CC_ARM)
0157 #define __ALIGN_BEGIN __align(4)
0158 #elif defined (__ICCARM__)
0159 #define __ALIGN_BEGIN
0160 #endif
0161 #endif
0162 #endif
0163
0164
0165 #if defined (__GNUC__)
0166 #define ALIGN_32BYTES(buf) buf __attribute__ ((aligned (32)))
0167 #elif defined (__ICCARM__)
0168 #define ALIGN_32BYTES(buf) _Pragma("data_alignment=32") buf
0169 #elif defined (__CC_ARM)
0170 #define ALIGN_32BYTES(buf) __align(32) buf
0171 #endif
0172
0173
0174
0175
0176 #if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186 #define __RAM_FUNC
0187
0188 #elif defined ( __ICCARM__ )
0189
0190
0191
0192
0193 #define __RAM_FUNC __ramfunc
0194
0195 #elif defined ( __GNUC__ )
0196
0197
0198
0199
0200
0201 #define __RAM_FUNC __attribute__((section(".RamFunc")))
0202
0203 #endif
0204
0205
0206
0207
0208 #if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined ( __GNUC__ )
0209
0210
0211
0212 #define __NOINLINE __attribute__ ( (noinline) )
0213
0214 #elif defined ( __ICCARM__ )
0215
0216
0217
0218 #define __NOINLINE _Pragma("optimize = no_inline")
0219
0220 #endif
0221
0222
0223 #ifdef __cplusplus
0224 }
0225 #endif
0226
0227 #endif
0228
0229