Basic Native CMSIS Register Access Documentation 1.0
The Common Microcontroller Software Interface Standard (CMSIS) simplifies microcontroller software development, providing a consistent and efficient interface for developers working with Cortex-M and entry-level Cortex-A processors. It promotes code reuse, portability, and interoperability, enabling developers to focus on application-level logic rather than dealing with low-level hardware details.
Loading...
Searching...
No Matches
stm32f7xx.h
Go to the documentation of this file.
1
37#ifndef __STM32F7xx_H
38#define __STM32F7xx_H
39
40#ifdef __cplusplus
41 extern "C" {
42#endif /* __cplusplus */
43
51#if !defined (STM32F7)
52#define STM32F7
53#endif /* STM32F7 */
54
55/* Uncomment the line below according to the target STM32 device used in your
56 application
57 */
58#if !defined (STM32F756xx) && !defined (STM32F746xx) && !defined (STM32F745xx) && !defined (STM32F765xx) && \
59 !defined (STM32F767xx) && !defined (STM32F769xx) && !defined (STM32F777xx) && !defined (STM32F779xx) && \
60 !defined (STM32F722xx) && !defined (STM32F723xx) && !defined (STM32F732xx) && !defined (STM32F733xx) && \
61 !defined (STM32F730xx) && !defined (STM32F750xx)
62
63 /* #define STM32F756xx */
65 /* #define STM32F746xx */
67 /* #define STM32F745xx */
68 /* #define STM32F765xx */
70 /* #define STM32F767xx */
72 /* #define STM32F769xx */
74 /* #define STM32F777xx */
75 /* #define STM32F779xx */
76 /* #define STM32F722xx */
78 /* #define STM32F723xx */
79 /* #define STM32F732xx */
80 /* #define STM32F733xx */
81 /* #define STM32F730xx */
82 /* #define STM32F750xx */
83#endif
84
85/* Tip: To avoid modifying this file each time you need to switch between these
86 devices, you can define the device in your toolchain compiler preprocessor.
87 */
88
89#if !defined (USE_HAL_DRIVER)
95 /*#define USE_HAL_DRIVER */
96#endif /* USE_HAL_DRIVER */
97
101#define __STM32F7_CMSIS_VERSION_MAIN (0x01)
102#define __STM32F7_CMSIS_VERSION_SUB1 (0x02)
103#define __STM32F7_CMSIS_VERSION_SUB2 (0x0A)
104#define __STM32F7_CMSIS_VERSION_RC (0x00)
105#define __STM32F7_CMSIS_VERSION ((__STM32F7_CMSIS_VERSION_MAIN << 24)\
106 |(__STM32F7_CMSIS_VERSION_SUB1 << 16)\
107 |(__STM32F7_CMSIS_VERSION_SUB2 << 8 )\
108 |(__STM32F7_CMSIS_VERSION_RC))
116#if defined(STM32F722xx)
117 #include "stm32f722xx.h"
118#elif defined(STM32F723xx)
119 #include "stm32f723xx.h"
120#elif defined(STM32F732xx)
121 #include "stm32f732xx.h"
122#elif defined(STM32F733xx)
123 #include "stm32f733xx.h"
124#elif defined(STM32F756xx)
125 #include "stm32f756xx.h"
126#elif defined(STM32F746xx)
127 #include "stm32f746xx.h"
128#elif defined(STM32F745xx)
129 #include "stm32f745xx.h"
130#elif defined(STM32F765xx)
131 #include "stm32f765xx.h"
132#elif defined(STM32F767xx)
133 #include "stm32f767xx.h"
134#elif defined(STM32F769xx)
135 #include "stm32f769xx.h"
136#elif defined(STM32F777xx)
137 #include "stm32f777xx.h"
138#elif defined(STM32F779xx)
139 #include "stm32f779xx.h"
140#elif defined(STM32F730xx)
141 #include "stm32f730xx.h"
142#elif defined(STM32F750xx)
143 #include "stm32f750xx.h"
144#else
145 #error "Please select first the target STM32F7xx device used in your application (in stm32f7xx.h file)"
146#endif
147
155typedef enum
156{
157 RESET = 0U,
158 SET = !RESET
160
161typedef enum
162{
164 ENABLE = !DISABLE
166#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
167
168typedef enum
169{
171 ERROR = !SUCCESS
173
181#define SET_BIT(REG, BIT) ((REG) |= (BIT))
182
183#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
184
185#define READ_BIT(REG, BIT) ((REG) & (BIT))
186
187#define CLEAR_REG(REG) ((REG) = (0x0))
188
189#define WRITE_REG(REG, VAL) ((REG) = (VAL))
190
191#define READ_REG(REG) ((REG))
192
193#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
194
195#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
196
197/* Use of CMSIS compiler intrinsics for register exclusive access */
198/* Atomic 32-bit register access macro to set one or several bits */
199#define ATOMIC_SET_BIT(REG, BIT) \
200 do { \
201 uint32_t val; \
202 do { \
203 val = __LDREXW((__IO uint32_t *)&(REG)) | (BIT); \
204 } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
205 } while(0)
206
207/* Atomic 32-bit register access macro to clear one or several bits */
208#define ATOMIC_CLEAR_BIT(REG, BIT) \
209 do { \
210 uint32_t val; \
211 do { \
212 val = __LDREXW((__IO uint32_t *)&(REG)) & ~(BIT); \
213 } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
214 } while(0)
215
216/* Atomic 32-bit register access macro to clear and set one or several bits */
217#define ATOMIC_MODIFY_REG(REG, CLEARMSK, SETMASK) \
218 do { \
219 uint32_t val; \
220 do { \
221 val = (__LDREXW((__IO uint32_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
222 } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
223 } while(0)
224
225/* Atomic 16-bit register access macro to set one or several bits */
226#define ATOMIC_SETH_BIT(REG, BIT) \
227 do { \
228 uint16_t val; \
229 do { \
230 val = __LDREXH((__IO uint16_t *)&(REG)) | (BIT); \
231 } while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
232 } while(0)
233
234/* Atomic 16-bit register access macro to clear one or several bits */
235#define ATOMIC_CLEARH_BIT(REG, BIT) \
236 do { \
237 uint16_t val; \
238 do { \
239 val = __LDREXH((__IO uint16_t *)&(REG)) & ~(BIT); \
240 } while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
241 } while(0)
242
243/* Atomic 16-bit register access macro to clear and set one or several bits */
244#define ATOMIC_MODIFYH_REG(REG, CLEARMSK, SETMASK) \
245 do { \
246 uint16_t val; \
247 do { \
248 val = (__LDREXH((__IO uint16_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
249 } while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
250 } while(0)
251
256#ifdef USE_HAL_DRIVER
257 #include "stm32f7xx_hal.h"
258#endif /* USE_HAL_DRIVER */
259
260#ifdef __cplusplus
261}
262#endif /* __cplusplus */
263
264#endif /* __STM32F7xx_H */
265
enum FlagStatus ITStatus
ErrorStatus
Definition stm32f7xx.h:169
FlagStatus
Definition stm32f7xx.h:156
FunctionalState
Definition stm32f7xx.h:162
@ ERROR
Definition stm32f7xx.h:171
@ SUCCESS
Definition stm32f7xx.h:170
@ RESET
Definition stm32f7xx.h:157
@ SET
Definition stm32f7xx.h:158
@ ENABLE
Definition stm32f7xx.h:164
@ DISABLE
Definition stm32f7xx.h:163
CMSIS Cortex-M7 Device Peripheral Access Layer Header File.