diff --git a/khdf/liteos/BUILD.gn b/khdf/liteos/BUILD.gn new file mode 100644 index 0000000..6632a7e --- /dev/null +++ b/khdf/liteos/BUILD.gn @@ -0,0 +1,265 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//build/lite/config/component/lite_component.gni") +import("//drivers/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF) +module_name = "hdf" +hdf_driver(module_name) { + sources = [ + "$HDF_FRAMEWORKS_PATH/ability/config/device_resource_if.c", + "$HDF_FRAMEWORKS_PATH/ability/config/hcs_parser/src/hcs_blob_if.c", + "$HDF_FRAMEWORKS_PATH/ability/config/hcs_parser/src/hcs_generate_tree.c", + "$HDF_FRAMEWORKS_PATH/ability/config/hcs_parser/src/hcs_parser.c", + "$HDF_FRAMEWORKS_PATH/ability/config/hcs_parser/src/hcs_tree_if.c", + "$HDF_FRAMEWORKS_PATH/ability/sbuf/src/hdf_sbuf.c", + "$HDF_FRAMEWORKS_PATH/ability/sbuf/src/hdf_sbuf_impl_raw.c", + "$HDF_FRAMEWORKS_PATH/core/adapter/vnode/src/hdf_vnode_adapter.c", + "$HDF_FRAMEWORKS_PATH/core/common/src/devlite_object_config.c", + "$HDF_FRAMEWORKS_PATH/core/common/src/devmgr_service_start.c", + "$HDF_FRAMEWORKS_PATH/core/common/src/hdf_attribute.c", + "$HDF_FRAMEWORKS_PATH/core/common/src/hdf_device_node_ext.c", + "$HDF_FRAMEWORKS_PATH/core/common/src/load_driver_entry.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/devhost_service.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/devmgr_service_clnt.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/devsvc_manager_clnt.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/hdf_device.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/hdf_device_node.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/hdf_device_object.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/hdf_device_token.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/hdf_driver_loader.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/hdf_observer_record.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/hdf_service_observer.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/hdf_service_subscriber.c", + "$HDF_FRAMEWORKS_PATH/core/host/src/power_state_token.c", + "$HDF_FRAMEWORKS_PATH/core/manager/src/devhost_service_clnt.c", + "$HDF_FRAMEWORKS_PATH/core/manager/src/device_token_clnt.c", + "$HDF_FRAMEWORKS_PATH/core/manager/src/devmgr_service.c", + "$HDF_FRAMEWORKS_PATH/core/manager/src/devsvc_manager.c", + "$HDF_FRAMEWORKS_PATH/core/manager/src/hdf_driver_installer.c", + "$HDF_FRAMEWORKS_PATH/core/manager/src/hdf_host_info.c", + "$HDF_FRAMEWORKS_PATH/core/manager/src/power_state_token_clnt.c", + "$HDF_FRAMEWORKS_PATH/core/shared/src/hdf_device_info.c", + "$HDF_FRAMEWORKS_PATH/core/shared/src/hdf_io_service.c", + "$HDF_FRAMEWORKS_PATH/core/shared/src/hdf_object_manager.c", + "$HDF_FRAMEWORKS_PATH/core/shared/src/hdf_service_record.c", + "$HDF_FRAMEWORKS_PATH/utils/src/hdf_cstring.c", + "$HDF_FRAMEWORKS_PATH/utils/src/hdf_map.c", + "$HDF_FRAMEWORKS_PATH/utils/src/hdf_slist.c", + "$HDF_FRAMEWORKS_PATH/utils/src/hdf_sref.c", + "osal/src/osal_cdev.c", + "osal/src/osal_file.c", + "osal/src/osal_firmware.c", + "osal/src/osal_irq.c", + "osal/src/osal_mem.c", + "osal/src/osal_mutex.c", + "osal/src/osal_sem.c", + "osal/src/osal_spinlock.c", + "osal/src/osal_thread.c", + "osal/src/osal_time.c", + "osal/src/osal_timer.c", + "osal/src/osal_workqueue.c", + ] + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/common/platform_common.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/common/platform_device.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/common/platform_manager.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/common/platform_queue.c", + "platform/src/plat_common.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_I2C)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/i2c_core.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/i2c_if.c", + "platform/src/i2c_dev.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_GPIO)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/gpio_core.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/gpio_if.c", + "platform/src/gpio_dev.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_WATCHDOG)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/watchdog_core.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/watchdog_if.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_SPI)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/spi_core.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/spi_if.c", + "platform/src/spi_dev.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_PWM)) { + sources += [ "$HDF_FRAMEWORKS_PATH/support/platform/src/pwm_core.c" ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_MMC)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/mmc_block.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/mmc_core.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/mmc_dispatch.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/mmc_emmc.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/mmc_if.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/mmc_protocol.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/mmc_sdio.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_SDIO)) { + sources += [ "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/sdio_if.c" ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_EMMC)) { + sources += [ "$HDF_FRAMEWORKS_PATH/support/platform/src/mmc/emmc_if.c" ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_RTC)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/rtc_base.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/rtc_core.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/rtc_if.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_MIPI_DSI)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/mipi_dsi_core.c", + #"platform/src/mipi_tx_dev.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_DMAC)) { + sources += [ "$HDF_FRAMEWORKS_PATH/support/platform/src/dmac_core.c" ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_UART)) { + sources += [ + "$HDF_FRAMEWORKS_PATH/support/platform/src/uart_core.c", + "$HDF_FRAMEWORKS_PATH/support/platform/src/uart_if.c", + "platform/src/uart_dev.c", + ] + } + + if (defined(LOSCFG_NET_LWIP_SACK)) { + sources += [ "network/src/netbuf_adapter.c" ] + + if (defined(LOSCFG_DRIVERS_HDF_WIFI)) { + sources += [ "network/src/net_device_adapter.c" ] + } + } + + public_configs = [ ":public" ] +} + +group("liteos") { + public_deps = [ ":$module_name" ] + deps = [ + "model/bus/usb", + "model/display", + "model/input", + "model/misc/vibrator", + "model/network/wifi", + "model/sensor", + "model/storage", + ] + + hdf_config = "$device_path/config" + if (defined(LOSCFG_DRIVERS_HDF_TEST)) { + hdf_config = "$product_path/config/hdf_test" + deps += [ "test" ] + } else { + cmd = "if [ -f $product_path/config/BUILD.gn ]; then echo true; else echo false; fi" + HAVE_PRODUCT_CONFIG = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") + if (HAVE_PRODUCT_CONFIG) { + hdf_config = "$product_path/config" + } + } + deps += [ hdf_config ] +} + +config("public") { + include_dirs = [ + "$HDF_FRAMEWORKS_PATH/core/common/include/manager", + "$HDF_FRAMEWORKS_PATH/support/platform/include", + "$HDF_FRAMEWORKS_PATH/support/platform/include/common", + "$HDF_FRAMEWORKS_PATH/support/platform/include/mmc", + "$HDF_FRAMEWORKS_PATH/include/platform", + "$HDF_FRAMEWORKS_PATH/include/utils", + ] + + configs = [ "model/bus/usb:public" ] +} + +config("hdf_config") { + include_dirs = [ + "$HDF_FRAMEWORKS_PATH/include", + "$HDF_FRAMEWORKS_PATH/include/osal", + "$HDF_FRAMEWORKS_PATH/include/utils", + "$HDF_FRAMEWORKS_PATH/utils/include", + "$HDF_FRAMEWORKS_PATH/include/platform", + "$HDF_FRAMEWORKS_PATH/include/core", + "$HDF_FRAMEWORKS_PATH/include/net", + "$HDF_FRAMEWORKS_PATH/include/wifi", + "$HDF_FRAMEWORKS_PATH/model/network/common/netdevice", + "$HDF_FRAMEWORKS_PATH/model/storage/include/common", + "$HDF_FRAMEWORKS_PATH/ability/sbuf/include", + "$HDF_FRAMEWORKS_PATH/support/platform/include", + "$HDF_FRAMEWORKS_PATH/core/host/include", + "$HDF_FRAMEWORKS_PATH/core/manager/include", + "$HDF_FRAMEWORKS_PATH/core/shared/include", + "$HDF_FRAMEWORKS_PATH/core/common/include/manager", + "$HDF_FRAMEWORKS_PATH/core/common/include/host", + "network/include", + "osal/include", + "platform/include", + "$HDF_FRAMEWORKS_PATH/core/adapter/vnode/include", + "$HDF_FRAMEWORKS_PATH/core/adapter/syscall/include", + "$HDF_FRAMEWORKS_PATH/include/config", + "$HDF_FRAMEWORKS_PATH/ability/config/hcs_parser/include", + ] +} + +build_ext_component("build_hc_gen") { + exec_path = rebase_path("//drivers/framework/tools/hc-gen", root_build_dir) + command = "make" +} diff --git a/khdf/liteos/hdf.gni b/khdf/liteos/hdf.gni new file mode 100644 index 0000000..8c6535c --- /dev/null +++ b/khdf/liteos/hdf.gni @@ -0,0 +1,78 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +HDF_ROOT_DIR = "//drivers" +HDF_FRAMEWORKS_PATH = "$HDF_ROOT_DIR/framework" + +template("hdf_driver") { + if (defined(invoker.hcs_sources)) { + action_foreach("hc_gen") { + script = "//build/lite/run_shell_cmd.py" + sources = invoker.hcs_sources + outputs = [ "$target_gen_dir/{{source_name_part}}_hex.c" ] + args = [ + rebase_path("//drivers/framework/tools/hc-gen/build/hc-gen"), + "-b", + "-i", + "-a", + "-o", + rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.c", + "{{source}}", + ] + deps = [ "//drivers/adapter/khdf/liteos:build_hc_gen" ] + } + } + kernel_module(target_name) { + forward_variables_from(invoker, [ "module_switch" ]) + forward_variables_from(invoker, "*", [ "configs" ]) + if (defined(invoker.configs)) { + configs += invoker.configs + } + if (defined(invoker.hcs_sources)) { + hc_gen = ":hc_gen" + generated_sources = get_target_outputs(hc_gen) + if (defined(invoker.sources)) { + sources += generated_sources + } else { + sources = generated_sources + } + if (defined(invoker.deps)) { + deps += [ hc_gen ] + } else { + deps = [ hc_gen ] + } + } + } +} + +set_defaults("hdf_driver") { + configs = [ "//drivers/adapter/khdf/liteos:hdf_config" ] +} diff --git a/khdf/liteos/model/bus/usb/BUILD.gn b/khdf/liteos/model/bus/usb/BUILD.gn new file mode 100644 index 0000000..869b282 --- /dev/null +++ b/khdf/liteos/model/bus/usb/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_USB) +module_name = "hdf_usb" +hdf_driver(module_name) { + sources = [ "hdf_usb.c" ] + public_configs = [ ":public" ] +} + +group("usb") { + public_deps = [ ":$module_name" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/khdf/liteos/model/display/BUILD.gn b/khdf/liteos/model/display/BUILD.gn new file mode 100644 index 0000000..459a342 --- /dev/null +++ b/khdf/liteos/model/display/BUILD.gn @@ -0,0 +1,67 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_DISP) +module_name = "hdf_display" +hdf_driver(module_name) { + FRAMEWORKS_DISPLAY_ROOT = "$HDF_FRAMEWORKS_PATH/model/display/driver" + sources = [ + "$FRAMEWORKS_DISPLAY_ROOT/hdf_disp.c", + "$FRAMEWORKS_DISPLAY_ROOT/lcd_abs_if.c", + ] + + if (defined(LOSCFG_PLATFORM_HI3516DV300)) { + sources += [ "$FRAMEWORKS_DISPLAY_ROOT/hi35xx_disp.c" ] + } + + if (defined(LOSCFG_DRIVERS_HDF_LCDKIT)) { + sources += [ + "$FRAMEWORKS_DISPLAY_ROOT/lcdkit/lcdkit_parse_config.c", + "$FRAMEWORKS_DISPLAY_ROOT/lcdkit/lite_lcdkit.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_LCD_ICN9700)) { + sources += [ "$FRAMEWORKS_DISPLAY_ROOT/panel/mipi_icn9700.c" ] + } + + if (defined(LOSCFG_DRIVERS_HDF_LCD_ST7789)) { + sources += [ "$FRAMEWORKS_DISPLAY_ROOT/panel/ssp_st7789.c" ] + } + + include_dirs = [ + "$FRAMEWORKS_DISPLAY_ROOT", + ] +} + +group("display") { + public_deps = [ ":$module_name" ] +} diff --git a/khdf/liteos/model/input/BUILD.gn b/khdf/liteos/model/input/BUILD.gn new file mode 100644 index 0000000..f91d530 --- /dev/null +++ b/khdf/liteos/model/input/BUILD.gn @@ -0,0 +1,62 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_INPUT) +module_name = "hdf_input_driver" +hdf_driver(module_name) { + FRAMEWORKS_INPUT_ROOT = "$HDF_FRAMEWORKS_PATH/model/input/driver" + sources = [ + "$FRAMEWORKS_INPUT_ROOT/event_hub.c", + "$FRAMEWORKS_INPUT_ROOT/hdf_hid_adapter.c", + "$FRAMEWORKS_INPUT_ROOT/hdf_input_device_manager.c", + "$FRAMEWORKS_INPUT_ROOT/hdf_key.c", + "$FRAMEWORKS_INPUT_ROOT/hdf_touch.c", + "$FRAMEWORKS_INPUT_ROOT/input_bus_ops/input_i2c_ops.c", + "$FRAMEWORKS_INPUT_ROOT/input_config_parser.c", + ] + + if (defined(LOSCFG_DRIVERS_HDF_TP_5P5_GT911)) { + sources += [ "$FRAMEWORKS_INPUT_ROOT/touchscreen/touch_gt911.c" ] + } + + if (defined(LOSCFG_DRIVERS_HDF_TP_2P35_FT6236)) { + sources += [ "$FRAMEWORKS_INPUT_ROOT/touchscreen/touch_ft6336.c" ] + } + + include_dirs = [ + "$FRAMEWORKS_INPUT_ROOT", + "$FRAMEWORKS_INPUT_ROOT/input_bus_ops", + ] +} + +group("input") { + public_deps = [ ":$module_name" ] +} diff --git a/khdf/liteos/model/misc/vibrator/BUILD.gn b/khdf/liteos/model/misc/vibrator/BUILD.gn new file mode 100644 index 0000000..2b9acc1 --- /dev/null +++ b/khdf/liteos/model/misc/vibrator/BUILD.gn @@ -0,0 +1,54 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_VIBRATOR) +module_name = "hdf_vibrator_driver" +hdf_driver(module_name) { + FRAMEWORKS_VIBRATOR_ROOT = "$HDF_FRAMEWORKS_PATH/model/misc/vibrator/driver" + + sources = [ + "$FRAMEWORKS_VIBRATOR_ROOT/src/vibrator_driver.c", + "$FRAMEWORKS_VIBRATOR_ROOT/src/vibrator_haptic.c", + ] + + if (defined(LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR)) { + sources += [ "$FRAMEWORKS_VIBRATOR_ROOT/chipset/vibrator_linear_driver.c" ] + } + + include_dirs = [ + "$FRAMEWORKS_VIBRATOR_ROOT/include", + "$FRAMEWORKS_VIBRATOR_ROOT/chipset", + ] +} + +group("vibrator") { + public_deps = [ ":$module_name" ] +} diff --git a/khdf/liteos/model/network/wifi/BUILD.gn b/khdf/liteos/model/network/wifi/BUILD.gn new file mode 100644 index 0000000..29a2bd7 --- /dev/null +++ b/khdf/liteos/model/network/wifi/BUILD.gn @@ -0,0 +1,81 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_WIFI) +module_name = "hdf_wifi_model" +hdf_driver(module_name) { + sources = [ "platform/src/hdf_wlan_queue.c" ] + + FRAMEWORKS_WIFI_ROOT = "$HDF_FRAMEWORKS_PATH/model/network/wifi" + sources += [ + "$FRAMEWORKS_WIFI_ROOT/../common/netdevice/net_device.c", + "$FRAMEWORKS_WIFI_ROOT/bus/hdf_ibus_intf.c", + "$FRAMEWORKS_WIFI_ROOT/bus/hdf_sdio_intf.c", + "$FRAMEWORKS_WIFI_ROOT/core/components/eapol/eapol.c", + "$FRAMEWORKS_WIFI_ROOT/core/components/softap/ap.c", + "$FRAMEWORKS_WIFI_ROOT/core/components/sta/sta.c", + "$FRAMEWORKS_WIFI_ROOT/core/hdf_wifi_core.c", + "$FRAMEWORKS_WIFI_ROOT/core/module/wifi_base.c", + "$FRAMEWORKS_WIFI_ROOT/core/module/wifi_feature.c", + "$FRAMEWORKS_WIFI_ROOT/core/module/wifi_module.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/hdf_wifi_event.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/hdf_wlan_chipdriver_manager.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/hdf_wlan_config_parser.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/hdf_wlan_power_manager.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/hdf_wlan_priority_queue.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/hdf_wlan_product.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/hdf_wlan_reset_manager.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/hdf_wlan_utils.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/message/message_dispatcher.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/message/message_router.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/message/nodes/local_node.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/message/sidecar.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/qos/flow_control.c", + "$FRAMEWORKS_WIFI_ROOT/platform/src/qos/flow_control_task.c", + ] + + include_dirs = [ + "$FRAMEWORKS_WIFI_ROOT/include", + "$FRAMEWORKS_WIFI_ROOT/core/components/sta", + "$FRAMEWORKS_WIFI_ROOT/core/components/softap", + "$FRAMEWORKS_WIFI_ROOT/core/components/eapol", + "$FRAMEWORKS_WIFI_ROOT/../common/netdevice", + "$FRAMEWORKS_WIFI_ROOT/core/module", + "$HDF_FRAMEWORKS_PATH/include/wifi", + "$FRAMEWORKS_WIFI_ROOT/bus", + "$FRAMEWORKS_WIFI_ROOT/platform/include/message", + "$FRAMEWORKS_WIFI_ROOT/platform/include", + ] +} + +group("wifi") { + public_deps = [ ":$module_name" ] +} diff --git a/khdf/liteos/model/sensor/BUILD.gn b/khdf/liteos/model/sensor/BUILD.gn new file mode 100644 index 0000000..b3de163 --- /dev/null +++ b/khdf/liteos/model/sensor/BUILD.gn @@ -0,0 +1,60 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_SENSOR) +module_name = "hdf_sensor_driver" +hdf_driver(module_name) { + FRAMEWORKS_SENSOR_ROOT = "$HDF_FRAMEWORKS_PATH/model/sensor/driver" + sources = [ + "$FRAMEWORKS_SENSOR_ROOT/common/src/sensor_config_controller.c", + "$FRAMEWORKS_SENSOR_ROOT/common/src/sensor_config_parser.c", + "$FRAMEWORKS_SENSOR_ROOT/common/src/sensor_device_manager.c", + "$FRAMEWORKS_SENSOR_ROOT/common/src/sensor_platform_if.c", + ] + + if (defined(LOSCFG_DRIVERS_HDF_SENSOR_ACCEL)) { + sources += [ + "$FRAMEWORKS_SENSOR_ROOT/accel/sensor_accel_driver.c", + "$FRAMEWORKS_SENSOR_ROOT/chipset/accel/accel_bmi160.c", + ] + } + + include_dirs = [ + "$FRAMEWORKS_SENSOR_ROOT/include", + "$FRAMEWORKS_SENSOR_ROOT/common/include", + "$FRAMEWORKS_SENSOR_ROOT/accel", + "$FRAMEWORKS_SENSOR_ROOT/chipset/accel", + ] +} + +group("sensor") { + public_deps = [ ":$module_name" ] +} diff --git a/khdf/liteos/model/storage/BUILD.gn b/khdf/liteos/model/storage/BUILD.gn new file mode 100644 index 0000000..3ced453 --- /dev/null +++ b/khdf/liteos/model/storage/BUILD.gn @@ -0,0 +1,49 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_STORAGE) +module_name = "hdf_storage_driver" +hdf_driver(module_name) { + FRAMEWORKS_STORAGE_ROOT = "$HDF_FRAMEWORKS_PATH/model/storage" + sources = [ + "$FRAMEWORKS_STORAGE_ROOT/src/common/storage_block.c", + "storage_block_lite.c", + ] + + include_dirs = [ + "//base/hiviewdfx/interfaces/kits", + "$FRAMEWORKS_STORAGE_ROOT/include/common", + ] +} + +group("storage") { + public_deps = [ ":$module_name" ] +} diff --git a/khdf/liteos/test/BUILD.gn b/khdf/liteos/test/BUILD.gn new file mode 100644 index 0000000..24921d5 --- /dev/null +++ b/khdf/liteos/test/BUILD.gn @@ -0,0 +1,229 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos/hdf.gni") + +HDF_TEST_FRAMWORK_ROOT = "$HDF_FRAMEWORKS_PATH/test/unittest" + +module_switch = defined(LOSCFG_DRIVERS_HDF_TEST) +module_name = "hdf_test" +hdf_driver(module_name) { + sources = [ + "$HDF_TEST_FRAMWORK_ROOT/ability/config/hcs_parser/unittest/hcs_config_test.c", + "$HDF_TEST_FRAMWORK_ROOT/common/hdf_main_test.c", + "$HDF_TEST_FRAMWORK_ROOT/config/hdf_config_test.c", + "$HDF_TEST_FRAMWORK_ROOT/manager/sample_driver_test.c", + "$HDF_TEST_FRAMWORK_ROOT/osal/osal_all_test.c", + "$HDF_TEST_FRAMWORK_ROOT/osal/osal_file_test.c", + "$HDF_TEST_FRAMWORK_ROOT/osal/osal_get_case_test.c", + "$HDF_TEST_FRAMWORK_ROOT/osal/osal_list_test.c", + "$HDF_TEST_FRAMWORK_ROOT/osal/osal_test_entry.c", + "$HDF_TEST_FRAMWORK_ROOT/osal/osal_work_test.c", + ] + + if (defined(LOSCFG_DRIVERS_HDF_WIFI)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/message/hdf_queue_test.c", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/message/hdf_single_node_message_test.c", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/module/hdf_module_test.c", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/net/hdf_netbuf_test.c", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/netdevice/net_device_test.c", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/qos/flow_control_test.c", + "$HDF_TEST_FRAMWORK_ROOT/wifi/hdf_wifi_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_USB_DDK_DEVICE)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/model/usb/src/hdf_usb_device_test.c", + "$HDF_TEST_FRAMWORK_ROOT/model/usb/src/usb_device_lite_cdcacm_test.c", + "$HDF_TEST_FRAMWORK_ROOT/model/usb/src/usb_device_lite_sdk_if_test.c", + ] +} + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM)) { + sources += [ "$HDF_TEST_FRAMWORK_ROOT/platform/common/platform_driver_test.c" ] + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_GPIO)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/gpio_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_gpio_entry_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_I2C)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/i2c_driver_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/common/i2c_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_i2c_entry_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_WATCHDOG)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/watchdog_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_watchdog_entry_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_SPI)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/spi_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_spi_entry_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_UART)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/uart_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_uart_entry_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_RTC)) { + sources += [ "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_rtc_entry_test.c" ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_SDIO)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/sdio_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_sdio_entry_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_MIPI_DSI)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/mipi_dsi_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_mipi_dsi_entry_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_EMMC)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/emmc_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_emmc_entry_test.c", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_PLATFORM_PWM)) { + sources += [ + "$HDF_TEST_FRAMWORK_ROOT/platform/common/pwm_test.c", + "$HDF_TEST_FRAMWORK_ROOT/platform/hdf_pwm_entry_test.c", + ] + } + } + + if (defined(LOSCFG_DRIVERS_HDF_SENSOR)) { + sources += [ "$HDF_TEST_FRAMWORK_ROOT/sensor/hdf_sensor_test.c" ] + } + + configs += [ ":test_lite" ] +} + +group("test") { + public_deps = [ ":$module_name" ] +} + +config("test_lite") { + include_dirs = [ + "$HDF_FRAMEWORKS_PATH/include", + "$HDF_FRAMEWORKS_PATH/include/osal", + "$HDF_FRAMEWORKS_PATH/include/utils", + "$HDF_FRAMEWORKS_PATH/utils/include", + "$HDF_FRAMEWORKS_PATH/include/platform", + "$HDF_FRAMEWORKS_PATH/include/core", + "$HDF_FRAMEWORKS_PATH/include/config", + "$HDF_FRAMEWORKS_PATH/support/platform/include", + "$HDF_FRAMEWORKS_PATH/ability/sbuf/include", + "$HDF_FRAMEWORKS_PATH/core/host/include", + "$HDF_FRAMEWORKS_PATH/core/master/include", + "$HDF_FRAMEWORKS_PATH/core/shared/include", + "$HDF_FRAMEWORKS_PATH/core/manager/include", + "$HDF_FRAMEWORKS_PATH/core/common/include/host", + "../osal/include", + "osal/include", + "$HDF_FRAMEWORKS_PATH/core/adapter/vnode/include", + "$HDF_FRAMEWORKS_PATH/core/adapter/syscall/include", + "../network/include", + "$HDF_TEST_FRAMWORK_ROOT/common", + "$HDF_TEST_FRAMWORK_ROOT/manager", + "$HDF_TEST_FRAMWORK_ROOT/config", + "$HDF_TEST_FRAMWORK_ROOT/platform", + "$HDF_TEST_FRAMWORK_ROOT/hdfframe", + "$HDF_TEST_FRAMWORK_ROOT/platform/common", + "$HDF_TEST_FRAMWORK_ROOT/osal", + "$HDF_TEST_FRAMWORK_ROOT/adapter/osal/unittest", + "$HDF_TEST_FRAMWORK_ROOT/adapter/osal/include", + "$HDF_TEST_FRAMWORK_ROOT/ability/config/hcs_parser/unittest", + "$HDF_TEST_FRAMWORK_ROOT", + ] + + if (defined(LOSCFG_DRIVERS_HDF_WIFI)) { + include_dirs += [ + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/netdevice", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/module", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/net", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/qos", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/include", + "$HDF_FRAMEWORKS_PATH/model/network/common/netdevice", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/platform/src/qos", + "$HDF_TEST_FRAMWORK_ROOT/model/network/wifi/unittest/message", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/include", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/core/module", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/platform/include", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/platform/include/message", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/platform/src", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/core/components/softap", + "$HDF_FRAMEWORKS_PATH/model/network/wifi/core/components/sta", + "$HDF_FRAMEWORKS_PATH/include/wifi", + "$HDF_FRAMEWORKS_PATH/include/net", + "$HDF_TEST_FRAMWORK_ROOT/wifi", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_SENSOR)) { + include_dirs += [ + "$HDF_TEST_FRAMWORK_ROOT/sensor", + "$HDF_ROOT_DIR/peripheral/sensor/interfaces/include", + "$HDF_ROOT_DIR/peripheral/sensor/hal/include", + "$HDF_FRAMEWORKS_PATH/model/sensor/driver/include", + "$HDF_FRAMEWORKS_PATH/model/sensor/driver/common/include", + ] + } + + if (defined(LOSCFG_DRIVERS_HDF_USB_DDK_DEVICE)) { + include_dirs += [ + "$HDF_TEST_FRAMWORK_ROOT/model/usb/include", + "$HDF_ROOT_DIR/peripheral/usb/ddk/common/include", + "$HDF_ROOT_DIR/peripheral/usb/ddk/device/include", + "$HDF_ROOT_DIR/peripheral/usb/interfaces/ddk/common", + "$HDF_ROOT_DIR/peripheral/usb/interfaces/ddk/device", + ] + } +}