diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-12-08 12:04:11 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-12-08 12:04:11 +0000 |
commit | 584f19dbe94ea1ad9585ce04c5f1d5b424ebaa09 (patch) | |
tree | 1b4dd0db56ed8a52af8e405307060f176f50ed81 /os/hal/include | |
parent | 358fdba16d69bbb8ec872288e8fd00a5e59a2b18 (diff) | |
download | ChibiOS-584f19dbe94ea1ad9585ce04c5f1d5b424ebaa09.tar.gz ChibiOS-584f19dbe94ea1ad9585ce04c5f1d5b424ebaa09.tar.bz2 ChibiOS-584f19dbe94ea1ad9585ce04c5f1d5b424ebaa09.zip |
Updated TRNG.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12465 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/include')
-rw-r--r-- | os/hal/include/hal_spi.h | 62 | ||||
-rw-r--r-- | os/hal/include/hal_trng.h | 38 |
2 files changed, 68 insertions, 32 deletions
diff --git a/os/hal/include/hal_spi.h b/os/hal/include/hal_spi.h index ab07811c0..4d2ebdefb 100644 --- a/os/hal/include/hal_spi.h +++ b/os/hal/include/hal_spi.h @@ -143,37 +143,6 @@ typedef void (*spicallback_t)(SPIDriver *spip); #include "hal_spi_lld.h"
/**
- * @brief Structure representing an SPI driver.
- */
-struct hal_spi_driver {
- /**
- * @brief Driver state.
- */
- spistate_t state;
- /**
- * @brief Current configuration data.
- */
- const SPIConfig *config;
-#if SPI_USE_WAIT || defined(__DOXYGEN__)
- /**
- * @brief Waiting thread.
- */
- thread_reference_t thread;
-#endif /* SPI_USE_WAIT */
-#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
- /**
- * @brief Mutex protecting the peripheral.
- */
- mutex_t mutex;
-#endif /* SPI_USE_MUTUAL_EXCLUSION */
-#if defined(SPI_DRIVER_EXT_FIELDS)
- SPI_DRIVER_EXT_FIELDS
-#endif
- /* End of the mandatory fields.*/
- spi_lld_driver_fields;
-};
-
-/**
* @brief Driver configuration structure.
*/
struct hal_spi_config {
@@ -217,6 +186,37 @@ struct hal_spi_config { spi_lld_config_fields;
};
+/**
+ * @brief Structure representing an SPI driver.
+ */
+struct hal_spi_driver {
+ /**
+ * @brief Driver state.
+ */
+ spistate_t state;
+ /**
+ * @brief Current configuration data.
+ */
+ const SPIConfig *config;
+#if SPI_USE_WAIT || defined(__DOXYGEN__)
+ /**
+ * @brief Waiting thread.
+ */
+ thread_reference_t thread;
+#endif /* SPI_USE_WAIT */
+#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
+ /**
+ * @brief Mutex protecting the peripheral.
+ */
+ mutex_t mutex;
+#endif /* SPI_USE_MUTUAL_EXCLUSION */
+#if defined(SPI_DRIVER_EXT_FIELDS)
+ SPI_DRIVER_EXT_FIELDS
+#endif
+ /* End of the mandatory fields.*/
+ spi_lld_driver_fields;
+};
+
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
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. */
/*===========================================================================*/
|