19 #ifndef ATOMIC_UTILS_ARCH_H
20 #define ATOMIC_UTILS_ARCH_H
22 #include "periph_cpu.h"
33 #define HAS_ATOMIC_LOAD_U8
36 return __atomic_load_1(var, __ATOMIC_SEQ_CST);
39 #define HAS_ATOMIC_LOAD_U16
42 return __atomic_load_2(var, __ATOMIC_SEQ_CST);
45 #define HAS_ATOMIC_LOAD_U32
48 return __atomic_load_4(var, __ATOMIC_SEQ_CST);
51 #define HAS_ATOMIC_STORE_U8
54 __atomic_store_1(dest, val, __ATOMIC_SEQ_CST);
57 #define HAS_ATOMIC_STORE_U16
60 __atomic_store_2(dest, val, __ATOMIC_SEQ_CST);
63 #define HAS_ATOMIC_STORE_U32
66 __atomic_store_4(dest, val, __ATOMIC_SEQ_CST);
static void atomic_store_u8(volatile uint8_t *dest, uint8_t val)
Store an uint8_t atomically.
static uint32_t atomic_load_u32(const volatile uint32_t *var)
Load an uint32_t atomically.
static uint16_t atomic_load_u16(const volatile uint16_t *var)
Load an uint16_t atomically.
static uint8_t atomic_load_u8(const volatile uint8_t *var)
Load an uint8_t atomically.
static void atomic_store_u16(volatile uint16_t *dest, uint16_t val)
Store an uint16_t atomically.
static void atomic_store_u32(volatile uint32_t *dest, uint32_t val)
Store an uint32_t atomically.