AM263Px MCU+ SDK  09.01.00

Introduction

This module contains APIs to program and use the RNG.

Files

file  rng.h
 This file contains the prototype of RNG driver APIs.
 

Data Structures

struct  RNG_Attrs
 RNG attributes. More...
 
struct  RNG_Config
 RNG driver context. More...
 

Functions

RNG_Handle RNG_open (uint32_t index)
 Function to Open RNG instance, Initialize clocks. More...
 
RNG_Return_t RNG_close (RNG_Handle handle)
 Function to close a RNG module specified by the RNG handle. More...
 
RNG_Return_t RNG_setup (RNG_Handle handle)
 setup the RNG module. More...
 
RNG_Return_t RNG_read (RNG_Handle handle, uint32_t *out)
 Read random numbers into the output buffer. More...
 

Typedefs

typedef void * RNG_Handle
 Handle to the RNG driver. More...
 

Enumerations

enum  RNG_Return_t { RNG_RETURN_SUCCESS = 0xDE3BA502U, RNG_RETURN_FAILURE = 0xF33BE03EU }
 RNG Driver Error code. More...
 

Macros

#define RNG_DRBG_MODE   (TRUE)
 
#define RNG_DRBG_DISABLE_MODE   (FALSE)
 
#define RNG_CONTROL_REQUEST_DATA_MASK   (0x00010000U)
 
#define RNG_CONTROL_DATA_BLOCKS_MASK   (0xFFF00000U)
 
#define RNG_CONTROL_DRBG_EN_SHIFT   (0x0000000CU)
 
#define RNG_CONTROL_ENABLE_TRNG_SHIFT   (0x0000000AU)
 
#define RNG_STATUS_RESEED_AI_MASK   (0x00000400U)
 
#define RNG_DRBG_SEED_MAX_ARRY_SIZE_IN_DWORD   (12U)
 
#define DEVTYPE_HSSE   (0x0AU)
 device type HSSE More...
 

Macro Definition Documentation

◆ RNG_DRBG_MODE

#define RNG_DRBG_MODE   (TRUE)

Rng drbg mode macro

◆ RNG_DRBG_DISABLE_MODE

#define RNG_DRBG_DISABLE_MODE   (FALSE)

Rng drbg mode disable

◆ RNG_CONTROL_REQUEST_DATA_MASK

#define RNG_CONTROL_REQUEST_DATA_MASK   (0x00010000U)

Rng control request data mask

◆ RNG_CONTROL_DATA_BLOCKS_MASK

#define RNG_CONTROL_DATA_BLOCKS_MASK   (0xFFF00000U)

Rng control data block mask

◆ RNG_CONTROL_DRBG_EN_SHIFT

#define RNG_CONTROL_DRBG_EN_SHIFT   (0x0000000CU)

Rng control drbg enable shift

◆ RNG_CONTROL_ENABLE_TRNG_SHIFT

#define RNG_CONTROL_ENABLE_TRNG_SHIFT   (0x0000000AU)

Rng control enable trng shift

◆ RNG_STATUS_RESEED_AI_MASK

#define RNG_STATUS_RESEED_AI_MASK   (0x00000400U)

Rng satus reseed Ai mask

◆ RNG_DRBG_SEED_MAX_ARRY_SIZE_IN_DWORD

#define RNG_DRBG_SEED_MAX_ARRY_SIZE_IN_DWORD   (12U)

Maximum seed array size in dword

◆ DEVTYPE_HSSE

#define DEVTYPE_HSSE   (0x0AU)

device type HSSE

Typedef Documentation

◆ RNG_Handle

typedef void* RNG_Handle

Handle to the RNG driver.

Enumeration Type Documentation

◆ RNG_Return_t

RNG Driver Error code.

The enumeration describes all the possible return and error codes which the RNG Driver can return

Enumerator
RNG_RETURN_SUCCESS 

Success/pass return code

RNG_RETURN_FAILURE 

General or unspecified failure/error

Function Documentation

◆ RNG_open()

RNG_Handle RNG_open ( uint32_t  index)

Function to Open RNG instance, Initialize clocks.

Returns
A RNG_Handle on success or a NULL on an error or if it has been opened already

◆ RNG_close()

RNG_Return_t RNG_close ( RNG_Handle  handle)

Function to close a RNG module specified by the RNG handle.

Parameters
handleRNG_Handle returned from RNG_open()
Returns
returns RNG_RETURN_SUCCESS if requested data is available. RNG_RETURN_FAILURE if RNG is not initialized.

◆ RNG_setup()

RNG_Return_t RNG_setup ( RNG_Handle  handle)

setup the RNG module.

Parameters
handleRNG_Handle returned from RNG_open()
Returns
returns RNG_RETURN_SUCCESS if requested data is available. RNG_RETURN_FAILURE if RNG is not initialized.

◆ RNG_read()

RNG_Return_t RNG_read ( RNG_Handle  handle,
uint32_t *  out 
)

Read random numbers into the output buffer.

Parameters
handleRNG_Handle returned from RNG_open()
outpointer to the buffer for the 128 bit random data.
Returns
returns RNG_RETURN_SUCCESS if requested data is available. RNG_RETURN_FAILURE if RNG is not initialized.

Variable Documentation

◆ gRngConfig

RNG_Config gRngConfig[]
extern

Externally defined driver configuration array.

◆ gRngConfigNum

uint32_t gRngConfigNum
extern

Externally defined driver configuration Num.