Skip to content

Commit

Permalink
Merge pull request #20183 from benpicco/boards/same54-xpro-uart_hw_fc
Browse files Browse the repository at this point in the history
boards/same54-xpro: configure pins for UART HW flow control & ethernet LED
  • Loading branch information
dylad authored Dec 14, 2023
2 parents e6cbdda + 8db01f6 commit 75c27f8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
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
.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

0 comments on commit 75c27f8

Please sign in to comment.