aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/DACv1/dac_lld.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-05-02 09:11:13 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-05-02 09:11:13 +0000
commit43bbd7c80a69f6d1b40f0baff36d48b3f0c52c8f (patch)
tree91d5ae1500166a70c62947baf7693e7001aece1c /os/hal/ports/STM32/LLD/DACv1/dac_lld.h
parentf112ffa1e6e4a2e3bc3c6754f2e6ed7de030c12f (diff)
downloadChibiOS-43bbd7c80a69f6d1b40f0baff36d48b3f0c52c8f.tar.gz
ChibiOS-43bbd7c80a69f6d1b40f0baff36d48b3f0c52c8f.tar.bz2
ChibiOS-43bbd7c80a69f6d1b40f0baff36d48b3f0c52c8f.zip
Changes to the DAC driver, not tested yet.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7935 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/LLD/DACv1/dac_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/DACv1/dac_lld.h65
1 files changed, 44 insertions, 21 deletions
diff --git a/os/hal/ports/STM32/LLD/DACv1/dac_lld.h b/os/hal/ports/STM32/LLD/DACv1/dac_lld.h
index f63d64139..fe0e21006 100644
--- a/os/hal/ports/STM32/LLD/DACv1/dac_lld.h
+++ b/os/hal/ports/STM32/LLD/DACv1/dac_lld.h
@@ -221,6 +221,40 @@
/*===========================================================================*/
/**
+ * @brief DAC channel parameters type.
+ */
+typedef struct {
+ /**
+ * @brief Pointer to the DAC registers block.
+ */
+ DAC_TypeDef *dac;
+ /**
+ * @brief DAC data registers offset.
+ */
+ uint32_t dataoffset;
+ /**
+ * @brief DAC CR register bit offset.
+ */
+ uint32_t regshift;
+ /**
+ * @brief DAC CR register mask.
+ */
+ uint32_t regmask;
+ /**
+ * @brief Associated DMA.
+ */
+ const stm32_dma_stream_t *dma;
+ /**
+ * @brief Mode bits for the DMA.
+ */
+ uint32_t dmamode;
+ /**
+ * @brief DMA channel IRQ priority.
+ */
+ uint32_t dmairqprio;
+} dacparams_t;
+
+/**
* @brief Type of a structure representing an DAC driver.
*/
typedef struct DACDriver DACDriver;
@@ -292,17 +326,6 @@ typedef struct {
*/
dacerrorcallback_t error_cb;
/* End of the mandatory fields.*/
-} DACConversionGroup;
-
-/**
- * @brief Driver configuration structure.
- */
-typedef struct {
- /**
- * @brief Initial sample to be presented on outputs.
- */
- dacsample_t sample;
- /* End of the mandatory fields.*/
/**
* @brief DAC data holding register mode.
*/
@@ -314,6 +337,14 @@ typedef struct {
* other fields are handled internally.
*/
uint32_t cr_tsel;
+} DACConversionGroup;
+
+/**
+ * @brief Driver configuration structure.
+ */
+typedef struct {
+ /* End of the mandatory fields.*/
+ uint32_t dummy;
} DACConfig;
/**
@@ -357,17 +388,9 @@ struct DACDriver {
#endif
/* End of the mandatory fields.*/
/**
- * @brief Pointer to the DAC registers block.
+ * @brief DAC channel parameters.
*/
- DAC_TypeDef *dac;
- /**
- * @brief Transmit DMA stream.
- */
- const stm32_dma_stream_t *dma;
- /**
- * @brief TX DMA mode bit mask.
- */
- uint32_t dmamode;
+ const dacparams_t *params;
};
/*===========================================================================*/