当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
2 Star 21 Fork 11

hihopeorg / harmonyos-ssd1306
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

harmonyos-ssd1306

支持HarmonyOS IoT硬件接口的SSD1306 OLED屏驱动库;

  • 内置了128*64 bit的内存缓冲区,支持全屏刷新;
  • 优化了屏幕刷新速率,实测最大帧率10fps;
  • libm_port是从musl libc中抽取的sincos的实现;
    • 用于规避链接Hi3861 SDK中的libm_flash.a报错的问题;
  • gif2imgs.py 可用于将gif动图中的帧分离出来;
    • 依赖 pillow 包,可以使用 pip install pillow 命令安装;
  • img2code.py 可用于将图片转为C数组,每个字节表示8个像素;
    • 依赖 opecv-python 包,可以使用 pip install opencv-python 命令安装;

如何编译

  1. 在openharmony源码目录下克隆本项目:git clone https://gitee.com/hihopeorg/harmonyos-ssd1306

  2. 修改openharmony源码的build/lite/product/wifiiot.json文件:

    //applications/sample/wifi-iot/app替换为//harmonyos-ssd1306:app保存;

  3. 在openharmony源码目录下执行:python build.py wifiiot

编译错误解决

本项目代码使用了鸿蒙IoT硬件子系统的I2C API接口,需要连接到hi3861的I2C相关接口;默认情况下,Hi3861的I2C编译配置没有打开,编译时会有如下错误:

riscv32-unknown-elf-ld: ohos/libs/libhal_iothardware.a(hal_wifiiot_i2c.o): in function `.L0 ':
hal_wifiiot_i2c.c:(.text.HalI2cWrite+0x12): undefined reference to `hi_i2c_write'
riscv32-unknown-elf-ld: hal_wifiiot_i2c.c:(.text.HalI2cInit+0x12): undefined reference to `hi_i2c_init'
scons: *** [output/bin/Hi3861_wifiiot_app.out] Error 1
BUILD FAILED!!!!

解决方法

需要修改vendor\hisi\hi3861\hi3861\build\config\usr_config.mk文件: # CONFIG_I2C_SUPPORT is not set行,修改为:CONFIG_I2C_SUPPORT=y

效果演示

  1. 播放gif:https://www.bilibili.com/video/BV1Af4y1B7TD/
    • 使用本项目中的转换脚本将gif每一帧画面提取出来,转成bitmap数组,程序里循环播放
  2. 播放视频:https://www.bilibili.com/video/BV1DK4y1f7yw/

参考链接

本项目是基于afiskon的stm32-ssd1306移植的,对部分细节做了修改和优化,原项目链接:

MIT License Copyright (c) 2018 Aleksander Alekseev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

鸿蒙OS的SSD1306 OLED显示屏驱动库,使用了鸿蒙的IoT硬件I2C接口 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/hihopeorg/harmonyos-ssd1306.git
git@gitee.com:hihopeorg/harmonyos-ssd1306.git
hihopeorg
harmonyos-ssd1306
harmonyos-ssd1306
master

搜索帮助

14c37bed 8189591 565d56ea 8189591