diff --git a/boards/nucleo144-f413/Makefile.features b/boards/nucleo144-f413/Makefile.features index c4943268ecae54d29b32e96e1f23ffdac87308d0..7531e5f16f09b39e839c9c924287ea9ac93935fd 100644 --- a/boards/nucleo144-f413/Makefile.features +++ b/boards/nucleo144-f413/Makefile.features @@ -1,5 +1,6 @@ # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_adc +FEATURES_PROVIDED += periph_dma FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm diff --git a/boards/nucleo144-f413/include/periph_conf.h b/boards/nucleo144-f413/include/periph_conf.h index 170d7520fefd8059b7067f2848f6c950d5691764..d5525d06e547069ed694b6f532ed2bf81eaec6aa 100644 --- a/boards/nucleo144-f413/include/periph_conf.h +++ b/boards/nucleo144-f413/include/periph_conf.h @@ -71,6 +71,29 @@ extern "C" { #define CLOCK_USE_ALT_48MHZ (1) /** @} */ +/** + * @name DMA streams configuration + * @{ + */ +#ifdef MODULE_PERIPH_DMA +static const dma_conf_t dma_config[] = { + { .stream = 4 }, + { .stream = 14 }, + { .stream = 6 }, + { .stream = 10 }, + { .stream = 8 }, +}; + +#define DMA_0_ISR isr_dma1_stream4 +#define DMA_1_ISR isr_dma2_stream6 +#define DMA_2_ISR isr_dma1_stream6 +#define DMA_3_ISR isr_dma2_stream2 +#define DMA_4_ISR isr_dma2_stream0 + +#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0])) +#endif +/** @} */ + /** * @name Timer configuration * @{ @@ -104,9 +127,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 }, { @@ -118,9 +141,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 }, { @@ -132,9 +155,9 @@ static const uart_conf_t uart_config[] = { .tx_af = GPIO_AF7, .bus = APB1, .irqn = USART2_IRQn, -#ifdef UART_USE_DMA - .dma_stream = 4, - .dma_chan = 4 +#ifdef MODULE_PERIPH_DMA + .dma = 3, + .dma_chan = 4, #endif }, }; @@ -212,7 +235,13 @@ static const spi_conf_t spi_config[] = { .cs_pin = GPIO_PIN(PORT_A, 4), .af = GPIO_AF5, .rccmask = RCC_APB2ENR_SPI1EN, - .apbbus = APB2 + .apbbus = APB2, +#ifdef MODULE_PERIPH_DMA + .tx_dma = 3, + .tx_dma_chan = 2, + .rx_dma = 4, + .rx_dma_chan = 3, +#endif } };