RNG driver

nRF5 SDK v15.0.0

Random Number Generator (RNG) peripheral driver. More...

Data Structures

struct nrfx_rng_config_t
Struct for RNG configuration. More...

Macros

#define NRFX_RNG_DEFAULT_CONFIG
RNG default configuration. Basic usage: More...

Typedefs

typedef void(* nrfx_rng_evt_handler_t )(uint8_t rng_data)
RNG driver event handler type.

Functions

nrfx_err_t nrfx_rng_init ( nrfx_rng_config_t const *p_config, nrfx_rng_evt_handler_t handler)
Function for initializing the nrfx_rng module. More...
void nrfx_rng_start (void)
Function for starting the random value generation. More...
void nrfx_rng_stop (void)
Function for stoping the random value generation. More...
void nrfx_rng_uninit (void)
Function for uninitializing the nrfx_rng module.
void nrfx_rng_irq_handler (void)

Detailed Description

Random Number Generator (RNG) peripheral driver.

Macro Definition Documentation

#define NRFX_RNG_DEFAULT_CONFIG
Value:
{ \
.error_correction = NRFX_RNG_CONFIG_ERROR_CORRECTION , \
.interrupt_priority = NRFX_RNG_CONFIG_IRQ_PRIORITY , \
}

RNG default configuration. Basic usage:

Function Documentation

nrfx_err_t nrfx_rng_init ( nrfx_rng_config_t const * p_config ,
nrfx_rng_evt_handler_t handler
)

Function for initializing the nrfx_rng module.

Parameters
[in] p_config Pointer to the structure with initial configuration.
[in] handler Event handler provided by the user. Must not be NULL.
Return values
NRFX_SUCCESS Driver was successfully initialized.
NRFX_ERROR_ALREADY_INITIALIZED Driver was already initialized.
void nrfx_rng_start ( void )

Function for starting the random value generation.

Function enables interrupts in perihperal and start them.

void nrfx_rng_stop ( void )

Function for stoping the random value generation.

Function disables interrupts in perihperal and stop generation of new random values.