From fb6e3c01c74bcb29b5d84ed19eaa5e24088d95da Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 14 Dec 2023 14:59:22 +0100 Subject: [PATCH] boards/same54-xpro: configure pins for UART HW flow control --- boards/same54-xpro/Kconfig | 1 + boards/same54-xpro/Makefile.features | 1 + boards/same54-xpro/include/periph_conf.h | 20 ++++++-------------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/boards/same54-xpro/Kconfig b/boards/same54-xpro/Kconfig index e93ff58243..4386463754 100644 --- a/boards/same54-xpro/Kconfig +++ b/boards/same54-xpro/Kconfig @@ -23,6 +23,7 @@ config BOARD_SAME54_XPRO select HAS_PERIPH_SPI select HAS_PERIPH_TIMER select HAS_PERIPH_UART + select HAS_PERIPH_UART_HW_FC select HAS_PERIPH_USBDEV select HAS_RIOTBOOT select HAS_TINYUSB_DEVICE diff --git a/boards/same54-xpro/Makefile.features b/boards/same54-xpro/Makefile.features index 3e3491ebeb..2a0b7d1abc 100644 --- a/boards/same54-xpro/Makefile.features +++ b/boards/same54-xpro/Makefile.features @@ -12,6 +12,7 @@ FEATURES_PROVIDED += periph_sdmmc FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart +FEATURES_PROVIDED += periph_uart_hw_fc FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_usbdev FEATURES_PROVIDED += periph_freqm diff --git a/boards/same54-xpro/include/periph_conf.h b/boards/same54-xpro/include/periph_conf.h index 5a402d196b..33dbb72cfd 100644 --- a/boards/same54-xpro/include/periph_conf.h +++ b/boards/same54-xpro/include/periph_conf.h @@ -115,10 +115,6 @@ static const uart_conf_t uart_config[] = { .dev = &SERCOM2->USART, .rx_pin = GPIO_PIN(PB, 24), .tx_pin = GPIO_PIN(PB, 25), -#ifdef MODULE_PERIPH_UART_HW_FC - .rts_pin = GPIO_UNDEF, - .cts_pin = GPIO_UNDEF, -#endif .mux = GPIO_MUX_D, .rx_pad = UART_PAD_RX_1, .tx_pad = UART_PAD_TX_0, @@ -130,12 +126,16 @@ static const uart_conf_t uart_config[] = { .rx_pin = GPIO_PIN(PA, 5), .tx_pin = GPIO_PIN(PA, 4), #ifdef MODULE_PERIPH_UART_HW_FC - .rts_pin = GPIO_UNDEF, - .cts_pin = GPIO_UNDEF, + .rts_pin = GPIO_PIN(PA, 6), + .cts_pin = GPIO_PIN(PA, 7), #endif .mux = GPIO_MUX_D, .rx_pad = UART_PAD_RX_1, +#ifdef MODULE_PERIPH_UART_HW_FC + .tx_pad = UART_PAD_TX_0_RTS_2_CTS_3, +#else .tx_pad = UART_PAD_TX_0, +#endif .flags = UART_FLAG_NONE, .gclk_src = SAM0_GCLK_PERIPH, }, @@ -143,10 +143,6 @@ static const uart_conf_t uart_config[] = { .dev = &SERCOM5->USART, .rx_pin = GPIO_PIN(PB, 17), .tx_pin = GPIO_PIN(PB, 16), -#ifdef MODULE_PERIPH_UART_HW_FC - .rts_pin = GPIO_UNDEF, - .cts_pin = GPIO_UNDEF, -#endif .mux = GPIO_MUX_C, .rx_pad = UART_PAD_RX_1, .tx_pad = UART_PAD_TX_0, @@ -157,10 +153,6 @@ static const uart_conf_t uart_config[] = { .dev = &SERCOM1->USART, .rx_pin = GPIO_PIN(PC, 23), .tx_pin = GPIO_PIN(PC, 22), -#ifdef MODULE_PERIPH_UART_HW_FC - .rts_pin = GPIO_UNDEF, - .cts_pin = GPIO_UNDEF, -#endif .mux = GPIO_MUX_C, .rx_pad = UART_PAD_RX_1, .tx_pad = UART_PAD_TX_0,