31 #if !BITBAND_FUNCTIONS_PROVIDED
35 #define CPU_HAS_BITBAND 1 || 0 (1 for Cortex-M3 and up, 0 for Cortex-M0)
38 #if CPU_HAS_BITBAND || DOXYGEN
54 static inline volatile void *
bitband_addr(
volatile void *ptr, uintptr_t bit)
56 return (
volatile void *)((((uintptr_t)ptr) & 0xF0000000ul) + 0x2000000ul +
57 ((((uintptr_t)ptr) & 0xFFFFFul) << 5) + (bit << 2));
75 static inline void bit_set32(
volatile uint32_t *ptr, uint8_t bit)
95 static inline void bit_set16(
volatile uint16_t *ptr, uint8_t bit)
115 static inline void bit_set8(
volatile uint8_t *ptr, uint8_t bit)
135 static inline void bit_clear32(
volatile uint32_t *ptr, uint8_t bit)
155 static inline void bit_clear16(
volatile uint16_t *ptr, uint8_t bit)
175 static inline void bit_clear8(
volatile uint8_t *ptr, uint8_t bit)
184 static inline void bit_set32(
volatile uint32_t *ptr, uint8_t bit)
186 *ptr |= (1 << (bit));
189 static inline void bit_set16(
volatile uint16_t *ptr, uint8_t bit)
191 *ptr |= (1 << (bit));
194 static inline void bit_set8(
volatile uint8_t *ptr, uint8_t bit)
196 *ptr |= (1 << (bit));
199 static inline void bit_clear32(
volatile uint32_t *ptr, uint8_t bit)
201 *ptr &= ~(1 << (bit));
204 static inline void bit_clear16(
volatile uint16_t *ptr, uint8_t bit)
206 *ptr &= ~(1 << (bit));
209 static inline void bit_clear8(
volatile uint8_t *ptr, uint8_t bit)
211 *ptr &= ~(1 << (bit));