From f5622afeb687b3e57d9b39942c0e98968a0b58b7 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 28 Jul 2021 11:51:47 +0200 Subject: [PATCH] boards/saml21-xpro: configure UART & SPI on EXT2, 3 --- boards/saml21-xpro/include/periph_conf.h | 34 +++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/boards/saml21-xpro/include/periph_conf.h b/boards/saml21-xpro/include/periph_conf.h index 7c228dee17..68fc0d5c8b 100644 --- a/boards/saml21-xpro/include/periph_conf.h +++ b/boards/saml21-xpro/include/periph_conf.h @@ -94,12 +94,27 @@ static const uart_conf_t uart_config[] = { .tx_pad = UART_PAD_TX_0, .flags = UART_FLAG_NONE, .gclk_src = SAM0_GCLK_MAIN, + }, + { /* EXT2 header */ + .dev = &SERCOM1->USART, + .rx_pin = GPIO_PIN(PA, 19), + .tx_pin = GPIO_PIN(PA, 18), +#ifdef MODULE_PERIPH_UART_HW_FC + .rts_pin = GPIO_UNDEF, + .cts_pin = GPIO_UNDEF, +#endif + .mux = GPIO_MUX_C, + .rx_pad = UART_PAD_RX_3, + .tx_pad = UART_PAD_TX_2, + .flags = UART_FLAG_NONE, + .gclk_src = SAM0_GCLK_MAIN, } }; /* interrupt function name mapping */ #define UART_0_ISR isr_sercom3 #define UART_1_ISR isr_sercom4 +#define UART_2_ISR isr_sercom1 #define UART_NUMOF ARRAY_SIZE(uart_config) /** @} */ @@ -138,7 +153,7 @@ static const pwm_conf_t pwm_config[] = { * @{ */ static const spi_conf_t spi_config[] = { - { + { /* EXT1 header */ .dev = &(SERCOM0->SPI), .miso_pin = GPIO_PIN(PA, 4), .mosi_pin = GPIO_PIN(PA, 6), @@ -152,6 +167,23 @@ static const spi_conf_t spi_config[] = { #ifdef MODULE_PERIPH_DMA .tx_trigger = SERCOM0_DMAC_ID_TX, .rx_trigger = SERCOM0_DMAC_ID_RX, +#endif + }, + { /* EXT2, EXT3 header */ + .dev = &(SERCOM5->SPI), + .miso_pin = GPIO_PIN(PB, 16), + .mosi_pin = GPIO_PIN(PB, 22), + .clk_pin = GPIO_PIN(PB, 23), + .miso_mux = GPIO_MUX_C, + .mosi_mux = GPIO_MUX_D, + .clk_mux = GPIO_MUX_D, + .miso_pad = SPI_PAD_MISO_0, + .mosi_pad = SPI_PAD_MOSI_2_SCK_3, + .gclk_src = SAM0_GCLK_MAIN, +#ifdef MODULE_PERIPH_DMA + /* no DMA on SERCOM5 */ + .tx_trigger = DMA_TRIGGER_DISABLED, + .rx_trigger = DMA_TRIGGER_DISABLED, #endif } };