26.8.1.1.2 Code

Copy-paste the following set up code to your user application:
/* TRNG module software instance (must not go out of scope while in use) */
static struct trng_module trng_instance;

void configure_trng(void)
{
    /* Create a new configuration structure for the TRNG settings
     * and fill with the default module settings. */
    struct trng_config config_trng;
    trng_get_config_defaults(&config_trng);

    /* Alter any TRNG configuration settings here if required */

    /* Initialize TRNG with the user settings */
    trng_init(&trng_instance, TRNG, &config_trng);
}
Add to user application initialization (typically the start of main()):
system_init();
configure_trng();
trng_enable(&trng_instance);