Skip to content

Commit

Permalink
Merge pull request #17885 from dp1/b-l475e-iot01a_add-spi23-buses
Browse files Browse the repository at this point in the history
boards/b-l475e-iot01a: Add SPI2 and SPI3 buses
  • Loading branch information
aabadie authored Mar 31, 2022
2 parents b20a300 + 446b48d commit 237f0ab
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
50 changes: 47 additions & 3 deletions boards/b-l475e-iot01a/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ extern "C" {
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 = 3 }, /* DMA1 Channel 4 - USART1_TX / SPI2_RX */
{ .stream = 4 }, /* DMA1 Channel 5 - SPI2_TX */
{ .stream = 8 }, /* DMA2 Channel 1 - SPI3_RX */
{ .stream = 9 }, /* DMA2 Channel 2 - SPI3_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_3_ISR isr_dma1_channel5
#define DMA_4_ISR isr_dma2_channel1
#define DMA_5_ISR isr_dma2_channel2
#define DMA_6_ISR isr_dma2_channel3

#define DMA_NUMOF ARRAY_SIZE(dma_config)
/** @} */
Expand Down Expand Up @@ -104,7 +110,7 @@ static const uart_conf_t uart_config[] = {
.type = STM32_USART,
.clk_src = 0, /* Use APB clock */
#ifdef MODULE_PERIPH_DMA
.dma = 3,
.dma = 6,
.dma_chan = 2
#endif
}
Expand Down Expand Up @@ -158,6 +164,44 @@ static const spi_conf_t spi_config[] = {
.tx_dma_chan = 1,
.rx_dma = 0,
.rx_dma_chan = 1,
#endif
},
{
.dev = SPI2,
.mosi_pin = GPIO_PIN(PORT_D, 4),
.miso_pin = GPIO_PIN(PORT_D, 3),
.sclk_pin = GPIO_PIN(PORT_D, 1),
.cs_pin = SPI_CS_UNDEF,
.mosi_af = GPIO_AF5,
.miso_af = GPIO_AF5,
.sclk_af = GPIO_AF5,
.cs_af = GPIO_AF5,
.rccmask = RCC_APB1ENR1_SPI2EN,
.apbbus = APB1,
#ifdef MODULE_PERIPH_DMA
.tx_dma = 3,
.tx_dma_chan = 1,
.rx_dma = 2,
.rx_dma_chan = 1,
#endif
},
{
.dev = SPI3,
.mosi_pin = GPIO_PIN(PORT_C, 12),
.miso_pin = GPIO_PIN(PORT_C, 11),
.sclk_pin = GPIO_PIN(PORT_C, 10),
.cs_pin = SPI_CS_UNDEF,
.mosi_af = GPIO_AF6,
.miso_af = GPIO_AF6,
.sclk_af = GPIO_AF6,
.cs_af = GPIO_AF6,
.rccmask = RCC_APB1ENR1_SPI3EN,
.apbbus = APB1,
#ifdef MODULE_PERIPH_DMA
.tx_dma = 5,
.tx_dma_chan = 3,
.rx_dma = 4,
.rx_dma_chan = 3,
#endif
}
};
Expand Down
3 changes: 3 additions & 0 deletions dist/tools/doccheck/exclude_patterns
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member DMA_0_ISR
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member DMA_1_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member DMA_2_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member DMA_3_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member DMA_4_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member DMA_5_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member DMA_6_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member DMA_NUMOF \(macro definition\) of file periph_conf\.h is not documented\.
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member I2C_0_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/b\-l475e\-iot01a/include/periph_conf\.h:[0-9]+: warning: Member I2C_1_ISR \(macro definition\) of file periph_conf\.h is not documented\.
Expand Down

0 comments on commit 237f0ab

Please sign in to comment.