Skip to content
Snippets Groups Projects
Commit 2fcfc855 authored by Vincent Dupont's avatar Vincent Dupont
Browse files

boards/nucleo144-f413: adapt board config to use DMA

parent 8fc63738
No related branches found
No related tags found
No related merge requests found
# 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
......
......@@ -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
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment