shuichan_new/STM32F103_App1/HardWare/OLED/oled.h

23 lines
1.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __OLED_H
#define __OLED_H
#include "main.h"
* : SPI, W25Q64 线(CLK=PB6 DI=PB7 DO=PB9), CS2=PC12
* : SSD1306 I2C(SCL=PB5 SDA=PB4, EEPROM 线, RST)
* : SPI(CLK=PB3 DI=PA15 FSO=PA12 CS2=PC12)
* GB2312/GBK GBK
* 128x6416 4 row 0~3 8 16 ASCII */
void oled_init(void); /* GPIO + 屏幕初始化app_init 调用) */
void oled_clear(void); /* 全屏清屏 */
void oled_off(void); /* 关显示0xAE黑屏断电前调用 */
void oled_locate(uint8_t row, uint8_t col8); /* 定位row 0~3col8 为 8 像素单位 0~15 */
void oled_xoff(uint8_t px);
uint8_t oled_text_w(const char *gbk_str); /* 文本像素宽度汉字16/ASCII8 */ /* 在当前列基础上右移 px 像素(防烧屏偏移用) */
void oled_print(const char *gbk_str); /* 从当前位置显示 GBK 字符串 */
void oled_print_line(const char *gbk_str); /* 整行显示:不足 128px 用空格补齐覆盖旧内容 */
void oled_show_qrcode(const char *text); /* 开机二维码页: 内容=ClientID, 左侧QR+右侧ID文本 */
#endif /* __OLED_H */