1.2.26.2 1.4.27.2 1.6.26.2 1.8.23.1 1.9.24.2 1.25.24.1 1.26.21.1 1.27.24.1 1.28.26.1 1.32.30.2 1.34.24.1 1.38.26.2 1.39.22.2 1.40.25.2 1.41.22.1 1.42.21.1 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.