Common module. More...
Macros | |
#define | NRFX_CHECK(module_enabled) (module_enabled) |
Macro for checking if the specified identifier is defined and it has a non-zero value. More... | |
#define | NRFX_CONCAT_2(p1, p2) NRFX_CONCAT_2_(p1, p2) |
Macro for concatenating two tokens in macro expansion. More... | |
#define | NRFX_CONCAT_2_(p1, p2) p1 ## p2 |
Internal macro used by NRFX_CONCAT_2 to perform the expansion in two steps. | |
#define | NRFX_CONCAT_3(p1, p2, p3) NRFX_CONCAT_3_(p1, p2, p3) |
Macro for concatenating three tokens in macro expansion. More... | |
#define | NRFX_CONCAT_3_(p1, p2, p3) p1 ## p2 ## p3 |
Internal macro used by NRFX_CONCAT_3 to perform the expansion in two steps. | |
#define | NRFX_ROUNDED_DIV(a, b) (((a) + ((b) / 2)) / (b)) |
Macro for performing rounded integer division (as opposed to truncating the result). More... | |
#define | NRFX_EASYDMA_LENGTH_VALIDATE(peripheral, length1, length2) |
Macro for checking if given lengths of EasyDMA transfers do not exceed the limit of the specified peripheral. More... | |
#define | NRFX_WAIT_FOR(condition, attempts, delay_us, result) |
Macro for waiting until condition is met. More... | |
Typedefs | |
typedef void(* | nrfx_irq_handler_t )(void) |
IRQ handler type. | |
Enumerations | |
enum | nrfx_drv_state_t { NRFX_DRV_STATE_UNINITIALIZED, NRFX_DRV_STATE_INITIALIZED, NRFX_DRV_STATE_POWERED_ON } |
Driver state. More... | |
Functions | |
__STATIC_INLINE bool | nrfx_is_in_ram (void const *p_object) |
Function for checking if an object is placed in the Data RAM region. More... | |
__STATIC_INLINE IRQn_Type | nrfx_get_irq_number (void const *p_reg) |
Function for getting the interrupt number for a specific peripheral. More... | |
__STATIC_INLINE uint32_t | nrfx_bitpos_to_event (uint32_t bit) |
Function for converting an INTEN register bit position to the corresponding event identifier. More... | |
__STATIC_INLINE uint32_t | nrfx_event_to_bitpos (uint32_t event) |
Function for converting an event identifier to the corresponding INTEN register bit position. More... | |
Common module.
#define NRFX_CHECK | ( | module_enabled | ) | (module_enabled) |
Macro for checking if the specified identifier is defined and it has a non-zero value.
Normally, preprocessors treat all undefined identifiers as having the value zero. However, some tools, like static code analyzers, may issue a warning when such identifier is evaluated. This macro gives the possibility to suppress such warnings only in places where this macro is used for evaluation, not in the whole analyzed code.
#define NRFX_CONCAT_2 | ( | p1, | |
p2 | |||
) | NRFX_CONCAT_2_(p1, p2) |
Macro for concatenating two tokens in macro expansion.
p1 | First token. |
p2 | Second token. |
#define NRFX_CONCAT_3 | ( | p1, | |
p2, | |||
p3 | |||
) | NRFX_CONCAT_3_(p1, p2, p3) |
Macro for concatenating three tokens in macro expansion.
p1 | First token. |
p2 | Second token. |
p3 | Third token. |
#define NRFX_EASYDMA_LENGTH_VALIDATE | ( | peripheral, | |
length1, | |||
length2 | |||
) |
Macro for checking if given lengths of EasyDMA transfers do not exceed the limit of the specified peripheral.
peripheral | Peripheral to check the lengths against. |
length1 | First length to be checked. |
length2 | Second length to be checked (pass 0 if not needed). |
#define NRFX_ROUNDED_DIV | ( | a, | |
b | |||
) | (((a) + ((b) / 2)) / (b)) |
Macro for performing rounded integer division (as opposed to truncating the result).
a | Numerator. |
b | Denominator. |
a
by b
. #define NRFX_WAIT_FOR | ( | condition, | |
attempts, | |||
delay_us, | |||
result | |||
) |
Macro for waiting until condition is met.
[in] | condition | Condition to meet. |
[in] | attempts | Maximum number of condition checks. Must not be 0. |
[in] | delay_us | Delay between consecutive checks, in microseconds. |
[out] | result | Boolean variable to store the result of the wait process. Set to true if the condition is met or false otherwise. |
enum nrfx_drv_state_t |
__STATIC_INLINE uint32_t nrfx_bitpos_to_event | ( | uint32_t | bit | ) |
Function for converting an INTEN register bit position to the corresponding event identifier.
The event identifier is the offset between the event register address and the peripheral base address, and is equal (thus, can be directly cast) to the corresponding value of the enumerated type from HAL (nrf_*_event_t).
bit | INTEN register bit position. |
__STATIC_INLINE uint32_t nrfx_event_to_bitpos | ( | uint32_t | event | ) |
Function for converting an event identifier to the corresponding INTEN register bit position.
The event identifier is the offset between the event register address and the peripheral base address, and is equal (thus, can be directly cast) to the corresponding value of the enumerated type from HAL (nrf_*_event_t).
event | Event identifier. |
__STATIC_INLINE IRQn_Type nrfx_get_irq_number | ( | void const * | p_reg | ) |
Function for getting the interrupt number for a specific peripheral.
[in] | p_reg | Peripheral base pointer. |
__STATIC_INLINE bool nrfx_is_in_ram | ( | void const * | p_object | ) |
Function for checking if an object is placed in the Data RAM region.
Several peripherals (the ones using EasyDMA) require the transfer buffers to be placed in the Data RAM region. This function can be used to check if this condition is met.
[in] | p_object | Pointer to an object whose location is to be checked. |
true | If the pointed object is located in the Data RAM region. |
false | Otherwise. |