EGU driver

group nrfx_egu

Event Generator Unit (EGU) peripheral driver.

Defines

NRFX_EGU_INSTANCE(id)

Macro for creating an EGU driver instance.

NRFX_EGU_INST_HANDLER_GET(idx)

Macro returning EGU interrupt handler.

param[in] idx EGU index.

Returns:

Interrupt handler.

Typedefs

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

EGU driver event handler.

Param event_idx:

[in] Index of the event that generated the interrupt.

Param p_context:

[in] Context passed to the event handler. Set on initialization.

Functions

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

Function for initializing the EGU driver instance.

Parameters:
  • p_instance[in] Pointer to the driver instance structure.

  • interrupt_priority[in] Interrupt priority.

  • event_handler[in] Event handler provided by the user. In case of providing NULL, event notifications are not done and EGU interrupts are disabled.

  • p_context[in] Context passed to the event handler.

Return values:
  • NRFX_SUCCESS – Initialization was successful.

  • NRFX_ERROR_INVALID_STATE – Driver is already initialized.

void nrfx_egu_int_enable(nrfx_egu_t const *p_instance, uint32_t mask)

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

Parameters:
  • p_instance[in] Pointer to the driver instance structure.

  • mask[in] Mask of events with interrupts to be enabled.

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:
  • p_instance[in] Pointer to the driver instance structure.

  • task[in] EGU task.

Returns:

Task address.

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:
  • p_instance[in] Pointer to the driver instance structure.

  • event[in] EGU event.

Returns:

Event address.

void nrfx_egu_int_disable(nrfx_egu_t const *p_instance, uint32_t mask)

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

Parameters:
  • p_instance[in] Pointer to the driver instance structure.

  • mask[in] Mask of events with interrupts to be disabled.

void nrfx_egu_trigger(nrfx_egu_t const *p_instance, uint8_t event_idx)

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

Parameters:
  • p_instance[in] Pointer to the driver instance structure.

  • event_idx[in] Index of the event to be triggered.

void nrfx_egu_uninit(nrfx_egu_t const *p_instance)

Function for uninitializing the EGU driver instance.

Parameters:
  • p_instance[in] Pointer to the driver instance structure.

struct nrfx_egu_t
#include <nrfx_egu.h>

Structure for the EGU driver instance.

Public Members

NRF_EGU_Type *p_reg

Pointer to a structure with EGU registers.

uint8_t drv_inst_idx

Index of the driver instance. For internal use only.