aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/hal_wspi.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/include/hal_wspi.h')
-rw-r--r--os/hal/include/hal_wspi.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/os/hal/include/hal_wspi.h b/os/hal/include/hal_wspi.h
index c3f2ac248..4f02eb3b5 100644
--- a/os/hal/include/hal_wspi.h
+++ b/os/hal/include/hal_wspi.h
@@ -120,6 +120,8 @@ typedef struct {
uint32_t dummy;
} wspi_command_t;
+/* Including the low level driver header, it exports information required
+ for completing types.*/
#include "hal_wspi_lld.h"
#if !defined(WSPI_SUPPORTS_MEMMAP)
@@ -130,6 +132,49 @@ typedef struct {
#error "low level does not define WSPI_DEFAULT_CFG_MASKS"
#endif
+/**
+ * @brief Driver configuration structure.
+ */
+struct hal_wspi_config {
+ /**
+ * @brief Operation complete callback or @p NULL.
+ */
+ wspicallback_t end_cb;
+ /* End of the mandatory fields.*/
+ wspi_lld_config_fields;
+};
+
+/**
+ * @brief Structure representing an WSPI driver.
+ */
+struct hal_wspi_driver {
+ /**
+ * @brief Driver state.
+ */
+ wspistate_t state;
+ /**
+ * @brief Current configuration data.
+ */
+ const WSPIConfig *config;
+#if (WSPI_USE_WAIT == TRUE) || defined(__DOXYGEN__)
+ /**
+ * @brief Waiting thread.
+ */
+ thread_reference_t thread;
+#endif /* WSPI_USE_WAIT */
+#if (WSPI_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__)
+ /**
+ * @brief Mutex protecting the peripheral.
+ */
+ mutex_t mutex;
+#endif /* WSPI_USE_MUTUAL_EXCLUSION */
+#if defined(WSPI_DRIVER_EXT_FIELDS)
+ WSPI_DRIVER_EXT_FIELDS
+#endif
+ /* End of the mandatory fields.*/
+ wspi_lld_driver_fields;
+};
+
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/