新手入门
- 积分
- 16
- 金钱
- 16
- 注册时间
- 2019-2-15
- 在线时间
- 5 小时
|
1金钱
用emWin526内置驱动驱动128*64的OLED,控制器是SSD1306的.根据手册配置,选择带缓存的
配置代码如下:
[mw_shl_code=applescript,true]#define XSIZE_PHYS 128
#define YSIZE_PHYS 64
#define COLOR_CONVERSION GUICC_1
#define DISPLAY_DRIVER GUIDRV_SPAGE_1C1
void LCD_X_Config(void) {
CONFIG_SPAGE Config = {0};
GUI_DEVICE * pDriver;
#ifndef WIN32
GUI_PORT_API PortAPI = {0};
#endif
//
// Set display driver and color conversion for 1st layer
//
pDriver = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
//
// Display size configuration
//
if (LCD_GetSwapXY()) {
LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
LCD_SetVSizeEx(0, VYSIZE_PHYS, VXSIZE_PHYS);
} else {
LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
}
//
// Driver configuration
//
Config.FirstSEG = 0;
Config.FirstCOM = 0;
GUIDRV_SPage_Config(pDriver, &Config);
//
// Configure hardware routines
PortAPI.pfWrite8_A0 = WriteCmd; // Write CMD
PortAPI.pfWrite8_A1 = WriteDat; // Write sigle data
PortAPI.pfWriteM8_A1 = WriteDatM; // Write multi data
PortAPI.pfReadM8_A1 = 0; // No need to read
GUIDRV_SPage_SetBus8(pDriver, &PortAPI);
//
// Controller configuration
//
GUIDRV_SPage_Set1510(pDriver); // SSD1306
}[/mw_shl_code]
现在问题是鼠标移动拖尾,查看手册
按手册说的我这样配置应该是开启显示缓存了吧,弄了好几天了还是不行,来论坛求助一下
|
|