nrfx_glue.h

group nrfx_glue

This file contains macros that should be implemented according to the needs of the host environment into which nrfx is integrated.

Defines

NRFX_ASSERT(expression)

Macro for placing a runtime assertion.

Parameters:
  • expression – Expression to be evaluated.

NRFX_STATIC_ASSERT(expression)

Macro for placing a compile time assertion.

Parameters:
  • expression – Expression to be evaluated.

NRFX_IRQ_PRIORITY_SET(irq_number, priority)

Macro for setting the priority of a specific IRQ.

Parameters:
  • irq_number – IRQ number.

  • priority – Priority to be set.

NRFX_IRQ_ENABLE(irq_number)

Macro for enabling a specific IRQ.

Parameters:
  • irq_number – IRQ number.

NRFX_IRQ_IS_ENABLED(irq_number)

Macro for checking if a specific IRQ is enabled.

Parameters:
  • irq_number – IRQ number.

Return values:
  • true – If the IRQ is enabled.

  • false – Otherwise.

NRFX_IRQ_DISABLE(irq_number)

Macro for disabling a specific IRQ.

Parameters:
  • irq_number – IRQ number.

NRFX_IRQ_PENDING_SET(irq_number)

Macro for setting a specific IRQ as pending.

Parameters:
  • irq_number – IRQ number.

NRFX_IRQ_PENDING_CLEAR(irq_number)

Macro for clearing the pending status of a specific IRQ.

Parameters:
  • irq_number – IRQ number.

NRFX_IRQ_IS_PENDING(irq_number)

Macro for checking the pending status of a specific IRQ.

Return values:
  • true – If the IRQ is pending.

  • false – Otherwise.

NRFX_CRITICAL_SECTION_ENTER()

Macro for entering into a critical section.

NRFX_CRITICAL_SECTION_EXIT()

Macro for exiting from a critical section.

NRFX_DELAY_DWT_BASED

When set to a non-zero value, this macro specifies that nrfx_coredep_delay_us uses a precise DWT-based solution. A compilation error is generated if the DWT unit is not present in the SoC used.

NRFX_DELAY_US(us_time)

Macro for delaying the code execution for at least the specified time.

Parameters:
  • us_time – Number of microseconds to wait.

nrfx_atomic_t

Atomic 32-bit unsigned type.

NRFX_ATOMIC_FETCH_STORE(p_data, value)

Macro for storing a value to an atomic object and returning its previous value.

Parameters:
  • p_data[in] Atomic memory pointer.

  • value[in] Value to store.

Returns:

Previous value of the atomic object.

NRFX_ATOMIC_FETCH_OR(p_data, value)

Macro for running a bitwise OR operation on an atomic object and returning its previous value.

Parameters:
  • p_data[in] Atomic memory pointer.

  • value[in] Value of the second operand in the OR operation.

Returns:

Previous value of the atomic object.

NRFX_ATOMIC_FETCH_AND(p_data, value)

Macro for running a bitwise AND operation on an atomic object and returning its previous value.

Parameters:
  • p_data[in] Atomic memory pointer.

  • value[in] Value of the second operand in the AND operation.

Returns:

Previous value of the atomic object.

NRFX_ATOMIC_FETCH_XOR(p_data, value)

Macro for running a bitwise XOR operation on an atomic object and returning its previous value.

Parameters:
  • p_data[in] Atomic memory pointer.

  • value[in] Value of the second operand in the XOR operation.

Returns:

Previous value of the atomic object.

NRFX_ATOMIC_FETCH_ADD(p_data, value)

Macro for running an addition operation on an atomic object and returning its previous value.

Parameters:
  • p_data[in] Atomic memory pointer.

  • value[in] Value of the second operand in the ADD operation.

Returns:

Previous value of the atomic object.

NRFX_ATOMIC_FETCH_SUB(p_data, value)

Macro for running a subtraction operation on an atomic object and returning its previous value.

Parameters:
  • p_data[in] Atomic memory pointer.

  • value[in] Value of the second operand in the SUB operation.

Returns:

Previous value of the atomic object.

NRFX_ATOMIC_CAS(p_data, old_value, new_value)

Macro for running compare and swap on an atomic object.

Value is updated to the new value only if it previously equaled old value.

Parameters:
  • p_data[inout] Atomic memory pointer.

  • old_value[in] Expected old value.

  • new_value[in] New value.

Return values:
  • true – If value was updated.

  • false – If value was not updated because location was not equal to old_value.

NRFX_CLZ(value)

Macro for counting leading zeros.

Parameters:
  • value[in] A word value.

Returns:

Number of leading 0-bits in value, starting at the most significant bit position. If x is 0, the result is undefined.

NRFX_CTZ(value)

Macro for counting trailing zeros.

Parameters:
  • value[in] A word value.

Returns:

Number of trailing 0-bits in value, starting at the least significant bit position. If x is 0, the result is undefined.

NRFX_CUSTOM_ERROR_CODES

When set to a non-zero value, this macro specifies that the Global Error Codes and the nrfx_err_t type itself are defined in a customized way and the default definitions from <nrfx_error.h> should not be used.

NRFX_EVENT_READBACK_ENABLED

When set to a non-zero value, this macro specifies that inside HALs the event registers are read back after clearing, on devices that otherwise could defer the actual register modification.

NRFY_CACHE_WB(p_buffer, size)

Macro for writing back cache lines associated with the specified buffer.

Parameters:
  • p_buffer[in] Pointer to the buffer.

  • size[in] Size of the buffer.

NRFY_CACHE_INV(p_buffer, size)

Macro for invalidating cache lines associated with the specified buffer.

Parameters:
  • p_buffer[in] Pointer to the buffer.

  • size[in] Size of the buffer.

NRFY_CACHE_WBINV(p_buffer, size)

Macro for writing back and invalidating cache lines associated with the specified buffer.

Parameters:
  • p_buffer[in] Pointer to the buffer.

  • size[in] Size of the buffer.

NRFX_DPPI_CHANNELS_USED

Bitmask that defines DPPI channels that are reserved for use outside of the nrfx library.

NRFX_DPPI_GROUPS_USED

Bitmask that defines DPPI groups that are reserved for use outside of the nrfx library.

NRFX_PPI_CHANNELS_USED

Bitmask that defines PPI channels that are reserved for use outside of the nrfx library.

NRFX_PPI_GROUPS_USED

Bitmask that defines PPI groups that are reserved for use outside of the nrfx library.

NRFX_GPIOTE_CHANNELS_USED

Bitmask that defines GPIOTE channels that are reserved for use outside of the nrfx library.

NRFX_EGUS_USED

Bitmask that defines EGU instances that are reserved for use outside of the nrfx library.

NRFX_TIMERS_USED

Bitmask that defines TIMER instances that are reserved for use outside of the nrfx library.