The Random Number Generator (RNG) uses thermal noise to produce a non-deterministic bit stream. A digital corrector algorithm is used on the bit stream to remove any bias. The bits are then queued into an 8-bit register for parallel readout.
This module contains functions for initializing and enabling the number generator, for checking the status of the generator and for reading one random number.
Functions | |
void | hal_rng_power_up (_Bool pwr_up) |
void | hal_rng_bias_corr_enable (_Bool en) |
uint8_t | hal_rng_read (void) |
_Bool | hal_rng_data_ready (void) |
void hal_rng_power_up | ( | _Bool | pwr_up ) |
Function to power up and power down the random number generator. When power up is set, the random number generator starts generating a random number.
pwr_up | True to power up, false to power down |
< The value of bit 7
< The value of bit 7
void hal_rng_bias_corr_enable | ( | _Bool | en ) |
Function to control the bias corrector on the random number generator. Use this function to enable or disable the bias corrector.
en | True to enable, false to disable bias corrector |
< The value of bit 6
< The value of bit 6
uint8_t hal_rng_read | ( | void | ) |
_Bool hal_rng_data_ready | ( | void | ) |
Function that returns the status of the RNG. This function returns true if there is data ready from the RNG.
FALSE | no data available |
TRUE | data available |
< The value of bit 5