之前一直尝试移植过u8gliab和u8g2,移植没有成功,这次看到这篇文章,很详细。参考文章:基于以7920为核心的点阵型LCD12864成熟代码工程u8g2的移植——stm32单片机:https://blog.csdn.net/perfugee/article/details/79092075,文章很有启发意义,解决了我长时间的困扰问题,感谢。
只是在这里总结移植过程一下:
硬件驱动的话,需要自己构建
typedef uint8_t (*u8x8_msg_cb)(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);函数,例:uint8_t u8x8_byte_hw_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr),再构建typedef uint8_t (*u8x8_msg_cb)(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);函数,直接返回1就可以;模式驱动的话,直接调用库的软件驱动,再构建
typedef uint8_t (*u8x8_msg_cb)(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);函数,例见上面文章。
本文介绍了STM32F407上SH1106 OLED显示器的移植过程,包括如何构建硬件和软件驱动函数,并提供了一种可行的移植方案。

8517

被折叠的 条评论
为什么被折叠?



