28#if !BITBAND_FUNCTIONS_PROVIDED
34#define CPU_HAS_BITBAND 1 || 0 (1 if CPU implements bit-banding, 0 if not)
46#define CPU_HAS_SRAM_BITBAND 1 || 0
49#if CPU_HAS_BITBAND || DOXYGEN
52#ifndef CPU_HAS_SRAM_BITBAND
53#define CPU_HAS_SRAM_BITBAND 1
71static inline volatile void *
bitband_addr(
volatile void *ptr, uintptr_t bit)
73 return (
volatile void *)((((uintptr_t)ptr) & 0xF0000000ul) + 0x2000000ul +
74 ((((uintptr_t)ptr) & 0xFFFFFul) << 5) + (bit << 2));
92static inline void bit_set32(
volatile uint32_t *ptr, uint8_t bit)
112static inline void bit_set16(
volatile uint16_t *ptr, uint8_t bit)
132static inline void bit_set8(
volatile uint8_t *ptr, uint8_t bit)
152static inline void bit_clear32(
volatile uint32_t *ptr, uint8_t bit)
172static inline void bit_clear16(
volatile uint16_t *ptr, uint8_t bit)
192static inline void bit_clear8(
volatile uint8_t *ptr, uint8_t bit)
209static inline bool bit_check32(
volatile uint32_t *ptr, uint8_t bit)
226static inline bool bit_check16(
volatile uint16_t *ptr, uint8_t bit)
243static inline bool bit_check8(
volatile uint8_t *ptr, uint8_t bit)
252static inline void bit_set32(
volatile uint32_t *ptr, uint8_t bit)
254 *ptr |= (1 << (bit));
257static inline void bit_set16(
volatile uint16_t *ptr, uint8_t bit)
259 *ptr |= (1 << (bit));
262static inline void bit_set8(
volatile uint8_t *ptr, uint8_t bit)
264 *ptr |= (1 << (bit));
267static inline void bit_clear32(
volatile uint32_t *ptr, uint8_t bit)
269 *ptr &= ~(1 << (bit));
272static inline void bit_clear16(
volatile uint16_t *ptr, uint8_t bit)
274 *ptr &= ~(1 << (bit));
277static inline void bit_clear8(
volatile uint8_t *ptr, uint8_t bit)
279 *ptr &= ~(1 << (bit));
282static inline bool bit_check32(
volatile uint32_t *ptr, uint8_t bit)
284 return *ptr & (1 << bit);
287static inline bool bit_check16(
volatile uint16_t *ptr, uint8_t bit)
289 return *ptr & (1 << bit);
292static inline bool bit_check8(
volatile uint8_t *ptr, uint8_t bit)
294 return *ptr & (1 << bit);
static void bit_clear8(volatile uint8_t *ptr, uint8_t bit)
Clear a single bit in the 8 bit byte pointed to by ptr.
static void bit_set16(volatile uint16_t *ptr, uint8_t bit)
Set a single bit in the 16 bit word pointed to by ptr.
static void bit_clear32(volatile uint32_t *ptr, uint8_t bit)
Clear a single bit in the 32 bit word pointed to by ptr.
static bool bit_check16(volatile uint16_t *ptr, uint8_t bit)
Checks if a single bit in the 16 bit word pointed to by ptr is set.
static void bit_set8(volatile uint8_t *ptr, uint8_t bit)
Set a single bit in the 8 bit byte pointed to by ptr.
static void bit_set32(volatile uint32_t *ptr, uint8_t bit)
Set a single bit in the 32 bit word pointed to by ptr.
static bool bit_check8(volatile uint8_t *ptr, uint8_t bit)
Checks if a single bit in the 8 bit byte pointed to by ptr is set.
static bool bit_check32(volatile uint32_t *ptr, uint8_t bit)
Checks if a single bit in the 32 bit word pointed to by ptr is set.
static void bit_clear16(volatile uint16_t *ptr, uint8_t bit)
Clear a single bit in the 16 bit word pointed to by ptr.
static volatile void * bitband_addr(volatile void *ptr, uintptr_t bit)
Convert bit band region address and bit number to bit band alias address.