1.2.26.2 TRNG_RandomNumberGenerate Function

C

void TRNG_RandomNumberGenerate( void )

Summary

Initiates generation of random number using the TRNG peripheral in interrupt mode.

Description

This function triggers the TRNG peripheral to generate a 32-bit random number in interrupt mode.

The generated random number will be passed to the registered callback function once ready.

Precondition

None.

Parameters

None.

Returns

None.

Example

uint32_t random_number;

void testCallback( uint32_t random, uintptr_t context)
{
    random_number = random;
}

TRNG_CallbackRegister(testCallback, NULL);

TRNG_RandomNumberGenerate();

Remarks

This API is only generated when the interrupt mode is enabled.