Random Number Generator (RNG) peripheral driver.
More...
|
typedef void(* | nrfx_rng_evt_handler_t) (uint8_t rng_data) |
| RNG driver event handler type.
|
|
Random Number Generator (RNG) peripheral driver.
◆ 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:
{ ...
#define NRFX_RNG_DEFAULT_CONFIG
RNG default configuration. Basic usage:
Definition: nrfx_rng.h:38
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.
Struct for RNG configuration.
Definition: nrfx_rng.h:21
This configuration sets up randon number generator with the following options:
◆ nrfx_rng_init()
Function for initializing the nrfx_rng module.
- Parameters
-
[in] | p_config | Pointer to the structure with the 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 | Driver was already initialized. |
◆ nrfx_rng_init_check()
bool nrfx_rng_init_check |
( |
void |
| ) |
|
Function for checking if the RNG driver is initialized.
- Return values
-
true | Driver is already initialized. |
false | Driver is not 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.