Microchip® Advanced Software Framework

trng.h File Reference

SAM True Random Number Generator (TRNG) Driver.

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

#include <compiler.h>
#include <system.h>

Data Structures

struct  trng_config
 TRNG module configuration structure. More...
 
struct  trng_events
 TRNG event enable/disable structure. More...
 
struct  trng_module
 TRNG software device instance structure. More...
 

Typedefs

typedef void(* trng_callback_t )(struct trng_module *const module_inst)
 Type definition for a TRNG module callback function. More...
 

Enumerations

enum  trng_callback { TRNG_CALLBACK_READ_BUFFER = 0 }
 Enum for possible callback types for the TRNG module. More...
 

Functions

Driver Initialization and Configuration
enum status_code trng_init (struct trng_module *const module_inst, Trng *const hw, struct trng_config *const config)
 Initializes a hardware TRNG module instance. More...
 
static void trng_get_config_defaults (struct trng_config *const config)
 Initializes all members of a TRNG configuration structure to safe defaults. More...
 
static void trng_enable (struct trng_module *const module_inst)
 Enables a TRNG that was previously configured. More...
 
static void trng_disable (struct trng_module *const module_inst)
 Disables a TRNG that was previously enabled. More...
 
static void trng_enable_events (struct trng_module *const module_inst, struct trng_events *const events)
 Enables a TRNG event output. More...
 
static void trng_disable_events (struct trng_module *const module_inst, struct trng_events *const events)
 Disables a TRNG event output. More...
 
Read TRNG Result
static enum status_code trng_read (struct trng_module *const module_inst, uint32_t *result)
 Read the random data result. More...
 

Variables

struct trng_module_trng_instance