GPIOTE HALY

group nrfy_gpiote

Hardware access layer with cache and barrier support for managing the GPIOTE peripheral.

Defines

NRFY_GPIOTE_HAS_LATENCY

See also

NRF_GPIOTE_HAS_LATENCY Presence of the latency setting.

Functions

NRFY_STATIC_INLINE void nrfy_gpiote_int_init(NRF_GPIOTE_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable, uint32_t channels_number)

Function for initializing the specified GPIOTE interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be initialized.

  • irq_priority[in] Interrupt priority.

  • enable[in] True if the interrupts are to be enabled, false otherwise.

  • channels_number[in] Number of channels for specified GPIOTE peripheral.

NRFY_STATIC_INLINE uint32_t nrfy_gpiote_events_process(NRF_GPIOTE_Type *p_reg, uint32_t mask, uint32_t channels_number)

Function for processing the specified GPIOTE events.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of events to be processed, created by NRFY_EVENT_TO_INT_BITMASK().

  • channels_number[in] Number of channels for specified GPIOTE peripheral.

Returns:

Mask of events that were generated and processed. To be checked against the result of NRFY_EVENT_TO_INT_BITMASK().

NRFY_STATIC_INLINE void nrfy_gpiote_task_trigger(NRF_GPIOTE_Type *p_reg, nrf_gpiote_task_t task)

See also

nrf_gpiote_task_trigger Function for activating the specified GPIOTE task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task.

NRFY_STATIC_INLINE uint32_t nrfy_gpiote_task_address_get(NRF_GPIOTE_Type const *p_reg, nrf_gpiote_task_t task)

See also

nrf_gpiote_task_address_get Function for getting the address of the specified GPIOTE task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task.

Returns:

Address of the specified task.

NRFY_STATIC_INLINE bool nrfy_gpiote_event_check(NRF_GPIOTE_Type const *p_reg, nrf_gpiote_event_t event)

See also

nrf_gpiote_event_check Function for getting the state of the specified GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event.

Return values:
  • true – The event is set.

  • false – The event is not set.

NRFY_STATIC_INLINE void nrfy_gpiote_event_clear(NRF_GPIOTE_Type *p_reg, nrf_gpiote_event_t event)

See also

nrf_gpiote_event_clear Function for clearing the specified GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event.

NRFY_STATIC_INLINE uint32_t nrfy_gpiote_event_address_get(NRF_GPIOTE_Type const *p_reg, nrf_gpiote_event_t event)

See also

nrf_gpiote_event_address_get Function for getting the address of the specified GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event.

Returns:

Address of the specified event.

NRFY_STATIC_INLINE void nrfy_gpiote_int_enable(NRF_GPIOTE_Type *p_reg, uint32_t mask)

See also

nrf_gpiote_int_enable Function for enabling interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be enabled. Use nrf_gpiote_int_t values for bit masking.

NRFY_STATIC_INLINE void nrfy_gpiote_int_disable(NRF_GPIOTE_Type *p_reg, uint32_t mask)

See also

nrf_gpiote_int_disable Function for disabling interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be disabled. Use nrf_gpiote_int_t values for bit masking.

NRFY_STATIC_INLINE uint32_t nrfy_gpiote_int_enable_check(NRF_GPIOTE_Type const *p_reg, uint32_t mask)

See also

nrf_gpiote_int_enable_check Function for checking if the specified interrupts are enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be checked. Use nrf_gpiote_int_t values for bit masking.

Returns:

Mask of enabled interrupts.

NRFY_STATIC_INLINE void nrfy_gpiote_subscribe_set(NRF_GPIOTE_Type *p_reg, nrf_gpiote_task_t task, uint8_t channel)

See also

nrf_gpiote_subscribe_set Function for setting the subscribe configuration for a given GPIOTE task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task for which to set the configuration.

  • channel[in] Channel through which to subscribe events.

NRFY_STATIC_INLINE void nrfy_gpiote_subscribe_clear(NRF_GPIOTE_Type *p_reg, nrf_gpiote_task_t task)

See also

nrf_gpiote_subscribe_clear Function for clearing the subscribe configuration for a given GPIOTE task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task for which to clear the configuration.

NRFY_STATIC_INLINE void nrfy_gpiote_publish_set(NRF_GPIOTE_Type *p_reg, nrf_gpiote_event_t event, uint8_t channel)

See also

nrf_gpiote_publish_set Function for setting the publish configuration for a given GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event for which to set the configuration.

  • channel[in] Channel through which to publish the event.

NRFY_STATIC_INLINE void nrfy_gpiote_publish_clear(NRF_GPIOTE_Type *p_reg, nrf_gpiote_event_t event)

See also

nrf_gpiote_publish_clear Function for clearing the publish configuration for a given GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event for which to clear the configuration.

NRFY_STATIC_INLINE void nrfy_gpiote_event_enable(NRF_GPIOTE_Type *p_reg, uint32_t idx)

See also

nrf_gpiote_event_enable Function for enabling a GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

NRFY_STATIC_INLINE void nrfy_gpiote_event_disable(NRF_GPIOTE_Type *p_reg, uint32_t idx)

See also

nrf_gpiote_event_disable Function for disabling a GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

NRFY_STATIC_INLINE void nrfy_gpiote_event_configure(NRF_GPIOTE_Type *p_reg, uint32_t idx, uint32_t pin, nrf_gpiote_polarity_t polarity)

See also

nrf_gpiote_event_configure Function for configuring a GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

  • pin[in] Pin associated with event.

  • polarity[in] Transition that should generate an event.

NRFY_STATIC_INLINE uint32_t nrfy_gpiote_event_pin_get(NRF_GPIOTE_Type const *p_reg, uint32_t idx)

See also

nrf_gpiote_event_pin_get Function for getting the pin associated with a GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

Returns:

Pin number.

NRFY_STATIC_INLINE nrf_gpiote_polarity_t nrfy_gpiote_event_polarity_get(NRF_GPIOTE_Type const *p_reg, uint32_t idx)

See also

nrf_gpiote_event_polarity_get Function for getting the polarity associated with a GPIOTE event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

Returns:

Polarity.

NRFY_STATIC_INLINE void nrfy_gpiote_task_enable(NRF_GPIOTE_Type *p_reg, uint32_t idx)

See also

nrf_gpiote_task_enable Function for enabling a GPIOTE task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

NRFY_STATIC_INLINE void nrfy_gpiote_task_disable(NRF_GPIOTE_Type *p_reg, uint32_t idx)

See also

nrf_gpiote_task_disable Function for disabling a GPIOTE task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

NRFY_STATIC_INLINE void nrfy_gpiote_task_configure(NRF_GPIOTE_Type *p_reg, uint32_t idx, uint32_t pin, nrf_gpiote_polarity_t polarity, nrf_gpiote_outinit_t init_val)

See also

nrf_gpiote_task_configure Function for configuring a GPIOTE task.

Note

Function is not configuring mode field so task is disabled after this function is called.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

  • pin[in] Pin associated with event.

  • polarity[in] Transition that should generate an event.

  • init_val[in] Initial value of the pin.

NRFY_STATIC_INLINE void nrfy_gpiote_task_force(NRF_GPIOTE_Type *p_reg, uint32_t idx, nrf_gpiote_outinit_t init_val)

See also

nrf_gpiote_task_force Function for forcing the specified state on the pin connected to GPIOTE.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

  • init_val[in] Pin state.

NRFY_STATIC_INLINE void nrfy_gpiote_te_default(NRF_GPIOTE_Type *p_reg, uint32_t idx)

See also

nrf_gpiote_te_default Function for resetting a GPIOTE task event configuration to the default state.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

NRFY_STATIC_INLINE bool nrfy_gpiote_te_is_enabled(NRF_GPIOTE_Type const *p_reg, uint32_t idx)

See also

nrf_gpiote_te_is_enabled Function for checking if particular Task-Event is enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • idx[in] Task-Event index.

Return values:
  • true – The Task-Event mode is set to Task or Event.

  • false – The Task-Event mode is set to Disabled.

NRFY_STATIC_INLINE nrf_gpiote_task_t nrfy_gpiote_out_task_get(uint8_t index)

See also

nrf_gpiote_out_task_get Function for getting the OUT task associated with the specified GPIOTE channel.

Parameters:
  • index[in] Channel index.

Returns:

Requested OUT task.

NRFY_STATIC_INLINE nrf_gpiote_task_t nrfy_gpiote_set_task_get(uint8_t index)

See also

nrf_gpiote_set_task_get Function for getting the SET task associated with the specified GPIOTE channel.

Parameters:
  • index[in] Channel index.

Returns:

Requested SET task.

NRFY_STATIC_INLINE nrf_gpiote_task_t nrfy_gpiote_clr_task_get(uint8_t index)

See also

nrf_gpiote_clr_task_get Function for getting the CLR task associated with the specified GPIOTE channel.

Parameters:
  • index[in] Channel index.

Returns:

Requested CLR task.

NRFY_STATIC_INLINE nrf_gpiote_event_t nrfy_gpiote_in_event_get(uint8_t index)

See also

nrf_gpiote_in_event_get Function for getting the IN event associated with the specified GPIOTE channel.

Parameters:
  • index[in] Channel index.

Returns:

Requested IN event.

NRFY_STATIC_INLINE void nrfy_gpiote_latency_set(NRF_GPIOTE_Type *p_reg, nrf_gpiote_latency_t latency)

See also

nrf_gpiote_latency_set Function for setting the latency setting.

Note

Available for event mode with rising or falling edge detection on the pin. Toggle task mode can only be used with low latency setting.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • latency[in] Latency setting to be set.

NRFY_STATIC_INLINE nrf_gpiote_latency_t nrfy_gpiote_latency_get(NRF_GPIOTE_Type const *p_reg)

See also

nrf_gpiote_latency_get Function for retrieving the latency setting.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Latency setting.