From 584f19dbe94ea1ad9585ce04c5f1d5b424ebaa09 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 8 Dec 2018 12:04:11 +0000 Subject: Updated TRNG. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12465 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/hal/include/hal_trng.h | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'os/hal/include/hal_trng.h') diff --git a/os/hal/include/hal_trng.h b/os/hal/include/hal_trng.h index 48d95613e..a92f4f665 100644 --- a/os/hal/include/hal_trng.h +++ b/os/hal/include/hal_trng.h @@ -56,10 +56,46 @@ typedef enum { /** * @brief Type of a structure representing a TRNG driver. */ -typedef struct TRNGDriver TRNGDriver; +typedef struct hal_trng_driver TRNGDriver; +/** + * @brief Driver configuration structure. + * @note It could be empty on some architectures. + */ +typedef struct hal_trng_config TRNGConfig; + + +/* Including the low level driver header, it exports information required + for completing types.*/ #include "hal_trng_lld.h" +/** + * @brief Driver configuration structure. + */ +struct hal_trng_config { + /* End of the mandatory fields.*/ + trng_lld_config_fields; +}; + +/** + * @brief Structure representing a TRNG driver. + */ +struct hal_trng_driver { + /** + * @brief Driver state. + */ + trngstate_t state; + /** + * @brief Current configuration data. + */ + const TRNGConfig *config; +#if defined(TRNG_DRIVER_EXT_FIELDS) + TRNG_DRIVER_EXT_FIELDS +#endif + /* End of the mandatory fields.*/ + trng_lld_driver_fields; +}; + /*===========================================================================*/ /* Driver macros. */ /*===========================================================================*/ -- cgit v1.2.3