• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef UART_TEST_H
10 #define UART_TEST_H
11 
12 #include "uart_if.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17 
18 int32_t UartTestExecute(int cmd);
19 
20 enum UartTestCmd {
21     UART_TEST_CMD_WRITE = 0,
22     UART_TEST_CMD_READ = 1,
23     UART_TEST_CMD_SET_BAUD = 2,
24     UART_TEST_CMD_GET_BAUD = 3,
25     UART_TEST_CMD_SET_ATTRIBUTE = 4,
26     UART_TEST_CMD_GET_ATTRIBUTE = 5,
27     UART_TEST_CMD_SET_TRANSMODE = 6,
28     UART_TEST_CMD_RELIABILITY = 7,
29     UART_TEST_CMD_PERFORMANCE = 8,
30     UART_TEST_CMD_MAX = 9,
31 };
32 
33 struct UartTestConfig {
34     uint32_t port;
35     uint32_t len;
36     uint8_t *wbuf;
37     uint8_t *rbuf;
38 };
39 
40 struct UartTester {
41     struct UartTestConfig config;
42     DevHandle handle;
43     uint16_t total;
44     uint16_t fails;
45 };
46 
47 #ifdef __cplusplus
48 }
49 #endif /* __cplusplus */
50 
51 #endif /* UART_TEST_H */
52