本帖最后由 zhuisuoji 于 2015-6-15 17:36 编辑
请教下,红牛板移植emWin海豚游动时出现黑影,使用鼠标也是一样出现黑影,3.5寸SSD1963屏,目前还不知道该如何解决.
读点程序设2次后读取也都试过,但都一样,反而设第3次后时效果好一点,海豚游动时出现的不是黑影,而是不规则颜 {MOD}的影子,
这是读2次的
海豚1.jpg (642.46 KB, 下载次数: 0)
下载附件
2015-6-15 17:27 上传
- /********************************************************************
- *
- * LcdWriteReg
- *
- * Function description:
- * Sets display register
- */
- static void LcdWriteReg(U16 Data) {
- // ... TBD by user
- LCD_REG = Data;
- }
- /********************************************************************
- *
- * LcdWriteData
- *
- * Function description:
- * Writes a value to a display register
- */
- static void LcdWriteData(U16 Data) {
- // ... TBD by user
- LCD_RAM = Data;
- }
- /********************************************************************
- *
- * LcdWriteDataMultiple
- *
- * Function description:
- * Writes multiple values to a display register.
- */
- static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
- while (NumItems--) {
- // ... TBD by user
- LCD_RAM = * pData++;
- }
- }
- /********************************************************************
- *
- * LcdReadDataMultiple
- *
- * Function description:
- * Reads multiple values from a display register.
- */
- static void LcdReadDataMultiple(U16 * pData, int NumItems) {
- while (NumItems--) {
- // ... TBD by user
- * pData++ = LCD_RAM;
- }
- }
- /*********************************************************************
- *
- * LCD_X_Config
- *
- * Function description:
- * Called during the initialization process in order to set up the
- * display driver configuration.
- *
- */
- void LCD_X_Config(void) {
- GUI_DEVICE * pDevice;
- CONFIG_FLEXCOLOR Config = {0};
- GUI_PORT_API PortAPI = {0};
- unsigned TouchOrientation;
- //
- // Set display driver and color conversion
- //
- pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_M565, 0, 0);
- //
- // Display driver configuration, required for Lin-driver
- //
- LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
- LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
- //
- // Set orientation of touch screen (only required when using
- //
- TouchOrientation = GUI_SWAP_XY ;
-
- GUI_TOUCH_SetOrientation(TouchOrientation);
-
- GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 239, GUI_TOUCH_AD_TOP, GUI_TOUCH_AD_BOTTOM);
- GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 319, GUI_TOUCH_AD_LEFT,GUI_TOUCH_AD_RIGHT);
- //
- // Orientation
- //
- Config.Orientation = 0;//GUI_SWAP_XY | GUI_MIRROR_Y
- Config.NumDummyReads = 2; //--读第2次才开始数据的读取
- 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_F66720, GUIDRV_FLEXCOLOR_M16C0B16);
- }
复制代码
除了以下这几个颜 {MOD}写入与读出比较是一样的,其它的都是不一样的,也不知道是不是这个原因,看到ssd1963是18位及24位的,所以采用24位显示,而emWin是565,会不会是因为16位与24位转换的原因?
- #define GUI_BLUE 0x00FF0000 //比较后一样
- #define GUI_GREEN 0x0000FF00 //比较后一样
- #define GUI_RED 0x000000FF //比较后一样
- #define GUI_CYAN 0x00FFFF00 //比较后一样
- #define GUI_MAGENTA 0x00FF00FF //比较后一样
- #define GUI_YELLOW 0x0000FFFF //比较后一样
- #define GUI_LIGHTBLUE 0x00FF8080
- #define GUI_LIGHTGREEN 0x0080FF80
- #define GUI_LIGHTRED 0x008080FF
- #define GUI_LIGHTCYAN 0x00FFFF80
- #define GUI_LIGHTMAGENTA 0x00FF80FF
- #define GUI_LIGHTYELLOW 0x0080FFFF
- #define GUI_DARKBLUE 0x00800000
- #define GUI_DARKGREEN 0x00008000
- #define GUI_DARKRED 0x00000080
- #define GUI_DARKCYAN 0x00808000
- #define GUI_DARKMAGENTA 0x00800080
- #define GUI_DARKYELLOW 0x00008080 //比较后一样
- #define GUI_WHITE 0x00FFFFFF //比较后一样
- #define GUI_LIGHTGRAY 0x00D3D3D3
- #define GUI_GRAY 0x00808080
- #define GUI_DARKGRAY 0x00404040
- #define GUI_BLACK 0x00000000 //比较后一样
- #define GUI_BROWN 0x002A2AA5
- #define GUI_ORANGE 0x0000A5FF
复制代码下面是颜 {MOD}写入与读出参数比较
颜 {MOD}写入读出比较.jpg (466.23 KB, 下载次数: 0)
下载附件
2015-6-15 18:06 上传
明白了
谢谢~~~我也是查来查去觉着应该也是emWin本身驱动问题.正在努力想办法改正
一周热门 更多>