Skip to content

Commit

Permalink
tests: uart_async_api: Support atsamd21_xpro board
Browse files Browse the repository at this point in the history
This commit adds the asynchronous UART API testing support on the SAM
D21 Xplained Pro board.

The SERCOM1 module is used as the secondary loop-back UART, which is
required to run this test.

Note that no external UART loop-back connection is necessary to run
this test, because the SERCOM1 UART TX and RX pads are configured to be
internally connected.

Signed-off-by: Stephanos Ioannidis <[email protected]>
  • Loading branch information
stephanosio authored and galak committed Apr 23, 2020
1 parent 6a55334 commit efa0e4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/drivers/uart/uart_async_api/boards/atsamd21_xpro.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: Apache-2.0 */

&sercom1 {
/* Internally loop-back TX and RX on PAD0 */
rxpo = <0>;
txpo = <0>;

/* Configure DMA channels for async operation */
dmas = <&dmac 0 3>, <&dmac 1 4>;
dma-names = "rx", "tx";
};
2 changes: 2 additions & 0 deletions tests/drivers/uart/uart_async_api/src/test_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#define UART_DEVICE_NAME DT_UART_0_NAME
#elif defined(CONFIG_BOARD_NRF9160DK_NRF9160)
#define UART_DEVICE_NAME DT_UART_1_NAME
#elif defined(CONFIG_BOARD_ATSAMD21_XPRO)
#define UART_DEVICE_NAME DT_LABEL(DT_NODELABEL(sercom1))
#else
#define UART_DEVICE_NAME CONFIG_UART_CONSOLE_ON_DEV_NAME
#endif
Expand Down

0 comments on commit efa0e4b

Please sign in to comment.