123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
-
- #ifndef __STM32F2xx_H
- #define __STM32F2xx_H
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if !defined (STM32F2)
- #define STM32F2
- #endif
-
- #if !defined (STM32F205xx) && !defined (STM32F215xx) && !defined (STM32F207xx) && !defined (STM32F217xx)
-
-
-
-
-
- #endif
-
- #if !defined (USE_HAL_DRIVER)
-
- #endif
- #define __STM32F2xx_CMSIS_VERSION_MAIN (0x02U)
- #define __STM32F2xx_CMSIS_VERSION_SUB1 (0x02U)
- #define __STM32F2xx_CMSIS_VERSION_SUB2 (0x03U)
- #define __STM32F2xx_CMSIS_VERSION_RC (0x00U)
- #define __STM32F2xx_CMSIS_VERSION ((__STM32F2xx_CMSIS_VERSION_MAIN << 24)\
- |(__STM32F2xx_CMSIS_VERSION_SUB1 << 16)\
- |(__STM32F2xx_CMSIS_VERSION_SUB2 << 8 )\
- |(__STM32F2xx_CMSIS_VERSION))
- #if defined(STM32F205xx)
- #include "stm32f205xx.h"
- #elif defined(STM32F215xx)
- #include "stm32f215xx.h"
- #elif defined(STM32F207xx)
- #include "stm32f207xx.h"
- #elif defined(STM32F217xx)
- #include "stm32f217xx.h"
- #else
- #error "Please select first the target STM32F2xx device used in your application (in stm32f2xx.h file)"
- #endif
-
- typedef enum
- {
- RESET = 0U,
- SET = !RESET
- } FlagStatus, ITStatus;
- typedef enum
- {
- DISABLE = 0U,
- ENABLE = !DISABLE
- } FunctionalState;
- #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
- typedef enum
- {
- SUCCESS = 0U,
- ERROR = !SUCCESS
- } ErrorStatus;
- #define SET_BIT(REG, BIT) ((REG) |= (BIT))
- #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
- #define READ_BIT(REG, BIT) ((REG) & (BIT))
- #define CLEAR_REG(REG) ((REG) = (0x0))
- #define WRITE_REG(REG, VAL) ((REG) = (VAL))
- #define READ_REG(REG) ((REG))
- #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
- #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
-
- #if defined (USE_HAL_DRIVER)
- #include "stm32f2xx_hal.h"
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
-
|