Helper functions for atomic register operations.
More...
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"
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. More...
|
|
static void | atomic_set (volatile uint32_t *reg, uint32_t val) |
| Set bits in a register atomically. More...
|
|
static void | atomic_clear (volatile uint32_t *reg, uint32_t val) |
| Clear bits in a register atomically. More...
|
|
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. More...
|
|
◆ atomic_clear()
static void atomic_clear |
( |
volatile uint32_t * |
reg, |
|
|
uint32_t |
val |
|
) |
| |
|
inlinestatic |
Clear bits in a register atomically.
- Parameters
-
[in,out] | reg | Pointer to the target register |
[in] | val | Bit 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] | reg | Pointer to the target register |
[in] | val | Bit 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] | reg | Pointer to the target register |
[in] | val | Value 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_value | Bit mask of the reset bits to clear |
reset_done_value | Bit mask of the reset done bits to wait for |
Definition at line 68 of file helpers.h.