nrfx 2.5
Enumerations | Functions
RNG HAL

Hardware access layer (HAL) for managing the Random Number Generator (RNG) peripheral. More...

Enumerations

enum  nrf_rng_task_t {
  NRF_RNG_TASK_START = offsetof(NRF_RNG_Type, TASKS_START),
  NRF_RNG_TASK_STOP = offsetof(NRF_RNG_Type, TASKS_STOP)
}
 RNG tasks. More...
 
enum  nrf_rng_event_t { NRF_RNG_EVENT_VALRDY = offsetof(NRF_RNG_Type, EVENTS_VALRDY) }
 RNG events. More...
 
enum  nrf_rng_int_mask_t { NRF_RNG_INT_VALRDY_MASK = RNG_INTENSET_VALRDY_Msk }
 RNG interrupts. More...
 
enum  nrf_rng_short_mask_t { NRF_RNG_SHORT_VALRDY_STOP_MASK = RNG_SHORTS_VALRDY_STOP_Msk }
 Types of RNG shortcuts. More...
 

Functions

NRF_STATIC_INLINE void nrf_rng_int_enable (NRF_RNG_Type *p_reg, uint32_t mask)
 Function for enabling interrupts. More...
 
NRF_STATIC_INLINE void nrf_rng_int_disable (NRF_RNG_Type *p_reg, uint32_t mask)
 Function for disabling interrupts. More...
 
NRF_STATIC_INLINE uint32_t nrf_rng_int_enable_check (NRF_RNG_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled. More...
 
NRF_STATIC_INLINE uint32_t nrf_rng_task_address_get (NRF_RNG_Type const *p_reg, nrf_rng_task_t rng_task)
 Function for getting the address of the specified task. More...
 
NRF_STATIC_INLINE void nrf_rng_task_trigger (NRF_RNG_Type *p_reg, nrf_rng_task_t rng_task)
 Function for triggering the specified task. More...
 
NRF_STATIC_INLINE uint32_t nrf_rng_event_address_get (NRF_RNG_Type const *p_reg, nrf_rng_event_t rng_event)
 Function for getting address of the specified event. More...
 
NRF_STATIC_INLINE void nrf_rng_event_clear (NRF_RNG_Type *p_reg, nrf_rng_event_t rng_event)
 Function for clearing the specified event. More...
 
NRF_STATIC_INLINE bool nrf_rng_event_check (NRF_RNG_Type const *p_reg, nrf_rng_event_t rng_event)
 Function for retrieving the state of the specified event. More...
 
NRF_STATIC_INLINE void nrf_rng_shorts_enable (NRF_RNG_Type *p_reg, uint32_t mask)
 Function for setting shortcuts. More...
 
NRF_STATIC_INLINE void nrf_rng_shorts_disable (NRF_RNG_Type *p_reg, uint32_t mask)
 Function for clearing shortcuts. More...
 
NRF_STATIC_INLINE uint8_t nrf_rng_random_value_get (NRF_RNG_Type const *p_reg)
 Function for getting the previously generated random value. More...
 
NRF_STATIC_INLINE void nrf_rng_error_correction_enable (NRF_RNG_Type *p_reg)
 Function for enabling digital error correction. More...
 
NRF_STATIC_INLINE void nrf_rng_error_correction_disable (NRF_RNG_Type *p_reg)
 Function for disabling digital error correction. More...
 
NRF_STATIC_INLINE void nrf_rng_subscribe_set (NRF_RNG_Type *p_reg, nrf_rng_task_t task, uint8_t channel)
 Function for setting the subscribe configuration for a given RNG task. More...
 
NRF_STATIC_INLINE void nrf_rng_subscribe_clear (NRF_RNG_Type *p_reg, nrf_rng_task_t task)
 Function for clearing the subscribe configuration for a given RNG task. More...
 
NRF_STATIC_INLINE void nrf_rng_publish_set (NRF_RNG_Type *p_reg, nrf_rng_event_t event, uint8_t channel)
 Function for setting the publish configuration for a given RNG event. More...
 
NRF_STATIC_INLINE void nrf_rng_publish_clear (NRF_RNG_Type *p_reg, nrf_rng_event_t event)
 Function for clearing the publish configuration for a given RNG event. More...
 

Detailed Description

Hardware access layer (HAL) for managing the Random Number Generator (RNG) peripheral.

Enumeration Type Documentation

◆ nrf_rng_event_t

RNG events.

Enumerator
NRF_RNG_EVENT_VALRDY 

New random number generated event.

◆ nrf_rng_int_mask_t

RNG interrupts.

Enumerator
NRF_RNG_INT_VALRDY_MASK 

Mask for enabling or disabling an interrupt on VALRDY event.

◆ nrf_rng_short_mask_t

Types of RNG shortcuts.

Enumerator
NRF_RNG_SHORT_VALRDY_STOP_MASK 

Mask for setting shortcut between EVENT_VALRDY and TASK_STOP.

◆ nrf_rng_task_t

RNG tasks.

Enumerator
NRF_RNG_TASK_START 

Start the random number generator.

NRF_RNG_TASK_STOP 

Stop the random number generator.

Function Documentation

◆ nrf_rng_error_correction_disable()

NRF_STATIC_INLINE void nrf_rng_error_correction_disable ( NRF_RNG_Type *  p_reg)

Function for disabling digital error correction.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_rng_error_correction_enable()

NRF_STATIC_INLINE void nrf_rng_error_correction_enable ( NRF_RNG_Type *  p_reg)

Function for enabling digital error correction.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_rng_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_rng_event_address_get ( NRF_RNG_Type const *  p_reg,
nrf_rng_event_t  rng_event 
)

Function for getting address of the specified event.

This function can be used by the PPI module.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rng_eventThe specified event.
Returns
Address of the specified event.

◆ nrf_rng_event_check()

NRF_STATIC_INLINE bool nrf_rng_event_check ( NRF_RNG_Type const *  p_reg,
nrf_rng_event_t  rng_event 
)

Function for retrieving the state of the specified event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rng_eventThe specified event.
Return values
trueThe event is set.
falseThe event is not set.

◆ nrf_rng_event_clear()

NRF_STATIC_INLINE void nrf_rng_event_clear ( NRF_RNG_Type *  p_reg,
nrf_rng_event_t  rng_event 
)

Function for clearing the specified event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rng_eventThe specified event.

◆ nrf_rng_int_disable()

NRF_STATIC_INLINE void nrf_rng_int_disable ( NRF_RNG_Type *  p_reg,
uint32_t  mask 
)

Function for disabling interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled.

◆ nrf_rng_int_enable()

NRF_STATIC_INLINE void nrf_rng_int_enable ( NRF_RNG_Type *  p_reg,
uint32_t  mask 
)

Function for enabling interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled.

◆ nrf_rng_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_rng_int_enable_check ( NRF_RNG_Type const *  p_reg,
uint32_t  mask 
)

Function for checking if the specified interrupts are enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked.
Returns
Mask of enabled interrupts.

◆ nrf_rng_publish_clear()

NRF_STATIC_INLINE void nrf_rng_publish_clear ( NRF_RNG_Type *  p_reg,
nrf_rng_event_t  event 
)

Function for clearing the publish configuration for a given RNG event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrf_rng_publish_set()

NRF_STATIC_INLINE void nrf_rng_publish_set ( NRF_RNG_Type *  p_reg,
nrf_rng_event_t  event,
uint8_t  channel 
)

Function for setting the publish configuration for a given RNG event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to set the configuration.
[in]channelChannel through which to publish the event.

◆ nrf_rng_random_value_get()

NRF_STATIC_INLINE uint8_t nrf_rng_random_value_get ( NRF_RNG_Type const *  p_reg)

Function for getting the previously generated random value.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Previously generated random value.

◆ nrf_rng_shorts_disable()

NRF_STATIC_INLINE void nrf_rng_shorts_disable ( NRF_RNG_Type *  p_reg,
uint32_t  mask 
)

Function for clearing shortcuts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts.

◆ nrf_rng_shorts_enable()

NRF_STATIC_INLINE void nrf_rng_shorts_enable ( NRF_RNG_Type *  p_reg,
uint32_t  mask 
)

Function for setting shortcuts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts.

◆ nrf_rng_subscribe_clear()

NRF_STATIC_INLINE void nrf_rng_subscribe_clear ( NRF_RNG_Type *  p_reg,
nrf_rng_task_t  task 
)

Function for clearing the subscribe configuration for a given RNG task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrf_rng_subscribe_set()

NRF_STATIC_INLINE void nrf_rng_subscribe_set ( NRF_RNG_Type *  p_reg,
nrf_rng_task_t  task,
uint8_t  channel 
)

Function for setting the subscribe configuration for a given RNG task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to set the configuration.
[in]channelChannel through which to subscribe events.

◆ nrf_rng_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_rng_task_address_get ( NRF_RNG_Type const *  p_reg,
nrf_rng_task_t  rng_task 
)

Function for getting the address of the specified task.

This function can be used by the PPI module.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rng_taskThe specified task.
Returns
Address of the specified task.

◆ nrf_rng_task_trigger()

NRF_STATIC_INLINE void nrf_rng_task_trigger ( NRF_RNG_Type *  p_reg,
nrf_rng_task_t  rng_task 
)

Function for triggering the specified task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]rng_taskThe specified Task.

Documentation feedback | Developer Zone | Subscribe | Updated