123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #ifndef HAL_TRNG_H
- #define HAL_TRNG_H
- #if (HAL_USE_TRNG == TRUE) || defined(__DOXYGEN__)
- typedef enum {
- TRNG_UNINIT = 0,
- TRNG_STOP = 1,
- TRNG_READY = 2,
- TRNG_RUNNING = 3
- } trngstate_t;
- typedef struct hal_trng_driver TRNGDriver;
- typedef struct hal_trng_config TRNGConfig;
- #include "hal_trng_lld.h"
- struct hal_trng_config {
-
- trng_lld_config_fields;
- };
- struct hal_trng_driver {
-
- trngstate_t state;
-
- const TRNGConfig *config;
- #if defined(TRNG_DRIVER_EXT_FIELDS)
- TRNG_DRIVER_EXT_FIELDS
- #endif
-
- trng_lld_driver_fields;
- };
- #ifdef __cplusplus
- extern "C" {
- #endif
- void trngInit(void);
- void trngObjectInit(TRNGDriver *trngp);
- void trngStart(TRNGDriver *trngp, const TRNGConfig *config);
- void trngStop(TRNGDriver *trngp);
- bool trngGenerate(TRNGDriver *trngp, size_t size, uint8_t *out);
- #ifdef __cplusplus
- }
- #endif
- #endif
- #endif
|