aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32F1xx/stm32_dma.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-11-11 14:40:00 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-11-11 14:40:00 +0000
commit6eae3c1de5a1936247676750132758d17d9bdaf1 (patch)
tree8e5f69f39bfda0dd9d0679a662abf8b395a9ee4f /os/hal/platforms/STM32F1xx/stm32_dma.h
parent3d09e9e86c134035e02ecf92255f72d8d08fdcf5 (diff)
downloadChibiOS-6eae3c1de5a1936247676750132758d17d9bdaf1.tar.gz
ChibiOS-6eae3c1de5a1936247676750132758d17d9bdaf1.tar.bz2
ChibiOS-6eae3c1de5a1936247676750132758d17d9bdaf1.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3487 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32F1xx/stm32_dma.h')
-rw-r--r--os/hal/platforms/STM32F1xx/stm32_dma.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/os/hal/platforms/STM32F1xx/stm32_dma.h b/os/hal/platforms/STM32F1xx/stm32_dma.h
index e01708d64..4469bef67 100644
--- a/os/hal/platforms/STM32F1xx/stm32_dma.h
+++ b/os/hal/platforms/STM32F1xx/stm32_dma.h
@@ -63,6 +63,28 @@
#define STM32_DMA_GETCHANNEL(n, c) 0
/**
+ * @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)))
+
+/**
* @name DMA streams identifiers
* @{
*/