59#if !defined (STM32F301x8) && !defined (STM32F302x8) && !defined (STM32F318xx) && \
60 !defined (STM32F302xC) && !defined (STM32F303xC) && !defined (STM32F358xx) && \
61 !defined (STM32F303x8) && !defined (STM32F334x8) && !defined (STM32F328xx) && \
62 !defined (STM32F302xE) && !defined (STM32F303xE) && !defined (STM32F398xx) && \
63 !defined (STM32F373xC) && !defined (STM32F378xx)
95#if !defined (USE_HAL_DRIVER)
107#define __STM32F3_CMSIS_VERSION_MAIN (0x02)
108#define __STM32F3_CMSIS_VERSION_SUB1 (0x03)
109#define __STM32F3_CMSIS_VERSION_SUB2 (0x07)
110#define __STM32F3_CMSIS_VERSION_RC (0x00)
111#define __STM32F3_CMSIS_VERSION ((__STM32F3_CMSIS_VERSION_MAIN << 24)\
112 |(__STM32F3_CMSIS_VERSION_SUB1 << 16)\
113 |(__STM32F3_CMSIS_VERSION_SUB2 << 8 )\
114 |(__STM32F3_CMSIS_VERSION_RC))
124#if defined(STM32F301x8)
125 #include "stm32f301x8.h"
126#elif defined(STM32F302x8)
127 #include "stm32f302x8.h"
128#elif defined(STM32F302xC)
129 #include "stm32f302xc.h"
130#elif defined(STM32F302xE)
131 #include "stm32f302xe.h"
132#elif defined(STM32F303x8)
133 #include "stm32f303x8.h"
134#elif defined(STM32F303xC)
135 #include "stm32f303xc.h"
136#elif defined(STM32F303xE)
138#elif defined(STM32F373xC)
139 #include "stm32f373xc.h"
140#elif defined(STM32F334x8)
141 #include "stm32f334x8.h"
142#elif defined(STM32F318xx)
143 #include "stm32f318xx.h"
144#elif defined(STM32F328xx)
145 #include "stm32f328xx.h"
146#elif defined(STM32F358xx)
147 #include "stm32f358xx.h"
148#elif defined(STM32F378xx)
149 #include "stm32f378xx.h"
150#elif defined(STM32F398xx)
151 #include "stm32f398xx.h"
153 #error "Please select first the target STM32F3xx device used in your application (in stm32f3xx.h file)"
174#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
190#define SET_BIT(REG, BIT) ((REG) |= (BIT))
192#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
194#define READ_BIT(REG, BIT) ((REG) & (BIT))
196#define CLEAR_REG(REG) ((REG) = (0x0))
198#define WRITE_REG(REG, VAL) ((REG) = (VAL))
200#define READ_REG(REG) ((REG))
202#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
204#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
208#define ATOMIC_SET_BIT(REG, BIT) \
212 val = __LDREXW((__IO uint32_t *)&(REG)) | (BIT); \
213 } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
217#define ATOMIC_CLEAR_BIT(REG, BIT) \
221 val = __LDREXW((__IO uint32_t *)&(REG)) & ~(BIT); \
222 } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
226#define ATOMIC_MODIFY_REG(REG, CLEARMSK, SETMASK) \
230 val = (__LDREXW((__IO uint32_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
231 } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
235#define ATOMIC_SETH_BIT(REG, BIT) \
239 val = __LDREXH((__IO uint16_t *)&(REG)) | (BIT); \
240 } while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
244#define ATOMIC_CLEARH_BIT(REG, BIT) \
248 val = __LDREXH((__IO uint16_t *)&(REG)) & ~(BIT); \
249 } while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
253#define ATOMIC_MODIFYH_REG(REG, CLEARMSK, SETMASK) \
257 val = (__LDREXH((__IO uint16_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
258 } while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
265#if defined (USE_HAL_DRIVER)
ErrorStatus
Definition: stm32f3xx.h:177
FlagStatus
Definition: stm32f3xx.h:164
FunctionalState
Definition: stm32f3xx.h:170
@ ERROR
Definition: stm32f3xx.h:179
@ SUCCESS
Definition: stm32f3xx.h:178
@ RESET
Definition: stm32f3xx.h:165
@ SET
Definition: stm32f3xx.h:166
@ ENABLE
Definition: stm32f3xx.h:172
@ DISABLE
Definition: stm32f3xx.h:171
CMSIS STM32F303xE Devices Peripheral Access Layer Header File.
This file contains all the functions prototypes for the HAL module driver.