Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the RNGA HAL driver.
Macros | |
#define | MAX_COUNT 4096 |
The maximum CPU clock cycles that the RNGA module uses to get new random data. | |
Enumerations | |
enum | rnga_mode_t { kRNGAModeNormal = 0U, kRNGAModeSleep = 1U } |
RNGA working mode. More... | |
enum | rnga_output_reg_level_t { kRNGAOutputRegLevelNowords = 0U, kRNGAOutputRegLevelOneword = 1U } |
Defines the value of output register level. More... | |
enum | rnga_status_t { kStatus_RNGA_Success = 0U, kStatus_RNGA_InvalidArgument = 1U, kStatus_RNGA_Underflow = 2U, kStatus_RNGA_Timeout = 3U, kStatus_RNGA_OSAError = 4U } |
Status structure for RNGA. More... | |
RNGA HAL. | |
static void | RNGA_HAL_Init (RNG_Type *base) |
Initializes the RNGA module. More... | |
static void | RNGA_HAL_Enable (RNG_Type *base) |
Enables the RNGA module. More... | |
static void | RNGA_HAL_Disable (RNG_Type *base) |
Disables the RNGA module. More... | |
static void | RNGA_HAL_SetHighAssuranceCmd (RNG_Type *base, bool enable) |
Sets the RNGA high assurance. More... | |
static void | RNGA_HAL_SetIntMaskCmd (RNG_Type *base, bool enable) |
Sets the RNGA interrupt mask. More... | |
static void | RNGA_HAL_ClearIntFlag (RNG_Type *base, bool enable) |
Clears the RNGA interrupt. More... | |
static void | RNGA_HAL_SetWorkModeCmd (RNG_Type *base, rnga_mode_t mode) |
Sets the RNGA in sleep mode or normal mode. More... | |
static uint8_t | RNGA_HAL_GetOutputRegSize (RNG_Type *base) |
Gets the output register size. More... | |
static rnga_output_reg_level_t | RNGA_HAL_GetOutputRegLevel (RNG_Type *base) |
Gets the output register level. More... | |
static rnga_mode_t | RNGA_HAL_GetWorkMode (RNG_Type *base) |
Gets the RNGA working mode. More... | |
static bool | RNGA_HAL_GetErrorIntCmd (RNG_Type *base) |
Gets the RNGA status whether an error interrupt has occurred. More... | |
static bool | RNGA_HAL_GetOutputRegUnderflowCmd (RNG_Type *base) |
Gets the RNGA status whether an output register underflow has occurred. More... | |
static bool | RNGA_HAL_GetLastReadStatusCmd (RNG_Type *base) |
Gets the most recent RNGA read status. More... | |
static bool | RNGA_HAL_GetSecurityViolationCmd (RNG_Type *base) |
Gets the RNGA status whether a security violation has occurred. More... | |
static uint32_t | RNGA_HAL_ReadRandomData (RNG_Type *base) |
Gets random data from the RNGA. More... | |
rnga_status_t | RNGA_HAL_GetRandomData (RNG_Type *base, uint32_t *data) |
Gets random data. More... | |
static void | RNGA_HAL_WriteSeed (RNG_Type *base, uint32_t data) |
Inputs an entropy value used to seed the RNGA. More... | |
enum rnga_mode_t |
enum rnga_status_t |
|
inlinestatic |
This function initializes the RNGA to a default state.
base | RNGA base address |
|
inlinestatic |
This function enables the RNGA random data generation and loading.
base | RNGA base address |
|
inlinestatic |
This function disables the RNGA module.
base | RNGA base address |
|
inlinestatic |
This function sets the RNGA high assurance (notification of security violations.
base | RNGA base address |
enable | 0 means notification of security violations disabled. 1 means notification of security violations enabled. |
|
inlinestatic |
This function sets the RNGA error interrupt mask.
base | RNGA base address |
enable | 0 means unmask RNGA interrupt. 1 means mask RNGA interrupt. |
|
inlinestatic |
This function clears the RNGA interrupt.
base | RNGA base address |
enable | 0 means do not clear the interrupt. 1 means clear the interrupt. |
|
inlinestatic |
This function specifies whether the RNGA is in sleep mode or normal mode.
base | RNGA base address |
mode | kRNGAModeNormal means set RNGA in normal mode. kRNGAModeSleep means set RNGA in sleep mode. |
|
inlinestatic |
This function gets the size of the output register as 32-bit random data words it can hold.
base | RNGA base address |
|
inlinestatic |
This function gets the number of random-data words that are in OR [RANDOUT], which indicates if OR is valid.
base,RNGA | base address |
|
inlinestatic |
This function checks whether the RNGA works in sleep mode or normal mode.
base | RNGA base address |
|
inlinestatic |
This function gets the RNGA status whether an OR underflow condition has occurred since the error interrupt was last cleared or the RNGA was reset.
base | RNGA base address |
|
inlinestatic |
This function gets the RNGA status whether an OR underflow condition has occurred since the register (SR) was last read or the RNGA was reset.
base | RNGA base address |
|
inlinestatic |
This function gets the RNGA status whether the most recent read of OR[RANDOUT] causes an OR underflow condition.
base | RNGA base address |
|
inlinestatic |
This function gets the RNGA status whether a security violation has occurred when high assurance is enabled.
base | RNGA base address |
|
inlinestatic |
This function gets random data from the RNGA.
base | RNGA base address |
rnga_status_t RNGA_HAL_GetRandomData | ( | RNG_Type * | base, |
uint32_t * | data | ||
) |
This function gets random data from RNGA.
base | RNGA base address |
data | pointer address used to store random data |
|
inlinestatic |
This function specifies an entropy value that RNGA uses with its ring oscillations to seed its pseudo-random algorithm.
base | RNGA base address |
data | external entropy value |