Microchip® Advanced Software Framework

trng_example.c File Reference

True Random Number Generator (TRNG) example for SAM.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"

Functions

static void configure_console (void)
 Configure the console UART. More...
 
int main (void)
 Application entry point for TRNG example. More...
 
void TRNG_Handler (void)
 Interrupt handler for the TRNG. More...
 

static void configure_console ( void  )
static

Configure the console UART.

References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().

Referenced by main().

int main ( void  )

Application entry point for TRNG example.

Enable the TRNG, display the generated random value.

Returns
Unused (ANSI-C compatibility).

References board_init(), BOARD_NAME, configure_console(), pmc_enable_periph_clk(), sysclk_init(), trng_enable(), and trng_enable_interrupt().

void TRNG_Handler ( void  )

Interrupt handler for the TRNG.

Display the random value on the terminal.

References status, trng_get_interrupt_status(), and trng_read_output_data().