Skip to content
Snippets Groups Projects
Unverified Commit c1524bab authored by Alexandre Abadie's avatar Alexandre Abadie Committed by GitHub
Browse files

Merge pull request #9171 from OTAkeys/pr/stm32_dma_all

cpu/stm32_common: add DMA support for all stm32
parents d06aa5f2 86c102e8
No related branches found
No related tags found
No related merge requests found
Showing
with 248 additions and 41 deletions
FEATURES_REQUIRED += periph_dma
ifneq (,$(filter netdev_default,$(USEMODULE))) ifneq (,$(filter netdev_default,$(USEMODULE)))
USEMODULE += sx1276 USEMODULE += sx1276
endif endif
......
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_dma
FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_spi
......
...@@ -49,6 +49,28 @@ extern "C" { ...@@ -49,6 +49,28 @@ extern "C" {
#define CLOCK_APB1 (CLOCK_CORECLOCK / 1) #define CLOCK_APB1 (CLOCK_CORECLOCK / 1)
/** @} */ /** @} */
/**
* @name DMA streams configuration
* @{
*/
#ifdef MODULE_PERIPH_DMA
static const dma_conf_t dma_config[] = {
{ .stream = 1 }, /* channel 2 */
{ .stream = 2 }, /* channel 3 */
{ .stream = 3 }, /* channel 4 */
{ .stream = 4 }, /* channel 5 */
{ .stream = 5 }, /* channel 6 */
};
#define DMA_SHARED_ISR_0 isr_dma1_channel2_3
#define DMA_SHARED_ISR_0_STREAMS { 0, 1 } /* Indexes 0 and 1 of dma_config share the same isr */
#define DMA_SHARED_ISR_1 isr_dma1_channel4_5_6_7
#define DMA_SHARED_ISR_1_STREAMS { 2, 3, 4 } /* Indexes 2, 3 and 4 of dma_config share the same isr */
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#endif
/** @} */
/** /**
* @name Timer configuration * @name Timer configuration
* @{ * @{
...@@ -84,6 +106,10 @@ static const uart_conf_t uart_config[] = { ...@@ -84,6 +106,10 @@ static const uart_conf_t uart_config[] = {
.irqn = USART2_IRQn, .irqn = USART2_IRQn,
.type = STM32_USART, .type = STM32_USART,
.clk_src = 0, /* Use APB clock */ .clk_src = 0, /* Use APB clock */
#ifdef MODULE_PERIPH_DMA
.dma = 2,
.dma_chan = 4,
#endif
}, },
{ {
.dev = USART1, .dev = USART1,
...@@ -96,6 +122,10 @@ static const uart_conf_t uart_config[] = { ...@@ -96,6 +122,10 @@ static const uart_conf_t uart_config[] = {
.irqn = USART1_IRQn, .irqn = USART1_IRQn,
.type = STM32_USART, .type = STM32_USART,
.clk_src = 0, /* Use APB clock */ .clk_src = 0, /* Use APB clock */
#ifdef MODULE_PERIPH_DMA
.dma = 0,
.dma_chan = 3,
#endif
}, },
}; };
...@@ -138,7 +168,13 @@ static const spi_conf_t spi_config[] = { ...@@ -138,7 +168,13 @@ static const spi_conf_t spi_config[] = {
.cs_pin = GPIO_UNDEF, .cs_pin = GPIO_UNDEF,
.af = GPIO_AF0, .af = GPIO_AF0,
.rccmask = RCC_APB1ENR_SPI2EN, .rccmask = RCC_APB1ENR_SPI2EN,
.apbbus = APB1 .apbbus = APB1,
#ifdef MODULE_PERIPH_DMA
.tx_dma = 3,
.tx_dma_chan = 2,
.rx_dma = 2,
.rx_dma_chan = 2,
#endif
}, },
{ {
.dev = SPI1, /* connected to SX1276 */ .dev = SPI1, /* connected to SX1276 */
...@@ -148,7 +184,13 @@ static const spi_conf_t spi_config[] = { ...@@ -148,7 +184,13 @@ static const spi_conf_t spi_config[] = {
.cs_pin = GPIO_UNDEF, .cs_pin = GPIO_UNDEF,
.af = GPIO_AF0, .af = GPIO_AF0,
.rccmask = RCC_APB2ENR_SPI1EN, .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
}, },
}; };
......
FEATURES_REQUIRED += periph_dma
ifneq (,$(filter saul_default,$(USEMODULE))) ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio USEMODULE += saul_gpio
USEMODULE += hts221 USEMODULE += hts221
......
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_dma
FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_spi
......
...@@ -69,6 +69,27 @@ extern "C" { ...@@ -69,6 +69,27 @@ extern "C" {
#define CLOCK_APB2 (CLOCK_CORECLOCK / 2) #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 * @name Timer configuration
* @{ * @{
...@@ -104,9 +125,9 @@ static const uart_conf_t uart_config[] = { ...@@ -104,9 +125,9 @@ static const uart_conf_t uart_config[] = {
.irqn = USART1_IRQn, .irqn = USART1_IRQn,
.type = STM32_USART, .type = STM32_USART,
.clk_src = 0, /* Use APB clock */ .clk_src = 0, /* Use APB clock */
#ifdef UART_USE_DMA #ifdef MODULE_PERIPH_DMA
.dma_stream = 6, .dma = 2,
.dma_chan = 4 .dma_chan = 2
#endif #endif
}, },
{ {
...@@ -120,9 +141,9 @@ static const uart_conf_t uart_config[] = { ...@@ -120,9 +141,9 @@ static const uart_conf_t uart_config[] = {
.irqn = UART4_IRQn, .irqn = UART4_IRQn,
.type = STM32_USART, .type = STM32_USART,
.clk_src = 0, /* Use APB clock */ .clk_src = 0, /* Use APB clock */
#ifdef UART_USE_DMA #ifdef MODULE_PERIPH_DMA
.dma_stream = 5, .dma = 3,
.dma_chan = 4 .dma_chan = 2
#endif #endif
} }
}; };
...@@ -186,7 +207,13 @@ static const spi_conf_t spi_config[] = { ...@@ -186,7 +207,13 @@ static const spi_conf_t spi_config[] = {
.cs_pin = GPIO_UNDEF, .cs_pin = GPIO_UNDEF,
.af = GPIO_AF5, .af = GPIO_AF5,
.rccmask = RCC_APB2ENR_SPI1EN, .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
} }
}; };
......
...@@ -68,6 +68,27 @@ extern "C" { ...@@ -68,6 +68,27 @@ extern "C" {
#define ADC_NUMOF (3) #define ADC_NUMOF (3)
/** @} */ /** @} */
/**
* @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 = 5 }, /* DMA1 Channel 6 - USART2_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_dma1_channel6
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#endif
/** @} */
/** /**
* @name Timer configuration * @name Timer configuration
* @{ * @{
...@@ -106,7 +127,11 @@ static const uart_conf_t uart_config[] = { ...@@ -106,7 +127,11 @@ static const uart_conf_t uart_config[] = {
.rx_pin = GPIO_PIN(PORT_A, 10), .rx_pin = GPIO_PIN(PORT_A, 10),
.tx_pin = GPIO_PIN(PORT_A, 9), .tx_pin = GPIO_PIN(PORT_A, 9),
.bus = APB2, .bus = APB2,
.irqn = USART1_IRQn .irqn = USART1_IRQn,
#ifdef MODULE_PERIPH_DMA
.dma = 2,
.dma_chan = 2
#endif
}, },
{ {
.dev = USART2, .dev = USART2,
...@@ -114,7 +139,11 @@ static const uart_conf_t uart_config[] = { ...@@ -114,7 +139,11 @@ static const uart_conf_t uart_config[] = {
.rx_pin = GPIO_PIN(PORT_A, 3), .rx_pin = GPIO_PIN(PORT_A, 3),
.tx_pin = GPIO_PIN(PORT_A, 2), .tx_pin = GPIO_PIN(PORT_A, 2),
.bus = APB1, .bus = APB1,
.irqn = USART2_IRQn .irqn = USART2_IRQn,
#ifdef MODULE_PERIPH_DMA
.dma = 3,
.dma_chan = 2
#endif
} }
}; };
......
include $(RIOTBOARD)/common/iotlab/Makefile.dep include $(RIOTBOARD)/common/iotlab/Makefile.dep
FEATURES_REQUIRED += periph_dma
ifneq (,$(filter saul_default,$(USEMODULE))) ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += isl29020 USEMODULE += isl29020
USEMODULE += lps331ap USEMODULE += lps331ap
......
include $(RIOTBOARD)/common/iotlab/Makefile.features include $(RIOTBOARD)/common/iotlab/Makefile.features
FEATURES_PROVIDED += periph_dma
include $(RIOTCPU)/stm32f1/Makefile.features include $(RIOTCPU)/stm32f1/Makefile.features
...@@ -39,7 +39,13 @@ static const spi_conf_t spi_config[] = { ...@@ -39,7 +39,13 @@ static const spi_conf_t spi_config[] = {
.sclk_pin = GPIO_PIN(PORT_A, 5), .sclk_pin = GPIO_PIN(PORT_A, 5),
.cs_pin = GPIO_UNDEF, .cs_pin = GPIO_UNDEF,
.rccmask = RCC_APB2ENR_SPI1EN, .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
} }
}; };
......
FEATURES_REQUIRED += periph_dma
include $(RIOTBOARD)/common/nucleo/Makefile.dep include $(RIOTBOARD)/common/nucleo/Makefile.dep
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_dma
FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtc
......
...@@ -56,6 +56,22 @@ extern "C" { ...@@ -56,6 +56,22 @@ extern "C" {
#define CLOCK_PLL_MUL (6) #define CLOCK_PLL_MUL (6)
/** @} */ /** @} */
/**
* @name DMA streams configuration
* @{
*/
#ifdef MODULE_PERIPH_DMA
static const dma_conf_t dma_config[] = {
{ .stream = 1 },
{ .stream = 2 },
};
#define DMA_SHARED_ISR_0 isr_dma1_ch2_3_dma2_ch1_2
#define DMA_SHARED_ISR_0_STREAMS { 0, 1 } /* Indexes 0 and 1 of dma_config share the same isr */
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#endif
/** /**
* @name Timer configuration * @name Timer configuration
* @{ * @{
...@@ -88,7 +104,11 @@ static const uart_conf_t uart_config[] = { ...@@ -88,7 +104,11 @@ static const uart_conf_t uart_config[] = {
.rx_af = GPIO_AF1, .rx_af = GPIO_AF1,
.tx_af = GPIO_AF1, .tx_af = GPIO_AF1,
.bus = APB1, .bus = APB1,
.irqn = USART2_IRQn .irqn = USART2_IRQn,
#ifdef MODULE_PERIPH_DMA
.dma = 0,
.dma_chan = 0x9,
#endif
}, },
{ {
.dev = USART1, .dev = USART1,
...@@ -98,7 +118,11 @@ static const uart_conf_t uart_config[] = { ...@@ -98,7 +118,11 @@ static const uart_conf_t uart_config[] = {
.rx_af = GPIO_AF1, .rx_af = GPIO_AF1,
.tx_af = GPIO_AF1, .tx_af = GPIO_AF1,
.bus = APB2, .bus = APB2,
.irqn = USART1_IRQn .irqn = USART1_IRQn,
#ifdef MODULE_PERIPH_DMA
.dma = 0,
.dma_chan = 0x8,
#endif
}, },
{ {
.dev = USART3, .dev = USART3,
...@@ -108,7 +132,11 @@ static const uart_conf_t uart_config[] = { ...@@ -108,7 +132,11 @@ static const uart_conf_t uart_config[] = {
.rx_af = GPIO_AF1, .rx_af = GPIO_AF1,
.tx_af = GPIO_AF1, .tx_af = GPIO_AF1,
.bus = APB1, .bus = APB1,
.irqn = USART3_8_IRQn .irqn = USART3_8_IRQn,
#ifdef MODULE_PERIPH_DMA
.dma = 0,
.dma_chan = 0xA,
#endif
}, },
}; };
...@@ -153,7 +181,13 @@ static const spi_conf_t spi_config[] = { ...@@ -153,7 +181,13 @@ static const spi_conf_t spi_config[] = {
.cs_pin = GPIO_PIN(PORT_B, 6), .cs_pin = GPIO_PIN(PORT_B, 6),
.af = GPIO_AF0, .af = GPIO_AF0,
.rccmask = RCC_APB2ENR_SPI1EN, .rccmask = RCC_APB2ENR_SPI1EN,
.apbbus = APB2 .apbbus = APB2,
#ifdef MODULE_PERIPH_DMA
.tx_dma = 1,
.tx_dma_chan = 0,
.rx_dma = 0,
.rx_dma_chan = 0,
#endif
} }
}; };
......
FEATURES_REQUIRED += periph_dma
include $(RIOTBOARD)/common/nucleo/Makefile.dep include $(RIOTBOARD)/common/nucleo/Makefile.dep
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_dma
FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtc
......
...@@ -29,6 +29,31 @@ ...@@ -29,6 +29,31 @@
extern "C" { extern "C" {
#endif #endif
/**
* @name DMA streams configuration
* @{
*/
#ifdef MODULE_PERIPH_DMA
static const dma_conf_t dma_config[] = {
{ .stream = 10 }, /* DMA2 Stream 2 - SPI1_RX */
{ .stream = 11 }, /* DMA2 Stream 3 - SPI1_TX */
{ .stream = 3 }, /* DMA1 Stream 3 - SPI2_RX/USART3_TX */
{ .stream = 4 }, /* DMA1 Stream 4 - SPI2_TX */
{ .stream = 14 }, /* DMA2 Stream 6 - USART6_TX */
{ .stream = 6 }, /* DMA1 Stream 6 - USART2_TX */
};
#define DMA_0_ISR isr_dma2_stream2
#define DMA_1_ISR isr_dma2_stream3
#define DMA_2_ISR isr_dma1_stream3
#define DMA_3_ISR isr_dma1_stream4
#define DMA_4_ISR isr_dma2_stream6
#define DMA_5_ISR isr_dma1_stream6
#define DMA_NUMOF (sizeof(dma_config) / sizeof(dma_config[0]))
#endif
/** @} */
/** /**
* @name PWM configuration * @name PWM configuration
* @{ * @{
...@@ -100,8 +125,8 @@ static const uart_conf_t uart_config[] = { ...@@ -100,8 +125,8 @@ static const uart_conf_t uart_config[] = {
.tx_af = GPIO_AF7, .tx_af = GPIO_AF7,
.bus = APB1, .bus = APB1,
.irqn = USART3_IRQn, .irqn = USART3_IRQn,
#ifdef UART_USE_DMA #ifdef MODULE_PERIPH_DMA
.dma_stream = 3, .dma = 2,
.dma_chan = 4 .dma_chan = 4
#endif #endif
}, },
...@@ -114,9 +139,9 @@ static const uart_conf_t uart_config[] = { ...@@ -114,9 +139,9 @@ static const uart_conf_t uart_config[] = {
.tx_af = GPIO_AF8, .tx_af = GPIO_AF8,
.bus = APB2, .bus = APB2,
.irqn = USART6_IRQn, .irqn = USART6_IRQn,
#ifdef UART_USE_DMA #ifdef MODULE_PERIPH_DMA
.dma_stream = 6, .dma = 4,
.dma_chan = 4 .dma_chan = 5
#endif #endif
}, },
{ {
...@@ -128,21 +153,16 @@ static const uart_conf_t uart_config[] = { ...@@ -128,21 +153,16 @@ static const uart_conf_t uart_config[] = {
.tx_af = GPIO_AF7, .tx_af = GPIO_AF7,
.bus = APB1, .bus = APB1,
.irqn = USART2_IRQn, .irqn = USART2_IRQn,
#ifdef UART_USE_DMA #ifdef MODULE_PERIPH_DMA
.dma_stream = 7, .dma = 5,
.dma_chan = 4 .dma_chan = 4
#endif #endif
}, },
}; };
#define UART_0_ISR (isr_usart3) #define UART_0_ISR (isr_usart3)
#define UART_0_DMA_ISR (isr_dma1_stream3)
#define UART_1_ISR (isr_usart6) #define UART_1_ISR (isr_usart6)
#define UART_1_DMA_ISR (isr_dma1_stream6)
#define UART_2_ISR (isr_usart2) #define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream7)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0])) #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
/** @} */ /** @} */
...@@ -180,7 +200,13 @@ static const spi_conf_t spi_config[] = { ...@@ -180,7 +200,13 @@ static const spi_conf_t spi_config[] = {
.cs_pin = GPIO_PIN(PORT_A, 4), .cs_pin = GPIO_PIN(PORT_A, 4),
.af = GPIO_AF5, .af = GPIO_AF5,
.rccmask = RCC_APB2ENR_SPI1EN, .rccmask = RCC_APB2ENR_SPI1EN,
.apbbus = APB2 .apbbus = APB2,
#ifdef MODULE_PERIPH_DMA
.tx_dma = 1,
.tx_dma_chan = 3,
.rx_dma = 0,
.rx_dma_chan = 3,
#endif
}, },
{ {
.dev = SPI2, .dev = SPI2,
...@@ -190,7 +216,13 @@ static const spi_conf_t spi_config[] = { ...@@ -190,7 +216,13 @@ static const spi_conf_t spi_config[] = {
.cs_pin = GPIO_PIN(PORT_B, 12), .cs_pin = GPIO_PIN(PORT_B, 12),
.af = GPIO_AF5, .af = GPIO_AF5,
.rccmask = RCC_APB1ENR_SPI2EN, .rccmask = RCC_APB1ENR_SPI2EN,
.apbbus = APB1 .apbbus = APB1,
#ifdef MODULE_PERIPH_DMA
.tx_dma = 3,
.tx_dma_chan = 0,
.rx_dma = 2,
.rx_dma_chan = 0,
#endif
} }
}; };
......
FEATURES_REQUIRED += periph_dma
include $(RIOTBOARD)/common/nucleo/Makefile.dep include $(RIOTBOARD)/common/nucleo/Makefile.dep
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_dma
FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_timer
......
...@@ -59,6 +59,25 @@ extern "C" { ...@@ -59,6 +59,25 @@ extern "C" {
#define CLOCK_PLL_Q (9) #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 * @name Timer configuration
* @{ * @{
...@@ -92,9 +111,9 @@ static const uart_conf_t uart_config[] = { ...@@ -92,9 +111,9 @@ static const uart_conf_t uart_config[] = {
.tx_af = GPIO_AF7, .tx_af = GPIO_AF7,
.bus = APB1, .bus = APB1,
.irqn = USART3_IRQn, .irqn = USART3_IRQn,
#ifdef UART_USE_DMA #ifdef MODULE_PERIPH_DMA
.dma_stream = 6, .dma = 0,
.dma_chan = 4 .dma_chan = 7
#endif #endif
}, },
{ {
...@@ -106,9 +125,9 @@ static const uart_conf_t uart_config[] = { ...@@ -106,9 +125,9 @@ static const uart_conf_t uart_config[] = {
.tx_af = GPIO_AF8, .tx_af = GPIO_AF8,
.bus = APB2, .bus = APB2,
.irqn = USART6_IRQn, .irqn = USART6_IRQn,
#ifdef UART_USE_DMA #ifdef MODULE_PERIPH_DMA
.dma_stream = 5, .dma = 1,
.dma_chan = 4 .dma_chan = 5
#endif #endif
}, },
{ {
...@@ -120,19 +139,16 @@ static const uart_conf_t uart_config[] = { ...@@ -120,19 +139,16 @@ static const uart_conf_t uart_config[] = {
.tx_af = GPIO_AF7, .tx_af = GPIO_AF7,
.bus = APB1, .bus = APB1,
.irqn = USART2_IRQn, .irqn = USART2_IRQn,
#ifdef UART_USE_DMA #ifdef MODULE_PERIPH_DMA
.dma_stream = 4, .dma = 2,
.dma_chan = 4 .dma_chan = 4
#endif #endif
} }
}; };
#define UART_0_ISR (isr_usart3) #define UART_0_ISR (isr_usart3)
#define UART_0_DMA_ISR (isr_dma1_stream6)
#define UART_1_ISR (isr_usart6) #define UART_1_ISR (isr_usart6)
#define UART_1_DMA_ISR (isr_dma1_stream5)
#define UART_2_ISR (isr_usart2) #define UART_2_ISR (isr_usart2)
#define UART_2_DMA_ISR (isr_dma1_stream4)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0])) #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
/** @} */ /** @} */
......
FEATURES_REQUIRED += periph_dma
include $(RIOTBOARD)/common/nucleo/Makefile.dep include $(RIOTBOARD)/common/nucleo/Makefile.dep
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