GD32307E-START 硬件IIC点亮0.96‘’OLED(05)
[复制链接]
本帖最后由 trucy 于 2020-10-22 15:51 编辑
应大家需求上一篇IO模拟I2C点亮OLED改成硬件i2c(i2c0)
https://bbs.eeworld.com.cn/thread-1144175-1-1.html
我们通过Datasheet了解到GD32F307 I2C0使用的IO为PB6/7
因此软件我们只需要使能I2C0即可
rcu_periph_clock_enable(RCU_I2C0);
接下来就是OLED的数据传输
OLED DRIVER DATASHEET 描述The D/C# bit determines the next data byte is acted as a command or a data. If the D/C# bit is
set to logic “0”, it defines the following data byte as a command. If the D/C# bit is set to
logic “1”, it defines the following data byte as a data which will be stored at the GDDRAM.
The GDDRAM column address pointer will be increased by one automatically after each
data write.
逻辑分析仪量测I2C实际速度为400K
其他和上一篇IO模拟一致
使用硬件I2C测试图片show
贴上keil工程示例代码
I2C_OLED.7z
(2.2 MB, 下载次数: 163)
硬件I2C测试完成,谢谢
|