This library supports "version 1" of the random number generator peripheral (RNG) in the STM32 series of ARM Cortex Microcontrollers by ST Microelectronics.
More...
This library supports "version 1" of the random number generator peripheral (RNG) in the STM32 series of ARM Cortex Microcontrollers by ST Microelectronics.
This is a common peripheral available on multiple devices in the family.
LGPL License Terms libopencm3 License
◆ RNG_CR
◆ RNG_CR_IE
#define RNG_CR_IE (1 << 3) |
◆ RNG_CR_RNGEN
#define RNG_CR_RNGEN (1 << 2) |
◆ RNG_DR
◆ RNG_SR
◆ RNG_SR_CECS
#define RNG_SR_CECS (1 << 1) |
◆ RNG_SR_CEIS
#define RNG_SR_CEIS (1 << 5) |
◆ RNG_SR_DRDY
#define RNG_SR_DRDY (1 << 0) |
◆ RNG_SR_SECS
#define RNG_SR_SECS (1 << 2) |
◆ RNG_SR_SEIS
#define RNG_SR_SEIS (1 << 6) |
◆ rng_disable()
void rng_disable |
( |
void |
| ) |
|
◆ rng_enable()
◆ rng_get_random()
bool rng_get_random |
( |
uint32_t * |
rand_nr | ) |
|
◆ rng_get_random_blocking()
uint32_t rng_get_random_blocking |
( |
void |
| ) |
|
Get a random number and block until it works.
Unless you have a clock problem, this should always return "promptly" If you have a clock problem, you will wait here forever! Check device RM for clock requirements (usually fRNGCLK > fHCLK/16 or fRNGCLK > fHCLK/32
- Returns
- a random 32bit number
Definition at line 95 of file rng_common_v1.c.
References RNG_CR, RNG_CR_RNGEN, RNG_DR, rng_get_random(), RNG_SR, RNG_SR_CEIS, and RNG_SR_SEIS.
◆ rng_interrupt_disable()
void rng_interrupt_disable |
( |
void |
| ) |
|
Disable the Random Number Generator error interrupt.
Definition at line 56 of file rng_common_v1.c.
References RNG_CR.
◆ rng_interrupt_enable()
void rng_interrupt_enable |
( |
void |
| ) |
|