mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-28 07:51:19 +01:00
boards/nucleo144-f413: adapt board config to use DMA
This commit is contained in:
parent
8fc63738f6
commit
2fcfc855ac
@ -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
|
||||
|
||||
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user