diff --git a/boards/nucleo-f767zi/Makefile.dep b/boards/nucleo-f767zi/Makefile.dep index 729485827299c1a63e12514b30d4943aeea41c0d..a7e11adb3cd8c6b91303c4ec2a8d7891afe8c266 100644 --- a/boards/nucleo-f767zi/Makefile.dep +++ b/boards/nucleo-f767zi/Makefile.dep @@ -1 +1,3 @@ +FEATURES_REQUIRED += periph_dma + include $(RIOTBOARD)/common/nucleo/Makefile.dep diff --git a/boards/nucleo-f767zi/Makefile.features b/boards/nucleo-f767zi/Makefile.features index 593b57950bf97eb541172db76f8f26cbf3004227..bfff4d4a864c4b3bf5a35a358ee771194d88a516 100644 --- a/boards/nucleo-f767zi/Makefile.features +++ b/boards/nucleo-f767zi/Makefile.features @@ -1,4 +1,5 @@ # Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_dma FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_timer diff --git a/boards/nucleo-f767zi/include/periph_conf.h b/boards/nucleo-f767zi/include/periph_conf.h index c40add7f5a4ce1079c7a47b3714ba236166db529..1da0d7c9d11c7447f303478a40daa7e017006fcf 100644 --- a/boards/nucleo-f767zi/include/periph_conf.h +++ b/boards/nucleo-f767zi/include/periph_conf.h @@ -59,6 +59,25 @@ extern "C" { #define CLOCK_PLL_Q (9) /** @} */ +/** + * @name DMA streams configuration + * @{ + */ +#ifdef MODULE_PERIPH_DMA +static const dma_conf_t dma_config[] = { + { .stream = 4 }, /* DMA1 Stream 4 - USART3_TX */ + { .stream = 14 }, /* DMA2 Stream 6 - USART6_TX */ + { .stream = 6 }, /* DMA1 Stream 6 - USART2_TX */ +}; + +#define DMA_0_ISR isr_dma1_stream4 +#define DMA_1_ISR isr_dma2_stream6 +#define DMA_2_ISR isr_dma1_stream6 + +#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0])) +#endif +/** @} */ + /** * @name Timer configuration * @{ @@ -92,9 +111,9 @@ static const uart_conf_t uart_config[] = { .tx_af = GPIO_AF7, .bus = APB1, .irqn = USART3_IRQn, -#ifdef UART_USE_DMA - .dma_stream = 6, - .dma_chan = 4 +#ifdef MODULE_PERIPH_DMA + .dma = 0, + .dma_chan = 7 #endif }, { @@ -106,9 +125,9 @@ static const uart_conf_t uart_config[] = { .tx_af = GPIO_AF8, .bus = APB2, .irqn = USART6_IRQn, -#ifdef UART_USE_DMA - .dma_stream = 5, - .dma_chan = 4 +#ifdef MODULE_PERIPH_DMA + .dma = 1, + .dma_chan = 5 #endif }, { @@ -120,19 +139,16 @@ static const uart_conf_t uart_config[] = { .tx_af = GPIO_AF7, .bus = APB1, .irqn = USART2_IRQn, -#ifdef UART_USE_DMA - .dma_stream = 4, +#ifdef MODULE_PERIPH_DMA + .dma = 2, .dma_chan = 4 #endif } }; #define UART_0_ISR (isr_usart3) -#define UART_0_DMA_ISR (isr_dma1_stream6) #define UART_1_ISR (isr_usart6) -#define UART_1_DMA_ISR (isr_dma1_stream5) #define UART_2_ISR (isr_usart2) -#define UART_2_DMA_ISR (isr_dma1_stream4) #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0])) /** @} */