9#ifndef ZEPHYR_INCLUDE_ARCH_COMMON_SYS_BITOPS_H_
10#define ZEPHYR_INCLUDE_ARCH_COMMON_SYS_BITOPS_H_
31 *(
volatile uint32_t *)addr = temp | (1U << bit);
38 *(
volatile uint32_t *)addr = temp & ~(1U << bit);
45 return temp & (1U << bit);
52 *(
volatile uint32_t *)addr = temp | mask;
59 *(
volatile uint32_t *)addr = temp & ~mask;
80 return sys_test_bit(addr + ((bit >> 5) << 2), bit & 0x1F);
uintptr_t mem_addr_t
Memory address.
Definition sys_io.h:41
static ALWAYS_INLINE int sys_test_and_set_bit(mem_addr_t addr, unsigned int bit)
Test the bit and set it.
static ALWAYS_INLINE void sys_set_bit(mem_addr_t addr, unsigned int bit)
Set the designated bit from addr to 1.
static ALWAYS_INLINE int sys_bitfield_test_bit(mem_addr_t addr, unsigned int bit)
Test the bit if it is set or not.
static ALWAYS_INLINE void sys_clear_bit(mem_addr_t addr, unsigned int bit)
Clear the designated bit from addr to 0.
static ALWAYS_INLINE int sys_test_bit(mem_addr_t addr, unsigned int bit)
Test the bit if it is set or not.
static ALWAYS_INLINE void sys_bitfield_set_bit(mem_addr_t addr, unsigned int bit)
Set the designated bit from addr to 1.
static ALWAYS_INLINE void sys_clear_bits(mem_addr_t addr, unsigned int mask)
Masking the designated bits from addr to 0.
static ALWAYS_INLINE int sys_bitfield_test_and_clear_bit(mem_addr_t addr, unsigned int bit)
Test the bit and clear it.
static ALWAYS_INLINE int sys_bitfield_test_and_set_bit(mem_addr_t addr, unsigned int bit)
Test the bit and set it.
static ALWAYS_INLINE int sys_test_and_clear_bit(mem_addr_t addr, unsigned int bit)
Test the bit and clear it.
static ALWAYS_INLINE void sys_bitfield_clear_bit(mem_addr_t addr, unsigned int bit)
Clear the designated bit from addr to 0.
static ALWAYS_INLINE void sys_set_bits(mem_addr_t addr, unsigned int mask)
Masking the designated bits from addr to 1.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Header file for port, memory-mapped register, and memory bit manipulation APIs.