Mbed OS Reference
Loading...
Searching...
No Matches
TRNG hal functions

Functions

void trng_init (trng_t *obj)
 Initialize the TRNG peripheral. More...
 
void trng_free (trng_t *obj)
 Deinitialize the TRNG peripheral. More...
 
int trng_get_bytes (trng_t *obj, uint8_t *output, size_t length, size_t *output_length)
 Get random data from TRNG peripheral. More...
 

Detailed Description

Function Documentation

◆ trng_init()

void trng_init ( trng_t obj)

Initialize the TRNG peripheral.

Parameters
objThe TRNG object

◆ trng_free()

void trng_free ( trng_t obj)

Deinitialize the TRNG peripheral.

Parameters
objThe TRNG object

◆ trng_get_bytes()

int trng_get_bytes ( trng_t obj,
uint8_t *  output,
size_t  length,
size_t *  output_length 
)

Get random data from TRNG peripheral.

Parameters
objThe TRNG object
outputThe pointer to an output array
lengthThe size of output data, to avoid buffer overwrite
output_lengthThe length of generated data
Returns
0 success, -1 fail