1# 2# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3# 4# This file 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 9import("//drivers/hdf_core/adapter/khdf/liteos_m/hdf.gni") 10 11module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_GPIO) 12module_name = get_path_info(rebase_path("."), "name") 13 14hdf_driver(module_name) { 15 sources = [] 16 if (defined(LOSCFG_SOC_COMPANY_BESTECHNIC)) { 17 sources += [ "gpio_bes.c" ] 18 } 19 if (defined(LOSCFG_SOC_COMPANY_GOODIX)) { 20 sources += [ "gpio_gr5xx.c" ] 21 } 22 if (defined(LOSCFG_SOC_COMPANY_ASRMICRO)) { 23 sources += [ "gpio_asr.c" ] 24 } 25 if (defined(LOSCFG_SOC_COMPANY_WINNERMICRO)) { 26 sources += [ "gpio_wm.c" ] 27 } 28 if (defined(LOSCFG_SOC_SERIES_STM32F4xx)) { 29 sources += [ "gpio_stm32f4xx.c" ] 30 } 31 32 include_dirs = [ "." ] 33 if (defined(LOSCFG_SHIELD_V200ZR_EVB_T1) && 34 defined(LOSCFG_DRIVERS_HDF_CONFIG_MACRO)) { 35 deps = [ "//device/board/fnlink/shields" ] 36 } 37 if (defined(LOSCFG_DRIVERS_HDF_CONFIG_MACRO)) { 38 HDF_HCS_BUILD_PATH = rebase_path( 39 "//device/board/$device_company/$device_name/liteos_m/hdf_config") 40 cmd = "if [ -f ${HDF_HCS_BUILD_PATH}/BUILD.gn ]; then echo true; else echo false; fi" 41 HAVE_HCS_BUILD_PATH = 42 exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") 43 if (HAVE_HCS_BUILD_PATH) { 44 deps = [ "${HDF_HCS_BUILD_PATH}" ] 45 } 46 } 47} 48