Create a TRNG device instance struct, which will be associated with a TRNG peripheral hardware instance.
staticstructtrng_module trng_instance;
Note: Device instance structures shall never go out of scope when in use.
Create a new function configure_trng(), which will be used to configure the overall TRNG peripheral.
void configure_trng(void)
Create a TRNG peripheral configuration structure that will be filled out to set the module configuration.
structtrng_config config_trng;
Fill the TRNG peripheral configuration structure with the default module configuration values.
trng_get_config_defaults(&config_trng);
Initialize the TRNG peripheral and associate it with the software instance structure that was defined previously.
trng_init(&trng_instance, TRNG, &config_trng);
Enable the now initialized TRNG peripheral.
trng_enable(&trng_instance);
The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.