Loading...
Searching...
No Matches
helpers.h File Reference

Helper functions for atomic register operations. More...

Detailed Description

Helper functions for atomic register operations.

Author
Tom Hert git@a.nosp@m.nnsa.nosp@m.nn.eu

Definition in file helpers.h.

#include "RP2350.h"
+ Include dependency graph for helpers.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define ATOMIC_XOR_WRITE   0x1000u
 Bit to be set for an atomic XOR operation.
 
#define ATOMIC_BITMASK_SET_WRITE   0x2000u
 Bit to be set for an atomic set operation.
 
#define ATOMIC_BITMASK_CLEAR_WRITE   0x3000u
 Bits to be set for an atomic clear operation.
 
static void atomic_xor (volatile uint32_t *reg, uint32_t val)
 Perform an atomic XOR write to a register.
 
static void atomic_set (volatile uint32_t *reg, uint32_t val)
 Set bits in a register atomically.
 
static void atomic_clear (volatile uint32_t *reg, uint32_t val)
 Clear bits in a register atomically.
 
static void reset_component (uint32_t reset_value, uint32_t reset_done_value)
 Reset a component by clearing its reset bits and waiting for the reset to complete.
 

Macro Definition Documentation

◆ ATOMIC_BITMASK_CLEAR_WRITE

#define ATOMIC_BITMASK_CLEAR_WRITE   0x3000u

Bits to be set for an atomic clear operation.

Definition at line 26 of file helpers.h.

◆ ATOMIC_BITMASK_SET_WRITE

#define ATOMIC_BITMASK_SET_WRITE   0x2000u

Bit to be set for an atomic set operation.

Definition at line 24 of file helpers.h.

◆ ATOMIC_XOR_WRITE

#define ATOMIC_XOR_WRITE   0x1000u

Bit to be set for an atomic XOR operation.

Definition at line 22 of file helpers.h.

Function Documentation

◆ atomic_clear()

static void atomic_clear ( volatile uint32_t * reg,
uint32_t val )
inlinestatic

Clear bits in a register atomically.

Parameters
[in,out]regPointer to the target register
[in]valBit mask of bits to clear

Definition at line 58 of file helpers.h.

◆ atomic_set()

static void atomic_set ( volatile uint32_t * reg,
uint32_t val )
inlinestatic

Set bits in a register atomically.

Parameters
[in,out]regPointer to the target register
[in]valBit mask of bits to set

Definition at line 48 of file helpers.h.

◆ atomic_xor()

static void atomic_xor ( volatile uint32_t * reg,
uint32_t val )
inlinestatic

Perform an atomic XOR write to a register.

Parameters
[in,out]regPointer to the target register
[in]valValue to be XORed with the register

Definition at line 38 of file helpers.h.

◆ reset_component()

static void reset_component ( uint32_t reset_value,
uint32_t reset_done_value )
inlinestatic

Reset a component by clearing its reset bits and waiting for the reset to complete.

Parameters
reset_valueBit mask of the reset bits to clear
reset_done_valueBit mask of the reset done bits to wait for

Definition at line 68 of file helpers.h.