STM CMSIS
stm32f4xx.h
Go to the documentation of this file.
1 
56 #ifndef __STM32F4xx_H
57 #define __STM32F4xx_H
58 
59 #ifdef __cplusplus
60  extern "C" {
61 #endif /* __cplusplus */
62 
70 #if !defined (STM32F4)
71 #define STM32F4
72 #endif /* STM32F4 */
73 
74 /* Uncomment the line below according to the target STM32 device used in your
75  application
76  */
77 #if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \
78  !defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \
79  !defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F410Tx) && !defined (STM32F410Cx) && \
80  !defined (STM32F410Rx) && !defined (STM32F411xE) && !defined (STM32F446xx) && !defined (STM32F469xx) && \
81  !defined (STM32F479xx) && !defined (STM32F412Cx) && !defined (STM32F412Rx) && !defined (STM32F412Vx) && \
82  !defined (STM32F412Zx)
83  /* #define STM32F405xx */
84  /* #define STM32F415xx */
85  /* #define STM32F407xx */
86  /* #define STM32F417xx */
87  /* #define STM32F427xx */
88  /* #define STM32F437xx */
89  /* #define STM32F429xx */
91  /* #define STM32F439xx */
93  /* #define STM32F401xC */
94  /* #define STM32F401xE */
95  /* #define STM32F410Tx */
96  /* #define STM32F410Cx */
97  /* #define STM32F410Rx */
98  /* #define STM32F411xE */
99  /* #define STM32F446xx */
101  /* #define STM32F469xx */
103  /* #define STM32F479xx */
105  /* #define STM32F412Cx */
106  /* #define STM32F412Zx */
107  /* #define STM32F412Vx */
108  /* #define STM32F412Rx */
109 #endif
110 
111 /* Tip: To avoid modifying this file each time you need to switch between these
112  devices, you can define the device in your toolchain compiler preprocessor.
113  */
114 #if !defined (USE_HAL_DRIVER)
115 
120  /*#define USE_HAL_DRIVER */
121 #endif /* USE_HAL_DRIVER */
122 
126 #define __STM32F4xx_CMSIS_VERSION_MAIN (0x02U)
127 #define __STM32F4xx_CMSIS_VERSION_SUB1 (0x05U)
128 #define __STM32F4xx_CMSIS_VERSION_SUB2 (0x00U)
129 #define __STM32F4xx_CMSIS_VERSION_RC (0x00U)
130 #define __STM32F4xx_CMSIS_VERSION ((__STM32F4xx_CMSIS_VERSION_MAIN << 24)\
131  |(__STM32F4xx_CMSIS_VERSION_SUB1 << 16)\
132  |(__STM32F4xx_CMSIS_VERSION_SUB2 << 8 )\
133  |(__STM32F4xx_CMSIS_VERSION))
134 
143 #if defined(STM32F405xx)
144  #include "stm32f405xx.h"
145 #elif defined(STM32F415xx)
146  #include "stm32f415xx.h"
147 #elif defined(STM32F407xx)
148  #include "stm32f407xx.h"
149 #elif defined(STM32F417xx)
150  #include "stm32f417xx.h"
151 #elif defined(STM32F427xx)
152  #include "stm32f427xx.h"
153 #elif defined(STM32F437xx)
154  #include "stm32f437xx.h"
155 #elif defined(STM32F429xx)
156  #include "stm32f429xx.h"
157 #elif defined(STM32F439xx)
158  #include "stm32f439xx.h"
159 #elif defined(STM32F401xC)
160  #include "stm32f401xc.h"
161 #elif defined(STM32F401xE)
162  #include "stm32f401xe.h"
163 #elif defined(STM32F410Tx)
164  #include "stm32f410tx.h"
165 #elif defined(STM32F410Cx)
166  #include "stm32f410cx.h"
167 #elif defined(STM32F410Rx)
168  #include "stm32f410rx.h"
169 #elif defined(STM32F411xE)
170  #include "stm32f411xe.h"
171 #elif defined(STM32F446xx)
172  #include "stm32f446xx.h"
173 #elif defined(STM32F469xx)
174  #include "stm32f469xx.h"
175 #elif defined(STM32F479xx)
176  #include "stm32f479xx.h"
177 #elif defined(STM32F412Cx)
178  #include "stm32f412cx.h"
179 #elif defined(STM32F412Zx)
180  #include "stm32f412zx.h"
181 #elif defined(STM32F412Rx)
182  #include "stm32f412rx.h"
183 #elif defined(STM32F412Vx)
184  #include "stm32f412vx.h"
185 #else
186  #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
187 #endif
188 
196 typedef enum
197 {
198  RESET = 0U,
199  SET = !RESET
200 } FlagStatus, ITStatus;
201 
202 typedef enum
203 {
204  DISABLE = 0U,
205  ENABLE = !DISABLE
206 } FunctionalState;
207 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
208 
209 typedef enum
210 {
211  ERROR = 0U,
212  SUCCESS = !ERROR
213 } ErrorStatus;
214 
223 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
224 
225 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
226 
227 #define READ_BIT(REG, BIT) ((REG) & (BIT))
228 
229 #define CLEAR_REG(REG) ((REG) = (0x0))
230 
231 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
232 
233 #define READ_REG(REG) ((REG))
234 
235 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
236 
237 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
238 
239 
244 #if defined (USE_HAL_DRIVER)
245  #include "stm32f4xx_hal.h"
246 #endif /* USE_HAL_DRIVER */
247 
248 #ifdef __cplusplus
249 }
250 #endif /* __cplusplus */
251 
252 #endif /* __STM32F4xx_H */
253 
264 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
CMSIS STM32F405xx Device Peripheral Access Layer Header File.
CMSIS STM32F407xx Device Peripheral Access Layer Header File.
CMSIS STM32F410Cx Device Peripheral Access Layer Header File.
CMSIS STM32F410Tx Device Peripheral Access Layer Header File.
CMSIS STM32F411xExx Device Peripheral Access Layer Header File.
CMSIS STM32F437xx Device Peripheral Access Layer Header File.
This file contains all the functions prototypes for the HAL module driver.
CMSIS STM32F439xx Device Peripheral Access Layer Header File.
CMSIS STM32F446xx Device Peripheral Access Layer Header File.
CMSIS STM32F410Rx Device Peripheral Access Layer Header File.
CMSIS STM32F429xx Device Peripheral Access Layer Header File.
CMSIS STM32F412Vx Device Peripheral Access Layer Header File.
CMSIS STM32F401xExx Device Peripheral Access Layer Header File.
CMSIS STM32F427xx Device Peripheral Access Layer Header File.
CMSIS STM32F401xCxx Device Peripheral Access Layer Header File.
CMSIS STM32F412Cx Device Peripheral Access Layer Header File.
CMSIS STM32F479xx Device Peripheral Access Layer Header File.
CMSIS STM32F415xx Device Peripheral Access Layer Header File.
CMSIS STM32F417xx Device Peripheral Access Layer Header File.
CMSIS STM32F412Zx Device Peripheral Access Layer Header File.
CMSIS STM32F412Rx Device Peripheral Access Layer Header File.
CMSIS STM32F469xx Device Peripheral Access Layer Header File.