HarmonyOS 开发板 鸿蒙系统 鸿蒙OS
背景:我看大部分开发者都在学习Hi3861板子点亮OLED屏幕,Hi3516板子项目不多,就着手移植一个oled驱动,学习一下,平时上班,私下学习时间不多,更新不及时请谅解,本驱动目前移植完毕并编译通过,购买的oled屏幕还在路上,还未验证,点亮后在更新一下文章。
移植步骤:
1、新建harmony/vendor/huawei/hdf/oled/目录
新建:oledssd1306.c Makefile Kconfig三个文件
2、修改harmony/vendor/huawei/hdf/Kconfig
增加:source "../../vendor/huawei/hdf/oled/Kconfig"
3、修改harmony/vendor/huawei/hdf/hdf_vendor.mk
增加:#zsc
LITEOS_BASELIB += -lhdf_oled_sample
LIB_SUBDIRS += $(VENDOR_HDF_DRIVERS_ROOT)/oled
4、新建harmony/vendor/hisi/hi35xx/hi3516dv300/config/oled/oled_config.hcs
内容:
root {
module = "hdf_oled_sample";
author = "zang shi chang";
serviceName = "oled_ssd1306_service";
}
5、修改
harmony/vendor/hisi/hi35xx/hi3516dv300/config/device_info/device_info.hcs
文件,display :: host节点增加
device_oled :: device {
device0 :: deviceNode {
policy = 2;
priority = 100;
preload = 0;
permission = 0666;
moduleName = "oled_ssd1306_driver";
serviceName = "oled_ssd1306_service";
}
}
6、修改harmony/vendor/hisi/hi35xx/hi3516dv300/config/hdf.hcs增加
#include "oled/oled_config.hcs"
7、修改harmony/kernel/liteos_a/tools/build/config/hi3516dv300_debug_shell.config
hi3516dv300_clang_release.config
hi3516dv300_release.config
增加LOSCFG_DRIVERS_HDF_PLATFORM_OLED_SAMPLE=y
8、python build.py ipcamera_hi3516dv300 -b debug
9、等待验证。。。
oled.zip
(4.67 KB)
(下载次数: 6, 2020-11-12 10:13 上传)
回帖(4)
2020-11-12 11:20:24
2020-11-20 18:14:26
2021-1-8 14:59:53
2023-4-3 14:26:43
更多回帖
长按上方图片保存到相册