nrfx 4.5.0
Loading...
Searching...
No Matches
EGU driver

Event Generator Unit (EGU) peripheral driver. More...

Data Structures

struct  nrfx_egu_t
 Structure for the EGU driver instance. More...
 

Macros

#define NRFX_EGU_INSTANCE(reg)
 Macro for creating an EGU driver instance.
 
#define NRFX_EGU_INST_HANDLER_GET(idx)
 Macro returning EGU interrupt handler.
 

Typedefs

typedef void(* nrfx_egu_event_handler_t) (uint8_t event_idx, void *p_context)
 EGU driver event handler.
 

Functions

int nrfx_egu_init (nrfx_egu_t *p_instance, uint8_t interrupt_priority, nrfx_egu_event_handler_t event_handler, void *p_context)
 Function for initializing the EGU driver instance.
 
void nrfx_egu_int_enable (nrfx_egu_t *p_instance, uint32_t mask)
 Function for enabling interrupts on specified events of a given EGU driver instance.
 
NRFX_STATIC_INLINE uint32_t nrfx_egu_task_address_get (nrfx_egu_t const *p_instance, nrf_egu_task_t task)
 Function for getting the address of the specified EGU task.
 
NRFX_STATIC_INLINE uint32_t nrfx_egu_event_address_get (nrfx_egu_t const *p_instance, nrf_egu_event_t event)
 Function for getting the address of the specified EGU event.
 
void nrfx_egu_int_disable (nrfx_egu_t *p_instance, uint32_t mask)
 Function for disabling interrupts on specified events of a given EGU driver instance.
 
void nrfx_egu_trigger (nrfx_egu_t *p_instance, uint8_t event_idx)
 Function for triggering an event specified by event_idx of a given EGU driver instance.
 
void nrfx_egu_uninit (nrfx_egu_t *p_instance)
 Function for uninitializing the EGU driver instance.
 
bool nrfx_egu_init_check (nrfx_egu_t const *p_instance)
 Function for checking if the EGU driver instance is initialized.
 
void nrfx_egu_irq_handler (nrfx_egu_t *p_instance)
 Driver interrupt handler.
 

Detailed Description

Event Generator Unit (EGU) peripheral driver.

Macro Definition Documentation

◆ NRFX_EGU_INST_HANDLER_GET

#define NRFX_EGU_INST_HANDLER_GET ( idx)
Value:
NRFX_CONCAT_3(nrfx_egu_, idx, _irq_handler)
#define NRFX_CONCAT_3(p1, p2, p3)
Macro for concatenating three tokens in macro expansion.
Definition nrfx_utils.h:164

Macro returning EGU interrupt handler.

param[in] idx EGU index.

Returns
Interrupt handler.

◆ NRFX_EGU_INSTANCE

#define NRFX_EGU_INSTANCE ( reg)
Value:
{ \
.p_reg = (NRF_EGU_Type *)reg, \
.cb = {0}, \
}

Macro for creating an EGU driver instance.

Typedef Documentation

◆ nrfx_egu_event_handler_t

typedef void(* nrfx_egu_event_handler_t) (uint8_t event_idx, void *p_context)

EGU driver event handler.

Parameters
[in]event_idxIndex of the event that generated the interrupt.
[in]p_contextContext passed to the event handler. Set on initialization.

Function Documentation

◆ nrfx_egu_event_address_get()

NRFX_STATIC_INLINE uint32_t nrfx_egu_event_address_get ( nrfx_egu_t const * p_instance,
nrf_egu_event_t event )

Function for getting the address of the specified EGU event.

Parameters
[in]p_instancePointer to the driver instance structure.
[in]eventEGU event.
Returns
Event address.

◆ nrfx_egu_init()

int nrfx_egu_init ( nrfx_egu_t * p_instance,
uint8_t interrupt_priority,
nrfx_egu_event_handler_t event_handler,
void * p_context )

Function for initializing the EGU driver instance.

Parameters
[in]p_instancePointer to the driver instance structure.
[in]interrupt_priorityInterrupt priority.
[in]event_handlerEvent handler provided by the user. In case of providing NULL, event notifications are not done and EGU interrupts are disabled.
[in]p_contextContext passed to the event handler.
Return values
0Initialization was successful.
-EALREADYThe driver is already initialized.

◆ nrfx_egu_init_check()

bool nrfx_egu_init_check ( nrfx_egu_t const * p_instance)

Function for checking if the EGU driver instance is initialized.

Parameters
[in]p_instancePointer to the driver instance structure.
Return values
trueInstance is already initialized.
falseInstance is not initialized.

◆ nrfx_egu_int_disable()

void nrfx_egu_int_disable ( nrfx_egu_t * p_instance,
uint32_t mask )

Function for disabling interrupts on specified events of a given EGU driver instance.

Parameters
[in]p_instancePointer to the driver instance structure.
[in]maskMask of events with interrupts to be disabled.

◆ nrfx_egu_int_enable()

void nrfx_egu_int_enable ( nrfx_egu_t * p_instance,
uint32_t mask )

Function for enabling interrupts on specified events of a given EGU driver instance.

Parameters
[in]p_instancePointer to the driver instance structure.
[in]maskMask of events with interrupts to be enabled.

◆ nrfx_egu_irq_handler()

void nrfx_egu_irq_handler ( nrfx_egu_t * p_instance)

Driver interrupt handler.

Parameters
[in]p_instancePointer to the driver instance structure.

◆ nrfx_egu_task_address_get()

NRFX_STATIC_INLINE uint32_t nrfx_egu_task_address_get ( nrfx_egu_t const * p_instance,
nrf_egu_task_t task )

Function for getting the address of the specified EGU task.

Parameters
[in]p_instancePointer to the driver instance structure.
[in]taskEGU task.
Returns
Task address.

◆ nrfx_egu_trigger()

void nrfx_egu_trigger ( nrfx_egu_t * p_instance,
uint8_t event_idx )

Function for triggering an event specified by event_idx of a given EGU driver instance.

Parameters
[in]p_instancePointer to the driver instance structure.
[in]event_idxIndex of the event to be triggered.

◆ nrfx_egu_uninit()

void nrfx_egu_uninit ( nrfx_egu_t * p_instance)

Function for uninitializing the EGU driver instance.

Parameters
[in]p_instancePointer to the driver instance structure.