新手入门
积分 19
金钱 19
注册时间 2016-6-29
在线时间 2 小时
1 金钱
MiniSTM32 V3.3 裸机程序+STemWin 5.28, 2.0寸 ILI9225G 176*220液晶屏,显示方向:横屏(220*176)。
用LCD驱动直接画线,画矩形,位图,都正常。
但是emwin不能画圆,不能画矩形,也不能画竖线,画出来只显示成水平线,显示BMP位图也是乱的,呈撕裂模样看不清。但是显示中英文字符是正常的,画水平线也是正常的。
请问这是怎么回事?
GUI驱动只添加了打点函数:
static void LcdWriteReg(U16 Data) {
// ... TBD by user
LCD_WR_REG(Data);
}
static void LcdWriteData(U16 Data) {
// ... TBD by user
LCD_WR_DATAX(Data);
}
static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
while (NumItems--) {
// ... TBD by user
LCD_WR_DATAX(*pData++);
}
}
static void LcdReadDataMultiple(U16 * pData, int NumItems) {
while (NumItems--) {
// ... TBD by user
*pData++ = LCD_RD_DATA();
}
}
void LCD_X_Config(void) {
GUI_DEVICE * pDevice;
CONFIG_FLEXCOLOR Config = {0};
GUI_PORT_API PortAPI = {0};
//
// Set display driver and color conversion
//
pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_565, 0, 0);
//
// Display driver configuration, required for Lin-driver
//
LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
//
// Orientation
//
Config.Orientation = GUI_SWAP_XY;// | GUI_MIRROR_Y;
GUIDRV_FlexColor_Config(pDevice, &Config);
//
// Set controller and operation mode
//
PortAPI.pfWrite16_A0 = LcdWriteReg;
PortAPI.pfWrite16_A1 = LcdWriteData;
PortAPI.pfWriteM16_A1 = LcdWriteDataMultiple;
PortAPI.pfReadM16_A1 = LcdReadDataMultiple;
GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66708, GUIDRV_FLEXCOLOR_M16C0B16);
}
int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
int r;
(void) LayerIndex;
(void) pData;
switch (Cmd) {
case LCD_X_INITCONTROLLER: {
//
// Called during the initialization process in order to set up the
// display controller and put it into operation. If the display
// controller is not initialized by any external routine this needs
// to be adapted by the customer...
//
// ...
LCD_Init();
return 0;
}
default:
r = -1;
}
return r;
}
我来回答