stm32:rng: add helper to actually get random numbers

Simplified blocking API, with an async routine if you really need it.
Follows as best as I can understand the reference manual, but testing
those conditions will be difficult.
This commit is contained in:
Karl Palsson
2017-01-12 22:57:27 +00:00
parent 05829037de
commit f07b58c6d8
2 changed files with 52 additions and 0 deletions

View File

@@ -28,6 +28,9 @@ specific memorymap.h header before including this header file.*/
#ifndef LIBOPENCM3_RNG_V1_H
#define LIBOPENCM3_RNG_V1_H
#include <stdbool.h>
#include <stdint.h>
/**@{*/
/* --- Random number generator registers ----------------------------------- */
@@ -72,6 +75,8 @@ BEGIN_DECLS
void rng_enable(void);
void rng_disable(void);
bool rng_get_random(uint32_t *rand_nr);
uint32_t rng_get_random_blocking(void);
END_DECLS