| M480 BSP V3.05.001 The Board Support Package for M480 Series

Functions
TRNG Exported Functions
Standard Driver » TRNG Driver

## Functions
void | TRNG_Open (void)
| Initialize TRNG hardware. More...
int32_t | TRNG_GenWord (uint32_t *u32RndNum)
| Generate a 32-bits random number word. More...
int32_t | TRNG_GenBignum (uint8_t u8BigNum[], int32_t i32Len)
| Generate a big number in binary format. More...
int32_t | TRNG_GenBignumHex (char cBigNumHex[], int32_t i32Len)
| Generate a big number in hex format. More...

## Detailed Description

## Function Documentation

## ◆ TRNG_GenBignum()

int32_t TRNG_GenBignum | ( | uint8_t | u8BigNum[],
|  | int32_t | i32Len
| ) |  |

Generate a big number in binary format.

Parameters

  [out] | u8BigNum | The output big number.
  [in] | i32Len | Request bit length of the output big number. It must be multiple of 8.

Returns
  Success or time-out.

Return values

  0 | Success
  -1 | Time-out. TRNG hardware may not be enabled.

Definition at line 91 of file trng.c.

## ◆ TRNG_GenBignumHex()

int32_t TRNG_GenBignumHex | ( | char | cBigNumHex[],
|  | int32_t | i32Len
| ) |  |

Generate a big number in hex format.

Parameters

  [out] | cBigNumHex | The output hex format big number.
  [in] | i32Len | Request bit length of the output big number. It must be multiple of 8.

Returns
  Success or time-out.

Return values

  0 | Success
  -1 | Time-out. TRNG hardware may not be enabled.

Definition at line 125 of file trng.c.

## ◆ TRNG_GenWord()

int32_t TRNG_GenWord | ( | uint32_t * | u32RndNum | ) |

Generate a 32-bits random number word.

Parameters

  [out] | u32RndNum | The output 32-bits word random number.

Returns
  Success or time-out.

Return values

  0 | Success
  -1 | Time-out. TRNG hardware may not be enabled.

Definition at line 55 of file trng.c.

## ◆ TRNG_Open()

void TRNG_Open | ( | void |  | ) |

Initialize TRNG hardware.

Returns
  None

Definition at line 33 of file trng.c.