aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32L1xx/stm32_dma.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-11-11 14:11:52 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-11-11 14:11:52 +0000
commit3d09e9e86c134035e02ecf92255f72d8d08fdcf5 (patch)
tree41b965c89e94a919ffac757e04aeb218924d04ca /os/hal/platforms/STM32L1xx/stm32_dma.h
parent1ae84c9323e76f02ec4bc4d71aff4301ba5d00e7 (diff)
downloadChibiOS-3d09e9e86c134035e02ecf92255f72d8d08fdcf5.tar.gz
ChibiOS-3d09e9e86c134035e02ecf92255f72d8d08fdcf5.tar.bz2
ChibiOS-3d09e9e86c134035e02ecf92255f72d8d08fdcf5.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3486 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32L1xx/stm32_dma.h')
-rw-r--r--os/hal/platforms/STM32L1xx/stm32_dma.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/os/hal/platforms/STM32L1xx/stm32_dma.h b/os/hal/platforms/STM32L1xx/stm32_dma.h
index 7cfcf7536..e22d99f2b 100644
--- a/os/hal/platforms/STM32L1xx/stm32_dma.h
+++ b/os/hal/platforms/STM32L1xx/stm32_dma.h
@@ -72,6 +72,28 @@
#define STM32_DMA_STREAM_ID(dma, stream) ((stream) - 1)
/**
+ * @brief Returns a DMA stream identifier mask.
+ *
+ *
+ * @param[in] dma the DMA unit number
+ * @param[in] stream the stream number
+ * @return A DMA stream identifier mask.
+ */
+#define STM32_DMA_STREAM_ID_MSK(dma, stream) \
+ (1 << STM32_DMA_STREAM_ID(dma, stream))
+
+/**
+ * @brief Checks if a DMA stream unique identifier belongs to a mask.
+ * @param[in] id the stream numeric identifier
+ * @param[in] mask the stream numeric identifiers mask
+ *
+ * @retval The check result.
+ * @retval FALSE id does not belong to the mask.
+ * @retval TRUE id belongs to the mask.
+ */
+#define STM32_DMA_IS_VALID_ID(id, mask) (((1 << (id)) & (mask)))
+
+/**
* @brief Returns a pointer to a stm32_dma_stream_t structure.
*
* @param[in] id the stream numeric identifier