aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/hal_wspi.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-12-09 09:11:21 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-12-09 09:11:21 +0000
commit964ca6029035706e5ba5be7a8304eba67920386d (patch)
tree33dd1e258a78ff1c40f10bfdcb7c394678f0d84e /os/hal/include/hal_wspi.h
parent584f19dbe94ea1ad9585ce04c5f1d5b424ebaa09 (diff)
downloadChibiOS-964ca6029035706e5ba5be7a8304eba67920386d.tar.gz
ChibiOS-964ca6029035706e5ba5be7a8304eba67920386d.tar.bz2
ChibiOS-964ca6029035706e5ba5be7a8304eba67920386d.zip
DAC reworked, fixed a problem in WSPI template.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12466 110e8d01-0319-4d1e-a829-52ad28d1bb01
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. */
/*===========================================================================*/