From 75ef9ddb358f3ce5694b18ca1d060a6a7290a667 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 21 Aug 2021 06:24:03 +0000 Subject: [PATCH] Added macro for memory pointer 1. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14691 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h b/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h index 6ed63f11c..8caeccdd5 100644 --- a/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h +++ b/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h @@ -268,14 +268,39 @@ typedef struct { * @post After use the stream can be released using @p bdmaStreamRelease(). * * @param[in] stp pointer to an @p stm32_bdma_stream_t structure - * @param[in] addr value to be written in the CMAR register + * @param[in] addr value to be written in the CM0AR register * * @special */ -#define bdmaStreamSetMemory(stp, addr) { \ +#define bdmaStreamSetMemory0(stp, addr) { \ (stp)->channel->CM0AR = (uint32_t)(addr); \ } +/** + * @brief Associates a memory destination to a BDMA stream. + * @note This function can be invoked in both ISR or thread context. + * @pre The stream must have been allocated using @p bdmaStreamAllocate(). + * @post After use the stream can be released using @p bdmaStreamRelease(). + * + * @param[in] stp pointer to an @p stm32_bdma_stream_t structure + * @param[in] addr value to be written in the CM1AR register + * + * @special + */ +#define bdmaStreamSetMemory1(stp, addr) { \ + (stp)->channel->CM1AR = (uint32_t)(addr); \ +} + +/** + * @brief Alias of @p bdmaStreamSetMemory0() for compatibility. + * + * @param[in] stp pointer to an @p stm32_bdma_stream_t structure + * @param[in] addr value to be written in the CM0AR register + * + * @special + */ +#define bdmaStreamSetMemory(stp, addr) bdmaStreamSetMemory0(stp, addr) + /** * @brief Sets the number of transfers to be performed. * @note This function can be invoked in both ISR or thread context.