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 #define NAME_SIZE_MAX 100 21 22 struct PinTestConfig { 23 const char *pinName; 24 const char *funcName; 25 char pinNameBuf[NAME_SIZE_MAX]; 26 char funcNameBuf[NAME_SIZE_MAX]; 27 enum PinPullType PullTypeNum; 28 uint32_t strengthNum; 29 }; 30 31 struct PinTester { 32 struct PinTestConfig config; 33 DevHandle handle; 34 uint16_t total; 35 uint16_t fails; 36 }; 37 38 enum PinTestCmd { 39 PIN_TEST_CMD_SETGETPULL = 0, 40 PIN_TEST_CMD_SETGETSTRENGTH = 1, 41 PIN_TEST_CMD_SETGETFUNC = 2, 42 PIN_TEST_CMD_RELIABILITY = 3, 43 PIN_TEST_CMD_SETUP_ALL = 4, 44 PIN_TEST_CMD_TEARDOWN_ALL = 5, 45 PIN_TEST_CMD_SETUP_SINGLE = 6, 46 PIN_TEST_CMD_TEARDOWN_SINGLE = 7, 47 PIN_TEST_CMD_MAX = 8, 48 }; 49 50 int32_t PinTestExecute(int cmd); 51 void PinTestExecuteAll(void); 52 int32_t PinTestSetUpSingle(void); 53 int32_t PinTestTearDownSingle(void); 54 55 #ifdef __cplusplus 56 #if __cplusplus 57 } 58 #endif 59 #endif /* __cplusplus */ 60 61 #endif /* PIN_TEST_H */ 62