Helpers for volatile accesses

Detailed Description

Files

file  volatile_utils.h
 Utility functions for non-atomic but volatile access.
 

Functions

static uint8_t volatile_load_u8 (const volatile uint8_t *var)
 Load an 8 bit value completely unoptimized. More...
 
static uint16_t volatile_load_u16 (const volatile uint16_t *var)
 Load an 16 bit value completely unoptimized. More...
 
static uint32_t volatile_load_u32 (const volatile uint32_t *var)
 Load an 32 bit value completely unoptimized. More...
 
static uint64_t volatile_load_u64 (const volatile uint64_t *var)
 Load an 64 bit value completely unoptimized. More...
 
static void volatile_store_u8 (volatile uint8_t *dest, uint8_t val)
 Store an 8 bit value completely unoptimized. More...
 
static void volatile_store_u16 (volatile uint16_t *dest, uint16_t val)
 Store a 16 bit value completely unoptimized. More...
 
static void volatile_store_u32 (volatile uint32_t *dest, uint32_t val)
 Store a 32 bit value completely unoptimized. More...
 
static void volatile_store_u64 (volatile uint64_t *dest, uint64_t val)
 Store a 64 bit value completely unoptimized. More...
 
static uint8_t volatile_fetch_add_u8 (volatile uint8_t *dest, uint8_t val)
 Unoptimized version of *dest += val More...
 
static uint8_t volatile_fetch_sub_u8 (volatile uint8_t *dest, uint8_t val)
 Unoptimized version of *dest -= val More...
 
static uint8_t volatile_fetch_or_u8 (volatile uint8_t *dest, uint8_t val)
 Unoptimized version of *dest |= val More...
 
static uint8_t volatile_fetch_xor_u8 (volatile uint8_t *dest, uint8_t val)
 Unoptimized version of *dest ^= val More...
 
static uint8_t volatile_fetch_and_u8 (volatile uint8_t *dest, uint8_t val)
 Unoptimized version of *dest &= val More...
 
static uint16_t volatile_fetch_add_u16 (volatile uint16_t *dest, uint16_t val)
 Unoptimized version of *dest += val More...
 
static uint16_t volatile_fetch_sub_u16 (volatile uint16_t *dest, uint16_t val)
 Unoptimized version of *dest -= val More...
 
static uint16_t volatile_fetch_or_u16 (volatile uint16_t *dest, uint16_t val)
 Unoptimized version of *dest |= val More...
 
static uint16_t volatile_fetch_xor_u16 (volatile uint16_t *dest, uint16_t val)
 Unoptimized version of *dest ^= val More...
 
static uint16_t volatile_fetch_and_u16 (volatile uint16_t *dest, uint16_t val)
 Unoptimized version of *dest &= val More...
 
static uint32_t volatile_fetch_add_u32 (volatile uint32_t *dest, uint32_t val)
 Unoptimized version of *dest += val More...
 
static uint32_t volatile_fetch_sub_u32 (volatile uint32_t *dest, uint32_t val)
 Unoptimized version of *dest -= val More...
 
static uint32_t volatile_fetch_or_u32 (volatile uint32_t *dest, uint32_t val)
 Unoptimized version of *dest |= val More...
 
static uint32_t volatile_fetch_xor_u32 (volatile uint32_t *dest, uint32_t val)
 Unoptimized version of *dest ^= val More...
 
static uint32_t volatile_fetch_and_u32 (volatile uint32_t *dest, uint32_t val)
 Unoptimized version of *dest &= val More...
 
static uint64_t volatile_fetch_add_u64 (volatile uint64_t *dest, uint64_t val)
 Unoptimized version of *dest += val More...
 
static uint64_t volatile_fetch_sub_u64 (volatile uint64_t *dest, uint64_t val)
 Unoptimized version of *dest -= val More...
 
static uint64_t volatile_fetch_or_u64 (volatile uint64_t *dest, uint64_t val)
 Unoptimized version of *dest |= val More...
 
static uint64_t volatile_fetch_xor_u64 (volatile uint64_t *dest, uint64_t val)
 Unoptimized version of *dest ^= val More...
 
static uint64_t volatile_fetch_and_u64 (volatile uint64_t *dest, uint64_t val)
 Unoptimized version of *dest &= val More...
 

Function Documentation

◆ volatile_fetch_add_u16()

static uint16_t volatile_fetch_add_u16 ( volatile uint16_t *  dest,
uint16_t  val 
)
inlinestatic

Unoptimized version of *dest += val

Parameters
destAddress of the value to add to
valValue to add

Definition at line 168 of file volatile_utils.h.

◆ volatile_fetch_add_u32()

static uint32_t volatile_fetch_add_u32 ( volatile uint32_t *  dest,
uint32_t  val 
)
inlinestatic

Unoptimized version of *dest += val

Parameters
destAddress of the value to add to
valValue to add

Definition at line 229 of file volatile_utils.h.

◆ volatile_fetch_add_u64()

static uint64_t volatile_fetch_add_u64 ( volatile uint64_t *  dest,
uint64_t  val 
)
inlinestatic

Unoptimized version of *dest += val

Parameters
destAddress of the value to add to
valValue to add

Definition at line 290 of file volatile_utils.h.

◆ volatile_fetch_add_u8()

static uint8_t volatile_fetch_add_u8 ( volatile uint8_t *  dest,
uint8_t  val 
)
inlinestatic

Unoptimized version of *dest += val

Parameters
destAddress of the value to add to
valValue to add

Definition at line 112 of file volatile_utils.h.

◆ volatile_fetch_and_u16()

static uint16_t volatile_fetch_and_u16 ( volatile uint16_t *  dest,
uint16_t  val 
)
inlinestatic

Unoptimized version of *dest &= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 216 of file volatile_utils.h.

◆ volatile_fetch_and_u32()

static uint32_t volatile_fetch_and_u32 ( volatile uint32_t *  dest,
uint32_t  val 
)
inlinestatic

Unoptimized version of *dest &= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 277 of file volatile_utils.h.

◆ volatile_fetch_and_u64()

static uint64_t volatile_fetch_and_u64 ( volatile uint64_t *  dest,
uint64_t  val 
)
inlinestatic

Unoptimized version of *dest &= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 338 of file volatile_utils.h.

◆ volatile_fetch_and_u8()

static uint8_t volatile_fetch_and_u8 ( volatile uint8_t *  dest,
uint8_t  val 
)
inlinestatic

Unoptimized version of *dest &= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 156 of file volatile_utils.h.

◆ volatile_fetch_or_u16()

static uint16_t volatile_fetch_or_u16 ( volatile uint16_t *  dest,
uint16_t  val 
)
inlinestatic

Unoptimized version of *dest |= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 192 of file volatile_utils.h.

◆ volatile_fetch_or_u32()

static uint32_t volatile_fetch_or_u32 ( volatile uint32_t *  dest,
uint32_t  val 
)
inlinestatic

Unoptimized version of *dest |= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 253 of file volatile_utils.h.

◆ volatile_fetch_or_u64()

static uint64_t volatile_fetch_or_u64 ( volatile uint64_t *  dest,
uint64_t  val 
)
inlinestatic

Unoptimized version of *dest |= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 314 of file volatile_utils.h.

◆ volatile_fetch_or_u8()

static uint8_t volatile_fetch_or_u8 ( volatile uint8_t *  dest,
uint8_t  val 
)
inlinestatic

Unoptimized version of *dest |= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 134 of file volatile_utils.h.

◆ volatile_fetch_sub_u16()

static uint16_t volatile_fetch_sub_u16 ( volatile uint16_t *  dest,
uint16_t  val 
)
inlinestatic

Unoptimized version of *dest -= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 180 of file volatile_utils.h.

◆ volatile_fetch_sub_u32()

static uint32_t volatile_fetch_sub_u32 ( volatile uint32_t *  dest,
uint32_t  val 
)
inlinestatic

Unoptimized version of *dest -= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 241 of file volatile_utils.h.

◆ volatile_fetch_sub_u64()

static uint64_t volatile_fetch_sub_u64 ( volatile uint64_t *  dest,
uint64_t  val 
)
inlinestatic

Unoptimized version of *dest -= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 302 of file volatile_utils.h.

◆ volatile_fetch_sub_u8()

static uint8_t volatile_fetch_sub_u8 ( volatile uint8_t *  dest,
uint8_t  val 
)
inlinestatic

Unoptimized version of *dest -= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 123 of file volatile_utils.h.

◆ volatile_fetch_xor_u16()

static uint16_t volatile_fetch_xor_u16 ( volatile uint16_t *  dest,
uint16_t  val 
)
inlinestatic

Unoptimized version of *dest ^= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 204 of file volatile_utils.h.

◆ volatile_fetch_xor_u32()

static uint32_t volatile_fetch_xor_u32 ( volatile uint32_t *  dest,
uint32_t  val 
)
inlinestatic

Unoptimized version of *dest ^= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 265 of file volatile_utils.h.

◆ volatile_fetch_xor_u64()

static uint64_t volatile_fetch_xor_u64 ( volatile uint64_t *  dest,
uint64_t  val 
)
inlinestatic

Unoptimized version of *dest ^= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 326 of file volatile_utils.h.

◆ volatile_fetch_xor_u8()

static uint8_t volatile_fetch_xor_u8 ( volatile uint8_t *  dest,
uint8_t  val 
)
inlinestatic

Unoptimized version of *dest ^= val

Parameters
destAddress of the value to apply the operation on
valSecond operand

Definition at line 145 of file volatile_utils.h.

◆ volatile_load_u16()

static uint16_t volatile_load_u16 ( const volatile uint16_t *  var)
inlinestatic

Load an 16 bit value completely unoptimized.

Parameters
varAddress to load the value from
Returns
The value read unoptimized from address var

Definition at line 47 of file volatile_utils.h.

◆ volatile_load_u32()

static uint32_t volatile_load_u32 ( const volatile uint32_t *  var)
inlinestatic

Load an 32 bit value completely unoptimized.

Parameters
varAddress to load the value from
Returns
The value read unoptimized from address var

Definition at line 56 of file volatile_utils.h.

◆ volatile_load_u64()

static uint64_t volatile_load_u64 ( const volatile uint64_t *  var)
inlinestatic

Load an 64 bit value completely unoptimized.

Parameters
varAddress to load the value from
Returns
The value read unoptimized from address var

Definition at line 65 of file volatile_utils.h.

◆ volatile_load_u8()

static uint8_t volatile_load_u8 ( const volatile uint8_t *  var)
inlinestatic

Load an 8 bit value completely unoptimized.

Parameters
varAddress to load the value from
Returns
The value read unoptimized from address var

Definition at line 38 of file volatile_utils.h.

◆ volatile_store_u16()

static void volatile_store_u16 ( volatile uint16_t *  dest,
uint16_t  val 
)
inlinestatic

Store a 16 bit value completely unoptimized.

Parameters
destAddress to write the given value unoptimized to
valValue to write unoptimized

Definition at line 84 of file volatile_utils.h.

◆ volatile_store_u32()

static void volatile_store_u32 ( volatile uint32_t *  dest,
uint32_t  val 
)
inlinestatic

Store a 32 bit value completely unoptimized.

Parameters
destAddress to write the given value unoptimized to
valValue to write unoptimized

Definition at line 93 of file volatile_utils.h.

◆ volatile_store_u64()

static void volatile_store_u64 ( volatile uint64_t *  dest,
uint64_t  val 
)
inlinestatic

Store a 64 bit value completely unoptimized.

Parameters
destAddress to write the given value unoptimized to
valValue to write unoptimized

Definition at line 102 of file volatile_utils.h.

◆ volatile_store_u8()

static void volatile_store_u8 ( volatile uint8_t *  dest,
uint8_t  val 
)
inlinestatic

Store an 8 bit value completely unoptimized.

Parameters
destAddress to write the given value unoptimized to
valValue to write unoptimized

Definition at line 75 of file volatile_utils.h.