Skip to content

Commit 3ede09e

Browse files
wdfk-progRbb666
authored andcommitted
feat[bsp][stm32][h7]: add UART4 RX DMA configuration
Add the missing UART4 RX DMA definitions for STM32H7. UART4 RX DMA uses DMA1 Stream0 with the UART4 RX DMA request. The configuration is enabled when BSP_UART4_RX_USING_DMA is selected.
1 parent c2f5a28 commit 3ede09e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • bsp/stm32/libraries/HAL_Drivers/drivers/config/h7

‎bsp/stm32/libraries/HAL_Drivers/drivers/config/h7/dma_config.h‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ extern "C" {
2727
#define UART2_RX_DMA_INSTANCE DMA1_Stream0
2828
#define UART2_RX_DMA_REQUEST DMA_REQUEST_USART2_RX
2929
#define UART2_RX_DMA_IRQ DMA1_Stream0_IRQn
30+
#elif defined(BSP_UART4_RX_USING_DMA) && !defined(UART4_RX_DMA_INSTANCE)
31+
#define UART4_DMA_RX_IRQHandler DMA1_Stream0_IRQHandler
32+
#define UART4_RX_DMA_RCC RCC_AHB1ENR_DMA1EN
33+
#define UART4_RX_DMA_INSTANCE DMA1_Stream0
34+
#define UART4_RX_DMA_REQUEST DMA_REQUEST_UART4_RX
35+
#define UART4_RX_DMA_IRQ DMA1_Stream0_IRQn
3036
#endif
3137

3238
/* DMA1 stream1 */
@@ -62,7 +68,6 @@ extern "C" {
6268
#define SPI2_TX_DMA_IRQ DMA1_Stream4_IRQn
6369
#endif
6470

65-
6671
/* DMA1 stream5 */
6772
#if defined(BSP_SPI3_TX_USING_DMA) && !defined(SPI3_TX_DMA_INSTANCE)
6873
#define SPI3_DMA_TX_IRQHandler DMA1_Stream5_IRQHandler
@@ -150,7 +155,7 @@ extern "C" {
150155
#define QSPI_DMA_IRQ DMA2_Stream7_IRQn
151156
#endif
152157

153-
/*BDMA */
158+
/* BDMA */
154159
#if defined(BSP_SPI6_TX_USING_BDMA) && !defined(SPI6_TX_BDMA_INSTANCE)
155160
#define SPI6_BDMA_TX_IRQHandler BDMA_Channel0_IRQHandler
156161
#define SPI6_TX_BDMA_INSTANCE BDMA_Channel0
@@ -167,10 +172,8 @@ extern "C" {
167172
#define SPI6_RX_BDMA_IRQ BDMA_Channel1_IRQn
168173
#endif
169174

170-
171175
#ifdef __cplusplus
172176
}
173177
#endif
174178

175179
#endif /* __DMA_CONFIG_H__ */
176-

0 commit comments

Comments
 (0)