1 /* 2 * Copyright (c) 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 PIN_TEST_H 10 #define PIN_TEST_H 11 12 #include "pin_if.h" 13 14 #ifdef __cplusplus 15 #if __cplusplus 16 extern "C" { 17 #endif 18 #endif /* __cplusplus */ 19 20 struct PinTestConfig { 21 const char *pinName; 22 char funcNameBuf[30]; 23 const char *funcName; 24 enum PinPullType PullTypeNum; 25 uint32_t strengthNum; 26 }; 27 28 struct PinTester { 29 struct PinTestConfig config; 30 DevHandle handle; 31 uint16_t total; 32 uint16_t fails; 33 }; 34 35 enum PinTestCmd { 36 PIN_TEST_CMD_SETGETPULL = 0, 37 PIN_TEST_CMD_SETGETSTRENGTH = 1, 38 PIN_TEST_CMD_SETGETFUNC = 2, 39 PIN_TEST_CMD_RELIABILITY = 3, 40 PIN_TEST_CMD_SETUP_ALL = 4, 41 PIN_TEST_CMD_TEARDOWN_ALL = 5, 42 PIN_TEST_CMD_SETUP_SINGLE = 6, 43 PIN_TEST_CMD_TEARDOWN_SINGLE = 7, 44 PIN_TEST_CMD_MAX = 8, 45 }; 46 47 int32_t PinTestExecute(int cmd); 48 49 #ifdef __cplusplus 50 #if __cplusplus 51 } 52 #endif 53 #endif /* __cplusplus */ 54 55 #endif /* PIN_TEST_H */ 56