aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.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/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.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/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.h92
1 files changed, 23 insertions, 69 deletions
diff --git a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.h b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.h
index fd0ac2cd1..eada95b2b 100644
--- a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.h
+++ b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.h
@@ -265,80 +265,34 @@
/* Driver data structures and types. */
/*===========================================================================*/
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
/**
- * @brief Driver configuration structure.
+ * @brief Low level fields of the WSPI configuration structure.
*/
-struct hal_wspi_config {
- /**
- * @brief Operation complete callback or @p NULL.
- */
- wspicallback_t end_cb;
- /* End of the mandatory fields.*/
- /**
- * @brief DCR1 register initialization data.
- */
- uint32_t dcr1;
- /**
- * @brief DCR2 register initialization data.
- * @note Prescaler field is internally ORed to this field, leave it
- * to zero.
- */
- uint32_t dcr2;
- /**
- * @brief DCR3 register initialization data.
- */
- uint32_t dcr3;
- /**
- * @brief DCR4 register initialization data.
- */
- uint32_t dcr4;
-};
+#define wspi_lld_config_fields \
+ /* DCR1 register initialization data.*/ \
+ uint32_t dcr1; \
+ /* DCR2 register initialization data. The prescaler field is internally \
+ ORed to this field, leave it to zero.*/ \
+ uint32_t dcr2; \
+ /* DCR3 register initialization data.*/ \
+ uint32_t dcr3; \
+ /* DCR4 register initialization data.*/ \
+ uint32_t dcr4
/**
- * @brief Structure representing an WSPI driver.
+ * @brief Low level fields of the WSPI driver structure.
*/
-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.*/
- /**
- * @brief Pointer to the OCTOSPIx registers block.
- */
- OCTOSPI_TypeDef *ospi;
- /**
- * @brief OCTOSPI DMA stream.
- */
- const stm32_dma_stream_t *dma;
- /**
- * @brief OCTOSPI DMA mode bit mask.
- */
- uint32_t dmamode;
-};
-
-/*===========================================================================*/
-/* Driver macros. */
-/*===========================================================================*/
+#define wspi_lld_driver_fields \
+ /* Pointer to the OCTOSPIx registers block.*/ \
+ OCTOSPI_TypeDef *ospi; \
+ /* OCTOSPI DMA stream.*/ \
+ const stm32_dma_stream_t *dma; \
+ /* OCTOSPI DMA mode bit mask.*/ \
+ uint32_t dmamode
/*===========================================================================*/
/* External declarations. */