• 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 HDF_UHDF_TEST_H
10 #define HDF_UHDF_TEST_H
11 
12 #include "hdf_base.h"
13 
14 #ifdef __cplusplus
15     extern "C" {
16 #endif /* __cplusplus */
17 
18 #define HDF_TEST_SERVICE_NAME    "HDF_TEST"
19 #define CHECK_TEST_NULL_PTR_RETURN(ptr) do { \
20     if ((ptr) == NULL) { \
21         printf("pointer is null and return\n\r"); \
22         return HDF_FAILURE; \
23     } \
24 } while (0)
25 
26 struct HdfTestMsg {
27     uint16_t cmd;   // submodule command
28     uint8_t subCmd; // test case command
29     int8_t result;
30 };
31 
32 // two hundred values allocated per submodule
33 enum HdfTestSubModuleCmd {
34     TEST_PAL_I2C_TYPE       = 0,
35     TEST_PAL_SPI_TYPE       = 1,
36     TEST_PAL_GPIO_TYPE      = 2,
37     TEST_PAL_PIN_TYPE       = 3,
38     TEST_PAL_CLOCK_TYPE     = 4,
39     TEST_PAL_REGULATOR_TYPE = 5,
40     TEST_PAL_MIPI_DSI_TYPE  = 6,
41     TEST_PAL_UART_TYPE      = 7,
42     TEST_PAL_SDIO_TYPE      = 8,
43     TEST_PAL_MDIO_TYPE      = 9,
44     TEST_PAL_APB_TYPE       = 10,
45     TEST_PAL_PCIE_TYPE      = 11,
46     TEST_PAL_PCM_TYPE       = 12,
47     TEST_PAL_I2S_TYPE       = 13,
48     TEST_PAL_PWM_TYPE       = 14,
49     TEST_PAL_DMA_TYPE       = 15,
50     TEST_PAL_EFUSE_TYPE     = 16,
51     TEST_PAL_FLASH_TYPE     = 17,
52     TEST_PAL_EMMC_TYPE      = 18,
53     TEST_PAL_RTC_TYPE       = 19,
54     TEST_PAL_ADC_TYPE       = 20,
55     TEST_PAL_WDT_TYPE       = 21,
56     TEST_PAL_I3C_TYPE       = 22,
57     TEST_PAL_MIPI_CSI_TYPE  = 23,
58     TEST_PAL_DAC_TYPE       = 24,
59     TEST_PAL_TIMER_TYPE     = 25,
60     TEST_PAL_MANAGER_TYPE   = 196,
61     TEST_PAL_DEVICE_TYPE    = 197,
62     TEST_PAL_QUEUE_TYPE     = 198,
63     TEST_PAL_EVENT_TYPE     = 199,
64     TEST_PAL_END            = 200,
65     TEST_OSAL_BEGIN = TEST_PAL_END,
66 #define HDF_OSAL_TEST_ITEM(v) (TEST_OSAL_BEGIN + (v))
67     TEST_OSAL_ITEM = HDF_OSAL_TEST_ITEM(1),
68     TEST_OSAL_END           = 400,
69     TEST_WIFI_BEGIN         = TEST_OSAL_END,
70     TEST_WIFI_TYPE          = TEST_WIFI_BEGIN + 1,
71     TEST_WIFI_END           = 600,
72     TEST_CONFIG_TYPE        = 601,
73     TEST_HDF_FRAME_END      = 800,
74     TEST_USB_DEVICE_TYPE    = 900,
75     TEST_USB_HOST_TYPE      = 1000,
76     TEST_USB_HOST_RAW_TYPE  = 1100,
77 };
78 
79 void HdfTestOpenService(void);
80 void HdfTestCloseService(void);
81 int HdfTestSendMsgToService(struct HdfTestMsg *msg);
82 
83 #ifdef __cplusplus
84 }
85 #endif /* __cplusplus */
86 
87 #endif // HDF_UHDF_TEST_H
88