Functions
Functions
Peripheral Driver » APP DRIVER » RNG

## Functions
uint16_t | app_rng_init (app_rng_params_t *p_params, app_rng_evt_handler_t evt_handler)
| Initialize the APP RNG DRIVER according to the specified parameters in the app_rng_params_t and app_rng_evt_handler_t. More...
uint16_t | app_rng_deinit (void)
| De-initialize the APP RNG DRIVER peripheral. More...
uint16_t | app_rng_gen_sync (uint16_t *p_seed, uint32_t *p_random32bit)
| Generate a 32-bit random number. More...
uint16_t | app_rng_gen_async (uint16_t *p_seed)
| Generate a 32-bit random number in interrupt mode. More...
rng_handle_t * | app_rng_get_handle (void)
| Return the RNG handle. More...

## Detailed Description

## Function Documentation

## ◆ app_rng_deinit()

uint16_t app_rng_deinit | ( | void |  | ) |

De-initialize the APP RNG DRIVER peripheral.

Returns
  Result of De-initialization.

## ◆ app_rng_gen_async()

uint16_t app_rng_gen_async | ( | uint16_t * | p_seed | ) |

Generate a 32-bit random number in interrupt mode.

Parameters

  [in] | p_seed | user configured seeds. the seed is valid when seed_mode member of rng_init_t is configured as RNG_SEED_USER. If 59-bit random number is selected, the seed need to provide [0~58] bit spaces. If 128-bit random number is selected, the seed need to provide [0~127] bit spaces.

Returns
  Result of operation.

## ◆ app_rng_gen_sync()

uint16_t app_rng_gen_sync | ( | uint16_t * | p_seed,
|  | uint32_t * | p_random32bit
| ) |  |

Generate a 32-bit random number.

Parameters

  [in] | p_seed | user configured seeds. the seed is valid when seed_mode member of rng_init_t is configured as RNG_SEED_USER. If 59-bit random number is selected, the seed need to provide [0~58] bit spaces. If 128-bit random number is selected, the seed need to provide [0~127] bit spaces.
  [out] | p_random32bit | Pointer to generated random number variable if successful.

Returns
  Result of operation.

## ◆ app_rng_get_handle()

rng_handle_t* app_rng_get_handle | ( | void |  | ) |

Return the RNG handle.

Returns
  Pointer to the RNG handle.

## ◆ app_rng_init()

uint16_t app_rng_init | ( | app_rng_params_t * | p_params,
|  | app_rng_evt_handler_t | evt_handler
| ) |  |

Initialize the APP RNG DRIVER according to the specified parameters in the app_rng_params_t and app_rng_evt_handler_t.

Note
  If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode is set, you can't use interrupt mode.

Parameters

  [in] | p_params | Pointer to app_rng_params_t parameter which contains the configuration information for the specified RNG module.
  [in] | evt_handler | RNG user callback function.

Returns
  Result of initialization.