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

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 172 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 233 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 294 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 116 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 220 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 281 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 342 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 160 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 196 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 257 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 318 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 138 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 184 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 245 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 306 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 127 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 208 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 269 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 330 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 149 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 51 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 60 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 69 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 42 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 88 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 97 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 106 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 79 of file volatile_utils.h.