This module implements C11 stdatomic.h simplified API. More...
Typedefs | |
typedef volatile uint32_t | nrfx_atomic_u32_t |
Atomic 32-bit unsigned type. | |
typedef volatile uint32_t | nrfx_atomic_flag_t |
Atomic 1-bit flag type (technically 32-bit). | |
Functions | |
uint32_t | nrfx_atomic_u32_fetch_store (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for storing a value to an atomic object and returning its previous value. | |
uint32_t | nrfx_atomic_u32_store (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for storing a value to an atomic object and returning its new value. | |
uint32_t | nrfx_atomic_u32_fetch_or (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running a logical OR operation on an atomic object and returning its previous value. | |
uint32_t | nrfx_atomic_u32_or (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running a logical OR operation on an atomic object and returning its new value. | |
uint32_t | nrfx_atomic_u32_fetch_and (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running a logical AND operation on an atomic object and returning its previous value. | |
uint32_t | nrfx_atomic_u32_and (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running a logical AND operation on an atomic object and returning its new value. | |
uint32_t | nrfx_atomic_u32_fetch_xor (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running a logical XOR operation on an atomic object and returning its previous value. | |
uint32_t | nrfx_atomic_u32_xor (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running a logical XOR operation on an atomic object and returning its new value. | |
uint32_t | nrfx_atomic_u32_fetch_add (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running an arithmetic ADD operation on an atomic object and returning its previous value. | |
uint32_t | nrfx_atomic_u32_add (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running an arithmetic ADD operation on an atomic object and returning its new value. | |
uint32_t | nrfx_atomic_u32_fetch_sub (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running an arithmetic SUB operation on an atomic object and returning its previous value. | |
uint32_t | nrfx_atomic_u32_sub (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running an arithmetic SUB operation on an atomic object and returning its new value. | |
bool | nrfx_atomic_u32_cmp_exch (nrfx_atomic_u32_t *p_data, uint32_t *p_expected, uint32_t desired) |
Function for atomic conditional value replacement. | |
uint32_t | nrfx_atomic_u32_fetch_sub_hs (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running an arithmetic SUB operation on an atomic object if object >= value, and returning its previous value. | |
uint32_t | nrfx_atomic_u32_sub_hs (nrfx_atomic_u32_t *p_data, uint32_t value) |
Function for running an arithmetic SUB operation on an atomic object if object >= value, and returning its new value. | |
uint32_t | nrfx_atomic_flag_set_fetch (nrfx_atomic_flag_t *p_data) |
Function for running a logical one bit flag set operation on an atomic object and returning its previous value. | |
uint32_t | nrfx_atomic_flag_set (nrfx_atomic_flag_t *p_data) |
Function for running a logical one bit flag set operation on an atomic object and returning its new value. | |
uint32_t | nrfx_atomic_flag_clear_fetch (nrfx_atomic_flag_t *p_data) |
Function for running a logical one bit flag clear operation on an atomic object and returning its previous value. | |
uint32_t | nrfx_atomic_flag_clear (nrfx_atomic_flag_t *p_data) |
Function for running a logical one bit flag clear operation on an atomic object and returning its new value. | |
This module implements C11 stdatomic.h simplified API.
At this point, only Cortex-M3 and M4 cores are supported (LDREX/STREX instructions). Atomic types are limited to nrfx_atomic_u32_t and nrfx_atomic_flag_t.
uint32_t nrfx_atomic_flag_clear | ( | nrfx_atomic_flag_t * | p_data | ) |
Function for running a logical one bit flag clear operation on an atomic object and returning its new value.
[in] | p_data | Atomic flag memory pointer. |
uint32_t nrfx_atomic_flag_clear_fetch | ( | nrfx_atomic_flag_t * | p_data | ) |
Function for running a logical one bit flag clear operation on an atomic object and returning its previous value.
[in] | p_data | Atomic flag memory pointer. |
uint32_t nrfx_atomic_flag_set | ( | nrfx_atomic_flag_t * | p_data | ) |
Function for running a logical one bit flag set operation on an atomic object and returning its new value.
[in] | p_data | Atomic flag memory pointer. |
uint32_t nrfx_atomic_flag_set_fetch | ( | nrfx_atomic_flag_t * | p_data | ) |
Function for running a logical one bit flag set operation on an atomic object and returning its previous value.
[in] | p_data | Atomic flag memory pointer. |
uint32_t nrfx_atomic_u32_add | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running an arithmetic ADD operation on an atomic object and returning its new value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the ADD operation. |
uint32_t nrfx_atomic_u32_and | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running a logical AND operation on an atomic object and returning its new value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the AND operation. |
bool nrfx_atomic_u32_cmp_exch | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t * | p_expected, | ||
uint32_t | desired | ||
) |
Function for atomic conditional value replacement.
Atomically compares the value pointed to by p_data
with the value pointed to by p_expected
. If those are equal, replaces the former with desired. Otherwise, loads the actual value pointed to by p_data
into *p_expected
.
p_data | Atomic memory pointer to test and modify. |
p_expected | Pointer to the test value. |
desired | Value to be stored to atomic memory. |
true | *p_data was equal to *p_expected . |
false | *p_data was not equal to *p_expected . |
uint32_t nrfx_atomic_u32_fetch_add | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running an arithmetic ADD operation on an atomic object and returning its previous value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the ADD operation. |
uint32_t nrfx_atomic_u32_fetch_and | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running a logical AND operation on an atomic object and returning its previous value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the AND operation. |
uint32_t nrfx_atomic_u32_fetch_or | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running a logical OR operation on an atomic object and returning its previous value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the OR operation. |
uint32_t nrfx_atomic_u32_fetch_store | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for storing a value to an atomic object and returning its previous value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value to store. |
uint32_t nrfx_atomic_u32_fetch_sub | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running an arithmetic SUB operation on an atomic object and returning its previous value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the SUB operation. |
uint32_t nrfx_atomic_u32_fetch_sub_hs | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running an arithmetic SUB operation on an atomic object if object >= value, and returning its previous value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the SUB operation. |
uint32_t nrfx_atomic_u32_fetch_xor | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running a logical XOR operation on an atomic object and returning its previous value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the XOR operation. |
uint32_t nrfx_atomic_u32_or | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running a logical OR operation on an atomic object and returning its new value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the OR operation. |
uint32_t nrfx_atomic_u32_store | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for storing a value to an atomic object and returning its new value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value to store. |
uint32_t nrfx_atomic_u32_sub | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running an arithmetic SUB operation on an atomic object and returning its new value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the SUB operation. |
uint32_t nrfx_atomic_u32_sub_hs | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running an arithmetic SUB operation on an atomic object if object >= value, and returning its new value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the SUB operation. |
uint32_t nrfx_atomic_u32_xor | ( | nrfx_atomic_u32_t * | p_data, |
uint32_t | value | ||
) |
Function for running a logical XOR operation on an atomic object and returning its new value.
[in] | p_data | Atomic memory pointer. |
[in] | value | Value of the second operand in the XOR operation. |