mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/samr21-xpro: add uart hw cts/rts
This commit is contained in:
parent
52bcdff113
commit
39f073e71f
@ -19,5 +19,6 @@ config BOARD_SAMR21_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
|
||||
|
@ -10,6 +10,7 @@ FEATURES_PROVIDED += periph_rtt
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_timer
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
FEATURES_PROVIDED += periph_uart_hw_fc
|
||||
FEATURES_PROVIDED += periph_usbdev
|
||||
|
||||
# Put other features for this board (in alphabetical order)
|
||||
|
@ -157,6 +157,21 @@ specific board like this:
|
||||
BOARD=samr21-xpro SERIAL="ATML2127031800002124" make debug
|
||||
|
||||
|
||||
## Accessing STDIO via UART
|
||||
|
||||
STDIO is available through the edbg debugger.
|
||||
|
||||
Use the `term` target to open a terminal:
|
||||
|
||||
make BOARD=samr21-xpro -C examples/hello-world term
|
||||
|
||||
RTS / CTS hardware flow control is available on `UART_DEV(0)` and
|
||||
`UART_DEV(1)`. This is unavailable when using STDIO directly through
|
||||
the debugger since it does not support it. Therefore to use hardware
|
||||
flow control an external FTDI device must be connected to the board's
|
||||
rx, tx, cts & rts matching pin headers, eg. for `UART_DEV(0)` to
|
||||
`PA5`, `PA4`, `PA6` & `PA7` (respectively) on EXT1 headers.
|
||||
|
||||
|
||||
## Supported Toolchains
|
||||
|
||||
|
@ -147,12 +147,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_MAIN,
|
||||
},
|
||||
@ -161,12 +165,16 @@ static const uart_conf_t uart_config[] = {
|
||||
.rx_pin = GPIO_PIN(PA,23),
|
||||
.tx_pin = GPIO_PIN(PA,22),
|
||||
#ifdef MODULE_PERIPH_UART_HW_FC
|
||||
.rts_pin = GPIO_UNDEF,
|
||||
.cts_pin = GPIO_UNDEF,
|
||||
.rts_pin = GPIO_PIN(PB,22),
|
||||
.cts_pin = GPIO_PIN(PB,23),
|
||||
#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_MAIN,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user