Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/same54-xpro: configure pins for UART HW flow control & ethernet LED #20183

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/same54-xpro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions boards/same54-xpro/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions boards/same54-xpro/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ extern "C" {
#define LED0_ON (LED_PORT.OUTCLR.reg = LED0_MASK)
#define LED0_OFF (LED_PORT.OUTSET.reg = LED0_MASK)
#define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK)

#define LED1_PIN GPIO_PIN(PC, 15)

#define LED_PORT PORT->Group[PC]
#define LED1_MASK (1 << 15)

#define LED1_ON (LED_PORT.OUTCLR.reg = LED1_MASK)
#define LED1_OFF (LED_PORT.OUTSET.reg = LED1_MASK)
#define LED1_TOGGLE (LED_PORT.OUTTGL.reg = LED1_MASK)
/** @} */

/**
Expand Down
6 changes: 6 additions & 0 deletions boards/same54-xpro/include/gpio_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ static const saul_gpio_params_t saul_gpio_params[] =
.mode = GPIO_OUT,
.flags = SAUL_GPIO_INVERTED
},
{
.name = "LED(ETH)",
.pin = LED1_PIN,
.mode = GPIO_OUT,
.flags = SAUL_GPIO_INVERTED
},
{
.name = "Button(SW0)",
.pin = BTN0_PIN,
Expand Down
20 changes: 6 additions & 14 deletions boards/same54-xpro/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines -118 to -121
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove those one ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed, we check .tx_pad == UART_PAD_TX_0_RTS_2_CTS_3

.mux = GPIO_MUX_D,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
Expand All @@ -130,23 +126,23 @@ 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,
},
{ /* EXT2 */
.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,
Expand All @@ -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,
Expand Down
Loading