nrfx 2.5
Modules | Data Structures | Macros | Typedefs | Functions
RNG driver

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

Modules

 RNG peripheral driver configuration
 

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 generation of random values. More...
 
void nrfx_rng_stop (void)
 Function for stopping the generation of random values. More...
 
void nrfx_rng_uninit (void)
 Function for uninitializing the nrfx_rng module.
 

Detailed Description

Random Number Generator (RNG) peripheral driver.

Macro Definition Documentation

◆ NRFX_RNG_DEFAULT_CONFIG

#define NRFX_RNG_DEFAULT_CONFIG
Value:
{ \
.error_correction = true, \
.interrupt_priority = NRFX_RNG_DEFAULT_CONFIG_IRQ_PRIORITY, \
}

RNG default configuration. Basic usage:

if (nrfx_rng_init(&config, handler)
{ ...

This configuration sets up randon number generator with the following options:

  • error correction enabled

Function Documentation

◆ nrfx_rng_init()

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_configPointer to the structure with the initial configuration.
[in]handlerEvent handler provided by the user. Must not be NULL.
Return values
NRFX_SUCCESSDriver was successfully initialized.
NRFX_ERROR_ALREADY_INITIALIZEDDriver was already initialized.

◆ nrfx_rng_start()

void nrfx_rng_start ( void  )

Function for starting the generation of random values.

New data should be handled by handler passed to the nrfx_rng_init() function.

◆ nrfx_rng_stop()

void nrfx_rng_stop ( void  )

Function for stopping the generation of random values.

Function disables interrupts in peripheral and stops the generation of new random values.


Documentation feedback | Developer Zone | Subscribe | Updated