| | |
| | | */ |
| | | #define __STM32L0xx_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */ |
| | | #define __STM32L0xx_CMSIS_VERSION_SUB1 (0x09) /*!< [23:16] sub1 version */ |
| | | #define __STM32L0xx_CMSIS_VERSION_SUB2 (0x01) /*!< [15:8] sub2 version */ |
| | | #define __STM32L0xx_CMSIS_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */ |
| | | #define __STM32L0xx_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */ |
| | | #define __STM32L0xx_CMSIS_VERSION ((__STM32L0xx_CMSIS_VERSION_MAIN << 24)\ |
| | | |(__STM32L0xx_CMSIS_VERSION_SUB1 << 16)\ |
| | |
| | | |
| | | #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK))) |
| | | |
| | | /* Use of interrupt control for register exclusive access */ |
| | | /* Atomic 32-bit register access macro to set one or several bits */ |
| | | #define ATOMIC_SET_BIT(REG, BIT) \ |
| | | do { \ |
| | | uint32_t primask; \ |
| | | primask = __get_PRIMASK(); \ |
| | | __set_PRIMASK(1); \ |
| | | SET_BIT((REG), (BIT)); \ |
| | | __set_PRIMASK(primask); \ |
| | | } while(0) |
| | | |
| | | /* Atomic 32-bit register access macro to clear one or several bits */ |
| | | #define ATOMIC_CLEAR_BIT(REG, BIT) \ |
| | | do { \ |
| | | uint32_t primask; \ |
| | | primask = __get_PRIMASK(); \ |
| | | __set_PRIMASK(1); \ |
| | | CLEAR_BIT((REG), (BIT)); \ |
| | | __set_PRIMASK(primask); \ |
| | | } while(0) |
| | | |
| | | /* Atomic 32-bit register access macro to clear and set one or several bits */ |
| | | #define ATOMIC_MODIFY_REG(REG, CLEARMSK, SETMASK) \ |
| | | do { \ |
| | | uint32_t primask; \ |
| | | primask = __get_PRIMASK(); \ |
| | | __set_PRIMASK(1); \ |
| | | MODIFY_REG((REG), (CLEARMSK), (SETMASK)); \ |
| | | __set_PRIMASK(primask); \ |
| | | } while(0) |
| | | |
| | | /* Atomic 16-bit register access macro to set one or several bits */ |
| | | #define ATOMIC_SETH_BIT(REG, BIT) ATOMIC_SET_BIT(REG, BIT) \ |
| | | |
| | | /* Atomic 16-bit register access macro to clear one or several bits */ |
| | | #define ATOMIC_CLEARH_BIT(REG, BIT) ATOMIC_CLEAR_BIT(REG, BIT) \ |
| | | |
| | | /* Atomic 16-bit register access macro to clear and set one or several bits */ |
| | | #define ATOMIC_MODIFYH_REG(REG, CLEARMSK, SETMASK) ATOMIC_MODIFY_REG(REG, CLEARMSK, SETMASK) \ |
| | | |
| | | /** |
| | | * @} |
| | | */ |