Driver for managing software interrupts (SWI).
More...
Driver for managing software interrupts (SWI).
SWI user flags.
User flags are set during the SWI trigger and passed to the callback function as an argument.
SWI handler function.
- Parameters
-
swi | SWI instance. |
flags | User flags. |
Function for allocating the first unused SWI instance and setting a handler.
If provided handler is not NULL, an allocated SWI has its interrupt enabled by default. The interrupt can be disabled by nrfx_swi_int_disable.
- Parameters
-
[out] | p_swi | Points to a place where the allocated SWI instance number is to be stored. |
[in] | event_handler | Event handler function. If NULL, no interrupt will be enabled. It can be NULL only if the EGU driver is enabled. For classic SWI, it must be a valid handler pointer. |
[in] | irq_priority | Interrupt priority. |
- Return values
-
NRFX_SUCCESS | The SWI was successfully allocated. |
NRFX_ERROR_NO_MEM | There is no available SWI to be used. |
__STATIC_INLINE NRF_EGU_Type* nrfx_swi_egu_instance_get |
( |
nrfx_swi_t |
swi | ) |
|
Function for returning the base address of the EGU peripheral associated with the specified SWI instance.
- Parameters
-
- Returns
- EGU base address or NULL if the specified SWI instance number is too high.
__STATIC_INLINE uint32_t nrfx_swi_event_triggered_address_get |
( |
nrfx_swi_t |
swi, |
|
|
uint8_t |
channel |
|
) |
| |
Function for returning the EGU-triggered event address.
- Parameters
-
[in] | swi | SWI instance. |
[in] | channel | Number of the EGU channel. |
- Returns
- Address of the EGU-triggered event.
Function for freeing a previously allocated SWI.
- Parameters
-
Function for disabling an allocated SWI interrupt.
Use nrfx_swi_int_enable to re-enable the interrupt.
- Parameters
-
Function for enabling an allocated SWI interrupt.
- Parameters
-
Function for checking if the specified SWI is currently allocated.
- Parameters
-
- Return values
-
true | The SWI instance is allocated. |
false | The SWI instance is not allocated. |
__STATIC_INLINE uint32_t nrfx_swi_task_trigger_address_get |
( |
nrfx_swi_t |
swi, |
|
|
uint8_t |
channel |
|
) |
| |
Function for returning the EGU trigger task address.
- Parameters
-
[in] | swi | SWI instance. |
[in] | channel | Number of the EGU channel. |
- Returns
- Address of the EGU trigger task.
void nrfx_swi_trigger |
( |
nrfx_swi_t |
swi, |
|
|
uint8_t |
flag_number |
|
) |
| |
Function for triggering the SWI.
- Parameters
-
[in] | swi | SWI to trigger. |
[in] | flag_number | Number of user flag to trigger. |