MKMxxZxxACxx5 Bare Metal Software Drivers  R4.1.6
Reference Manual
RNGA API Specification

Overview

This section describes functions and macros of the driver's API.

Macros

#define RNGA_QueueFull()
 Returns queue status. More...
 
#define RNGA_GetVal()
 Returns a new random value. More...
 
#define RNGA_GetStatus()
 Returns lower 8-bits of the status register. More...
 
#define RNGA_WaitAndGetVal(ptr)
 Waits until a new random is generated and then value is returned. More...
 
#define RNGA_SetEntropy(ptr)
 Inserts entropy into the RNGA. More...
 
#define RNGA_Sleep()
 Places RNGA into sleep mode. More...
 
#define RNGA_Wakeup()
 Wakes up RNGA from sleep mode. More...
 
#define RNGA_Init(cfg, ip, callback)
 RNGA initialization. More...
 

Macro Definition Documentation

#define RNGA_QueueFull ( )

This macro returns TRUE when a new random value is ready in the queue for reading. Otherwise macro returns FALSE.

Returns
true (non-zero) new random value is ready in the queue and can be read,
false random value not available.
Note
Implemented as an inline macro.
See also
RNGA_GetVal
#define RNGA_GetVal ( )

This macro returns a new random value from RNGA Output Register.

Returns
uint32 random number.
Note
Implemented as an inline macro.
See also
RNGA_QueueFull
#define RNGA_GetStatus ( )

This macro returns lower 8-bits of the status register.

Returns
uint8 (refer to RNG_SR [7:0] description for more details).
Note
Implemented as an inline macro.
#define RNGA_WaitAndGetVal (   ptr)

This macro waits until a new random number is generated. Afterwards random value is copied to the memory pointed by ptr.

Parameters
ptrPointer to 32-bit random value.
Note
Implemented as an inline macro.
Warning
Calling this macro results in programme stall for up to 256 system clock cycles.
See also
RNGA_GetVal
#define RNGA_SetEntropy (   ptr)

This macro insert entropy into the RNGA. It allows an external user to continually seed the RNGA with externally generated random data.

Parameters
ptrPointer to memory location with eight 32-bit entropy values.
Note
Implemented as an inline macro.
#define RNGA_Sleep ( )

This macro switches RNGA into sleep mode. If module is placed in sleep mode the oscillators are disabled.

Note
Implemented as an inline macro.
See also
RNGA_Wakeup
#define RNGA_Wakeup ( )

This macro transitions RNGA from sleep mode to normal mode. The oscillators will be enabled and a new random values will be generated.

Note
Implemented as an inline macro.
See also
RNGA_Sleep
#define RNGA_Init (   cfg,
  ip,
  callback 
)

This function initializes Random Number Generator Accelerator (RNGA). It also installs callback function for interrupt vector 34.

Parameters
cfgSelect one of the RNGA Configuration Structures.
ipSelect one of the ARM Cortex-M0+ Interrupt Priority Levels.
callbackPointer to the RNGA Callback Function.
Note
Implemented as a function call.