1 Star 0 Fork 1

高豪钒 / rt-u8g2

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

u8g2 logo

rt-u8g2

0、介绍

u8g2 原先是 Arduino 平台上的一个单色屏驱动,现在移植到了 rt-thread,可以满足各种各种各样的需求。

游戏开发 (examples/games/space_trash)

用户界面 (examples/page_buffer/icon_menu)

绘图 (examples/page_buffer/graphic_test)

1、U8G2 特点

1.1 支持屏幕多,移植方便

使用 u8g2 的好处在于它支持近 200 种单色屏,同样的代码可以直接运行在不同的屏幕上,比如前面的游戏可以在各种屏幕上运行:

经典 128x64

OLED SSD1306 I2C

在这里可以看到所有支持的屏幕:

https://github.com/olikraus/u8g2/wiki/gallery

1.2 支持字体多

中文

韩文

日文

梵文

1.3 绘图函数多

支持各种绘图函数,而且自带各种 icon

总结一下 u8g2 的特点:

  • 支持近 200 种单色屏,移植方便
  • 支持各种绘图函数、图像与非操作,自带用户按键检测
  • 支持 unicode 和 utf8,自带 100 多种字体和 100 多个 icon

2、项目说明

2.1 目录结构

说明:目录结构

名称 说明
docs 文档目录
examples 例子目录
src 源代码目录
port 针对特定平台的移植代码目录

2.2 许可证

  • The U8g2lib code (http://code.google.com/p/u8g2/) is licensed under the terms of the new-bsd license (two-clause bsd license). See also:

      http://www.opensource.org/licenses/bsd-license.php  
  • The repository and optionally the releases contain icons, which are derived from the WPZOOM Developer Icon Set. WPZOOM Developer Icon Set by WPZOOM is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

      http://www.wpzoom.com/wpzoom/new-freebie-wpzoom-developer-icon-set-154-free-icons/ 
  • Fonts are licensed under different conditions.for detailed information on the licensing conditions for each font.

      https://github.com/olikraus/u8g2/wiki/fntgrp

Check full LICENCE here.

2.3 项目依赖

说明:如果使用 I2C 液晶屏需要开启 I2C,GPIO 模拟 I2C 。

  • Using I2C device drivers
  • Use GPIO to simulate I2C

说明:如果使用 SPI 液晶屏需要开启 SPI 。

  • Using SPI Bus/Device device drivers

3、如何使用 U8G2

使用 u8g2 package 需要在 RT-Thread 的包管理器中选择它,具体路径如下:

RT-Thread online packages
	peripheral libraries and drivers --->
    	[*] U8G2: a u8g2 package for rt-thread
            [*] Use hardware spi                                     
              (spi1)  spi bus name (NEW)              
              (spi10) spi device name (NEW)     
            [*] Use hardware i2c          
              (i2c2)  i2c device name
            U8G2 Examples  --->

然后让 RT-Thread 的包管理器自动更新,或者使用 pkgs --update 命令更新包到 BSP 中。

一共有50个例程,可以在源码 docs 目录下看到预览图。默认的例程都是用的软件I2C,如果觉得速度比较慢可以使用硬件I2C。

4、注意事项

  • 默测试认使用 STM32F103,如果要使用到其他平台,请参照 移植说明,不过只要用的 RT-Thread 应当不需要额外的移植。
  • 请使用 stm32 目录下的 bsp
  • 编译需要开启 -std=c99
  • 如果编译发现 flash 不够大,可以打开优化选项 -O3 或者参照 这里 去掉多余的字库
  • 完整的 API 手册可以访问这个 链接
  • 其他 常见问题 FAQ

5、感谢

6、联系方式

空文件

简介

暂无描述 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/HFauto/rt-u8g2.git
git@gitee.com:HFauto/rt-u8g2.git
HFauto
rt-u8g2
rt-u8g2
master

搜索帮助