This commit adds the asynchronous UART API testing support on the SAM E54 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; it is, however, still necessary to configure the pinmux because the module pads are not connected until the pinmux is configured. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
59 lines
1.5 KiB
C
59 lines
1.5 KiB
C
/*
|
|
* Copyright (c) 2019 Nordic Semiconductor ASA
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief UART cases header file
|
|
*
|
|
* Header file for UART cases
|
|
*/
|
|
|
|
#ifndef __TEST_UART_H__
|
|
#define __TEST_UART_H__
|
|
|
|
#include <drivers/uart.h>
|
|
#include <ztest.h>
|
|
|
|
/* RX and TX pins have to be connected together*/
|
|
|
|
#if defined(CONFIG_BOARD_NRF52840DK_NRF52840)
|
|
#define UART_DEVICE_NAME DT_LABEL(DT_NODELABEL(uart0))
|
|
#elif defined(CONFIG_BOARD_NRF9160DK_NRF9160)
|
|
#define UART_DEVICE_NAME DT_LABEL(DT_NODELABEL(uart1))
|
|
#elif defined(CONFIG_BOARD_ATSAMD21_XPRO)
|
|
#define UART_DEVICE_NAME DT_LABEL(DT_NODELABEL(sercom1))
|
|
#elif defined(CONFIG_BOARD_ATSAMR21_XPRO)
|
|
#define UART_DEVICE_NAME DT_LABEL(DT_NODELABEL(sercom3))
|
|
#elif defined(CONFIG_BOARD_ATSAME54_XPRO)
|
|
#define UART_DEVICE_NAME DT_LABEL(DT_NODELABEL(sercom1))
|
|
#else
|
|
#define UART_DEVICE_NAME CONFIG_UART_CONSOLE_ON_DEV_NAME
|
|
#endif
|
|
|
|
void test_single_read(void);
|
|
void test_chained_read(void);
|
|
void test_double_buffer(void);
|
|
void test_read_abort(void);
|
|
void test_write_abort(void);
|
|
void test_forever_timeout(void);
|
|
void test_long_buffers(void);
|
|
void test_chained_write(void);
|
|
|
|
void test_single_read_setup(void);
|
|
void test_chained_read_setup(void);
|
|
void test_double_buffer_setup(void);
|
|
void test_read_abort_setup(void);
|
|
void test_write_abort_setup(void);
|
|
void test_forever_timeout_setup(void);
|
|
void test_long_buffers_setup(void);
|
|
void test_chained_write_setup(void);
|
|
|
|
#ifdef CONFIG_USERSPACE
|
|
void set_permissions(void);
|
|
#endif
|
|
|
|
#endif /* __TEST_UART_H__ */
|