diff --git a/boards/b-l475e-iot01a/Makefile.dep b/boards/b-l475e-iot01a/Makefile.dep index eded089b924532fc704855e9d3f826374e57988b..8a26164a9ef85282e278288ec20c6d3684701c35 100644 --- a/boards/b-l475e-iot01a/Makefile.dep +++ b/boards/b-l475e-iot01a/Makefile.dep @@ -1,3 +1,5 @@ +FEATURES_REQUIRED += periph_dma + ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_gpio USEMODULE += hts221 diff --git a/boards/b-l475e-iot01a/Makefile.features b/boards/b-l475e-iot01a/Makefile.features index d21bff62e3bd6fedad658917a4c26eb0035abb1a..c7954ad1a1497e4b919e767cab943fb501285e60 100644 --- a/boards/b-l475e-iot01a/Makefile.features +++ b/boards/b-l475e-iot01a/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_pwm FEATURES_PROVIDED += periph_spi diff --git a/boards/b-l475e-iot01a/include/periph_conf.h b/boards/b-l475e-iot01a/include/periph_conf.h index f81c2dcdf186d0754661e2fef3c2d0c3ddd692f5..a32e136655604fbc299ad1c9533258fb3ba9505d 100644 --- a/boards/b-l475e-iot01a/include/periph_conf.h +++ b/boards/b-l475e-iot01a/include/periph_conf.h @@ -69,6 +69,27 @@ extern "C" { #define CLOCK_APB2 (CLOCK_CORECLOCK / 2) /** @} */ +/** + * @name DMA streams configuration + * @{ + */ +#ifdef MODULE_PERIPH_DMA +static const dma_conf_t dma_config[] = { + { .stream = 1 }, /* DMA1 Channel 2 - SPI1_RX */ + { .stream = 2 }, /* DMA1 Channel 3 - SPI1_TX */ + { .stream = 3 }, /* DMA1 Channel 4 - USART1_TX */ + { .stream = 10 }, /* DMA2 Channel 3 - UART4_TX */ +}; + +#define DMA_0_ISR isr_dma1_channel2 +#define DMA_1_ISR isr_dma1_channel3 +#define DMA_2_ISR isr_dma1_channel4 +#define DMA_3_ISR isr_dma2_channel3 + +#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0])) +#endif +/** @} */ + /** * @name Timer configuration * @{ @@ -104,9 +125,9 @@ static const uart_conf_t uart_config[] = { .irqn = USART1_IRQn, .type = STM32_USART, .clk_src = 0, /* Use APB clock */ -#ifdef UART_USE_DMA - .dma_stream = 6, - .dma_chan = 4 +#ifdef MODULE_PERIPH_DMA + .dma = 2, + .dma_chan = 2 #endif }, { @@ -120,9 +141,9 @@ static const uart_conf_t uart_config[] = { .irqn = UART4_IRQn, .type = STM32_USART, .clk_src = 0, /* Use APB clock */ -#ifdef UART_USE_DMA - .dma_stream = 5, - .dma_chan = 4 +#ifdef MODULE_PERIPH_DMA + .dma = 3, + .dma_chan = 2 #endif } }; @@ -186,7 +207,13 @@ static const spi_conf_t spi_config[] = { .cs_pin = GPIO_UNDEF, .af = GPIO_AF5, .rccmask = RCC_APB2ENR_SPI1EN, - .apbbus = APB2 + .apbbus = APB2, +#ifdef MODULE_PERIPH_DMA + .tx_dma = 1, + .tx_dma_chan = 1, + .rx_dma = 0, + .rx_dma_chan = 1, +#endif } };