• 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 GPIO_TEST_H
10 #define GPIO_TEST_H
11 
12 #include "hdf_base.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 int32_t GpioTestExecute(int cmd);
19 
20 enum GpioTestCmd {
21     GPIO_TEST_SET_GET_DIR = 0,
22     GPIO_TEST_WRITE_READ = 1,
23     GPIO_TEST_IRQ_LEVEL = 2,
24     GPIO_TEST_IRQ_EDGE = 3,
25     GPIO_TEST_IRQ_THREAD = 4,
26     GPIO_TEST_RELIABILITY = 5,
27     GPIO_TEST_PERFORMANCE = 6,
28     GPIO_TEST_MAX = 7,
29 };
30 
31 struct GpioTestConfig {
32     uint16_t gpio;
33     uint16_t gpioIrq;
34     uint16_t testUserApi;
35 };
36 
37 struct GpioTester {
38     struct GpioTestConfig cfg;
39     uint16_t oldDir;
40     uint16_t oldVal;
41     uint16_t irqCnt;
42     uint16_t total;
43     uint16_t fails;
44     uint32_t irqTimeout;
45 };
46 
47 #ifdef __cplusplus
48 }
49 #endif
50 
51 #endif /* GPIO_TEST_H */
52