NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
True Random Number Generator (TRNG) HW driver header file. More...
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | neorv32_trng_t |
Functions | |
Prototypes | |
int | neorv32_trng_available (void) |
void | neorv32_trng_enable (int irq_sel) |
void | neorv32_trng_disable (void) |
void | neorv32_trng_fifo_clear (void) |
int | neorv32_trng_get_fifo_depth (void) |
int | neorv32_trng_get (uint8_t *data) |
int | neorv32_trng_check_sim_mode (void) |
IO Device: True Random Number Generator (TRNG) | |
#define | NEORV32_TRNG ((neorv32_trng_t*) (NEORV32_TRNG_BASE)) |
enum | NEORV32_TRNG_CTRL_enum { TRNG_CTRL_DATA_LSB = 0 , TRNG_CTRL_DATA_MSB = 7 , TRNG_CTRL_FIFO_LSB = 16 , TRNG_CTRL_FIFO_MSB = 19 , TRNG_CTRL_IRQ_SEL = 27 , TRNG_CTRL_FIFO_CLR = 28 , TRNG_CTRL_SIM_MODE = 29 , TRNG_CTRL_EN = 30 , TRNG_CTRL_VALID = 31 } |
True Random Number Generator (TRNG) HW driver header file.
#define NEORV32_TRNG ((neorv32_trng_t*) (NEORV32_TRNG_BASE)) |
TRNG module hardware access (neorv32_trng_t)
TRNG control/data register bits
int neorv32_trng_available | ( | void | ) |
Check if TRNG unit was synthesized.
int neorv32_trng_check_sim_mode | ( | void | ) |
Check if TRNG is implemented using SIMULATION mode.
void neorv32_trng_disable | ( | void | ) |
Reset and disable TRNG.
void neorv32_trng_enable | ( | int | irq_sel | ) |
Reset, configure and enable TRNG.
[in] | irq_sel | Interrupt trigger select (0 = data available, 1 = FIFO full). |
void neorv32_trng_fifo_clear | ( | void | ) |
Flush TRNG random data FIFO.
int neorv32_trng_get | ( | uint8_t * | data | ) |
Get random data byte from TRNG.
[in,out] | data | uint8_t pointer for storing random data byte. Will be set to zero if no valid data available. |
int neorv32_trng_get_fifo_depth | ( | void | ) |
Get TRNG FIFO depth.