mikroSDK Reference Manual
stm32f2xx.h
Go to the documentation of this file.
1
38#ifndef __STM32F2xx_H
39#define __STM32F2xx_H
40
41#ifdef __cplusplus
42 extern "C" {
43#endif /* __cplusplus */
44
52#if !defined (STM32F2)
53#define STM32F2
54#endif /* STM32F2 */
55
56/* Uncomment the line below according to the target STM32 device used in your
57 application
58 */
59#if !defined (STM32F205xx) && !defined (STM32F215xx) && !defined (STM32F207xx) && !defined (STM32F217xx)
60
61 /* #define STM32F205xx */
64 /* #define STM32F215xx */
65 /* #define STM32F207xx */
67 /* #define STM32F217xx */
69#endif
70
71/* Tip: To avoid modifying this file each time you need to switch between these
72 devices, you can define the device in your toolchain compiler preprocessor.
73 */
74#if !defined (USE_HAL_DRIVER)
80 /*#define USE_HAL_DRIVER */
81#endif /* USE_HAL_DRIVER */
82
86#define __STM32F2xx_CMSIS_VERSION_MAIN (0x02U)
87#define __STM32F2xx_CMSIS_VERSION_SUB1 (0x02U)
88#define __STM32F2xx_CMSIS_VERSION_SUB2 (0x05U)
89#define __STM32F2xx_CMSIS_VERSION_RC (0x00U)
90#define __STM32F2xx_CMSIS_VERSION ((__STM32F2xx_CMSIS_VERSION_MAIN << 24)\
91 |(__STM32F2xx_CMSIS_VERSION_SUB1 << 16)\
92 |(__STM32F2xx_CMSIS_VERSION_SUB2 << 8 )\
93 |(__STM32F2xx_CMSIS_VERSION))
94
103#if defined(STM32F205xx)
104 #include "stm32f205xx.h"
105#elif defined(STM32F215xx)
106 #include "stm32f215xx.h"
107#elif defined(STM32F207xx)
108 #include "stm32f207xx.h"
109#elif defined(STM32F217xx)
110 #include "stm32f217xx.h"
111#else
112 #error "Please select first the target STM32F2xx device used in your application (in stm32f2xx.h file)"
113#endif
114
122typedef enum
123{
124 RESET = 0U,
125 SET = !RESET
126} FlagStatus, ITStatus;
127
128typedef enum
129{
130 DISABLE = 0U,
131 ENABLE = !DISABLE
132} FunctionalState;
133#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
134
135typedef enum
136{
137 SUCCESS = 0U,
138 ERROR = !SUCCESS
139} ErrorStatus;
140
149#define SET_BIT(REG, BIT) ((REG) |= (BIT))
150
151#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
152
153#define READ_BIT(REG, BIT) ((REG) & (BIT))
154
155#define CLEAR_REG(REG) ((REG) = (0x0))
156
157#define WRITE_REG(REG, VAL) ((REG) = (VAL))
158
159#define READ_REG(REG) ((REG))
160
161#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
162
163#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
164
165
170#if defined (USE_HAL_DRIVER)
171 #include "stm32f2xx_hal.h"
172#endif /* USE_HAL_DRIVER */
173
174#ifdef __cplusplus
175}
176#endif /* __cplusplus */
177
178#endif /* __STM32F2xx_H */
179
191/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
CMSIS STM32F207xx Device Peripheral Access Layer Header File.
CMSIS STM32F217xx Device Peripheral Access Layer Header File.
This file contains all the functions prototypes for the HAL module driver.