
回复
添加资源
添加资源将有机会获得更多曝光,你也可以直接关联已上传资源 去关联
@toc
此文章以openharmony 3.1代码基础
ipcamera_hispark_taurus
上添加khdf步骤。
驱动代码见附件
drivers\adapter\khdf\liteos\hdf_lite.mk
# my sample test
ifeq ($(LOSCFG_DRIVERS_HDF_MY_SAMPLE_DRIVER), y)
LITEOS_BASELIB += -lmy_sample_driver
LIB_SUBDIRS += $(LITEOS_DRIVERS_HDF)/my_sample_driver
endif
drivers\adapter\khdf\liteos\Kconfig
source "../../drivers/adapter/khdf/liteos/my_sample_driver/Kconfig"
drivers\adapter\khdf\liteos\BUILD.gn
vendor\hisilicon\hispark_taurus\hdf_config\device_info\device_info.hcs
my_sample :: host {
hostName = "my_sample_host";
device_mysample :: device {
device0 :: deviceNode { // DeviceNode of the sample driver
policy = 2; // Driver service release policy. For details, see section Driver Service Management.
priority= 10; // Driver startup priority (0-200). A larger value indicates a lower priority. The default value 100 is recommended. If the priorities are the same, the device loading sequence is random.
preload = 0; // On-demand loading of the driver. For details, see "NOTE" at the end of this section.
permission = 0664; // Permission for the driver to create device nodes.
moduleName = "my_sample_driver"; // Driver name. The value of this field must be the same as the value of moduleName in the driver entry structure.
serviceName = "my_sample_service"; // Name of the service released by the driver. The name must be unique.
}
}
}
kernel/liteos_a/
cd kernel/liteos_a/
make menuconfig
driver
framework support
my_sample driver
q
,保存退出附件
build\lite\components\myapp.json
{
"components": [
{
"component": "myapp",
"description": "my app",
"optional": "false",
"dirs": [
"myapp"
],
"targets": [
"//myapp:myapp"
],
"rom": "",
"ram": "",
"output": [
],
"adapted_kernel": [
"liteos_a",
"liteos_m"
],
"features": [],
"deps": {
"third_party": [
"bounds_checking_function"
],
"components": []
}
}
]
}
vendor\hisilicon\hispark_taurus\config.json
{
"subsystem": "myapp",
"components": [
{ "component": "myapp", "features":[] }
]
}
编译环境参考:3516应用调用到驱动实践
执行下面2条命令。
hb set
.
执行hb build -f
烧录步骤参考:3516应用调用到驱动实践
切换到/bin目录下执行:./my_sample_driver_test
结果如图: