26.8.2.2.2 Workflow
- Make the application loop infinitely.
while
(
true
) {
- Start an asynchronous TRNG read job, to store random data into the global buffer and generate a callback when complete.
trng_read_buffer_job(&trng_instance, random_buffer, 5);
- Wait until the asynchronous read job is complete.
while
(!trng_read_done) {
}
trng_read_done =
false
;
- Toggle the board LED to indicate specific size of random data were read.
port_pin_toggle_output_level(LED_0_PIN);
/* Add a short delay to see LED toggle */
volatile
uint32_t delay = 50000;
while
(delay--) {
}