aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/platforms/STM32/spi_lld.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-10-24 18:25:31 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-10-24 18:25:31 +0000
commit81f043865e8bc737cadd82e919d334f24df6e50f (patch)
treef29cb9e235a79e02f05521c30acae2da22e1e6a6 /os/io/platforms/STM32/spi_lld.h
parent216990672983c3c551f2aaf45cf27d8f9ce68036 (diff)
downloadChibiOS-81f043865e8bc737cadd82e919d334f24df6e50f.tar.gz
ChibiOS-81f043865e8bc737cadd82e919d334f24df6e50f.tar.bz2
ChibiOS-81f043865e8bc737cadd82e919d334f24df6e50f.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1253 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io/platforms/STM32/spi_lld.h')
-rw-r--r--os/io/platforms/STM32/spi_lld.h36
1 files changed, 30 insertions, 6 deletions
diff --git a/os/io/platforms/STM32/spi_lld.h b/os/io/platforms/STM32/spi_lld.h
index b6698e1b2..5e5c26106 100644
--- a/os/io/platforms/STM32/spi_lld.h
+++ b/os/io/platforms/STM32/spi_lld.h
@@ -41,7 +41,7 @@
/**
* @brief SPI1 driver enable switch.
- * @details If set to @p TRUE the support for SPI is included.
+ * @details If set to @p TRUE the support for SPI1 is included.
* @note The default is @p TRUE.
*/
#if !defined(USE_STM32_SPI1) || defined(__DOXYGEN__)
@@ -49,14 +49,34 @@
#endif
/**
- * @brief SPI1 driver enable switch.
- * @details If set to @p TRUE the support for SPI is included.
+ * @brief SPI2 driver enable switch.
+ * @details If set to @p TRUE the support for SPI2 is included.
* @note The default is @p TRUE.
*/
#if !defined(USE_STM32_SPI2) || defined(__DOXYGEN__)
#define USE_STM32_SPI2 TRUE
#endif
+/**
+ * @brief SPI1 DMA priority (0..3).
+ * @note The priority level is used for both the TX and RX DMA channels but
+ * because of the channels ordering the RX channel has always priority
+ * over the TX channel.
+ */
+#if !defined(SPI1_DMA_PRIORITY) || defined(__DOXYGEN__)
+#define SPI1_DMA_PRIORITY 2
+#endif
+
+/**
+ * @brief SPI2 DMA priority (0..3).
+ * @note The priority level is used for both the TX and RX DMA channels but
+ * because of the channels ordering the RX channel has always priority
+ * over the TX channel.
+ */
+#if !defined(SPI2_DMA_PRIORITY) || defined(__DOXYGEN__)
+#define SPI2_DMA_PRIORITY 2
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@@ -65,9 +85,9 @@
* @brief Driver state machine possible states.
*/
typedef enum {
- SPI_UNINIT = 0,
- SPI_IDLE = 1,
- SPI_ACTIVE = 2
+ SPI_UNINIT = 0,//!< SPI_UNINIT
+ SPI_IDLE = 1, //!< SPI_IDLE
+ SPI_ACTIVE = 2 //!< SPI_ACTIVE
} spistate_t;
/**
@@ -128,6 +148,10 @@ typedef struct {
* @brief Pointer to the transmit DMA channel registers block.
*/
DMA_Channel_TypeDef *spd_dmatx;
+ /**
+ * @brief DMA priority bit mask.
+ */
+ uint32_t spd_dmaprio;
} SPIDriver;
/*===========================================================================*/