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... | |
void TRNGConfigure | ( | uint32_t | ui32MinSamplesPerCycle, |
uint32_t | ui32MaxSamplesPerCycle, | ||
uint32_t | ui32ClocksPerSample | ||
) |
Configure the true random number generator.
Use this function to set the minimum and maximum number of samples required in each generation of a new random number.
ui32MinSamplesPerCycle | is the minimum number of samples per each generated random number. Constraints:
|
ui32MaxSamplesPerCycle | is the maximum number of samples per each generated random number. Constraints:
|
ui32ClocksPerSample | is the number of clock cycles for each time a new sample is generated from the FROs.
|
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Clears TRNG interrupt sources.
The specified TRNG interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being recognized again immediately upon exit.
ui32IntFlags | is a bit mask of the interrupt sources to be cleared. The parameter is the bitwise OR of any of the following: |
|
inlinestatic |
Disables individual TRNG interrupt sources.
This function disables the indicated TRNG interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
ui32IntFlags | is the bit mask of the interrupt sources to be disabled. The parameter is the bitwise OR of any of the following: |
|
inlinestatic |
Enables individual TRNG interrupt sources.
This function enables the indicated TRNG interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
ui32IntFlags | is the bit mask of the interrupt sources to be enabled. The parameter is the bitwise OR of any of the following: |
|
inlinestatic |
Registers an interrupt handler for a TRNG interrupt in the dynamic interrupt table.
This function registers a function as the interrupt handler for a specific interrupt and enables the corresponding interrupt in the interrupt controller.
Specific TRNG interrupts must be enabled via TRNGIntEnable(). It is the interrupt handler's responsibility to clear the interrupt source.
pfnHandler | is a pointer to the function to be called when the TRNG interrupt occurs. |
|
inlinestatic |
Gets the current interrupt status of the TRNG module.
This function returns the interrupt status for the specified TRNG. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.
bMasked | selects either raw or masked interrupt status.
|
|
inlinestatic |
Unregisters an interrupt handler for a TRNG interrupt in the dynamic interrupt table.
This function does the actual unregistering of the interrupt handler. It clears the handler to be called when a Crypto interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
uint32_t TRNGNumberGet | ( | uint32_t | ui32Word | ) |
Get a random number from the generator.
Use this function to get either the high or low part of the 64 bit generated number.
ui32Word | determines if whether to return the high or low 32 bits. |
Referenced by TRNGDisable().
|
inlinestatic |
|
inlinestatic |
Get the status of the TRNG.
Use this function to retrieve the status of the TRNG.
#define TRNG_FRO_SHUTDOWN 0x00000002 |
Referenced by TRNGIntClear(), TRNGIntDisable(), and TRNGIntEnable().
#define TRNG_HI_WORD 0x00000001 |
Referenced by TRNGNumberGet().
#define TRNG_LOW_WORD 0x00000002 |
Referenced by TRNGNumberGet().
#define TRNG_NEED_CLOCK 0x80000000 |
#define TRNG_NUMBER_READY 0x00000001 |
Referenced by TRNGIntClear(), TRNGIntDisable(), and TRNGIntEnable().