#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_types.h"
#include "../inc/hw_trng.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_ints.h"
#include "debug.h"
#include "interrupt.h"
#include "cpu.h"
Macros | |
#define | TRNG_NUMBER_READY 0x00000001 |
#define | TRNG_FRO_SHUTDOWN 0x00000002 |
#define | TRNG_NEED_CLOCK 0x80000000 |
#define | TRNG_HI_WORD 0x00000001 |
#define | TRNG_LOW_WORD 0x00000002 |
Functions | |
void | TRNGConfigure (uint32_t ui32MinSamplesPerCycle, uint32_t ui32MaxSamplesPerCycle, uint32_t ui32ClocksPerSample) |
Configure the true random number generator. More... | |
static void | TRNGEnable (void) |
Enable the TRNG. More... | |
static void | TRNGDisable (void) |
Disable the TRNG module. More... | |
uint32_t | TRNGNumberGet (uint32_t ui32Word) |
Get a random number from the generator. More... | |
static uint32_t | TRNGStatusGet (void) |
Get the status of the TRNG. More... | |
static void | TRNGReset (void) |
Reset the TRNG. More... | |
static void | TRNGIntEnable (uint32_t ui32IntFlags) |
Enables individual TRNG interrupt sources. More... | |
static void | TRNGIntDisable (uint32_t ui32IntFlags) |
Disables individual TRNG interrupt sources. More... | |
static uint32_t | TRNGIntStatus (bool bMasked) |
Gets the current interrupt status of the TRNG module. More... | |
static void | TRNGIntClear (uint32_t ui32IntFlags) |
Clears TRNG interrupt sources. More... | |
static void | TRNGIntRegister (void(*pfnHandler)(void)) |
Registers an interrupt handler for a TRNG interrupt in the dynamic interrupt table. More... | |
static void | TRNGIntUnregister (void) |
Unregisters an interrupt handler for a TRNG interrupt in the dynamic interrupt table. More... | |