/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { GUI_MULTIBUF_Config(NUM_BUFFERS); // // Set display driver and color conversion for 1st layer // GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Display driver configuration, required for Lin-driver // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS); } LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR); // // Set user palette data (only required if no fixed palette is used) // #if defined(PALETTE) LCD_SetLUTEx(0, PALETTE); #endif }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { GUI_DEVICE * pDevice; // // Set display driver and color conversion // pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Common display driver configuration // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS); } // // Setup hardware access routines // #ifndef WIN32 _PortAPI.pfWrite16_A0 = LCD_X_SPI4_16_Write0; _PortAPI.pfWrite16_A1 = LCD_X_SPI4_16_Write1; _PortAPI.pfWriteM16_A1 = LCD_X_SPI4_16_WriteM1; GUIDRV_IST3088_SetBus16(pDevice, &_PortAPI); #endif }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { GUI_DEVICE * pDevice; GUI_PORT_API PortAPI = {0}; CONFIG_FLEXCOLOR Config = {0}; #if (NUM_BUFFERS > 1) GUI_MULTIBUF_Config(NUM_BUFFERS); #endif // // Set display driver and color conversion for 1st layer // pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Common display driver configuration // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS); } // // Configuration of GUIDRV_FLEX_COLOR // // // Select hardware interface // GUIDRV_FlexColor_SetReadFunc66712_B16(pDevice, GUIDRV_FLEXCOLOR_READ_FUNC_II); // // Set controller and operation mode // PortAPI.pfWrite16_A0 = LCD_X_Write0_16; PortAPI.pfWrite16_A1 = LCD_X_Write1_16; PortAPI.pfWriteM16_A1 = LCD_X_WriteM1_16; PortAPI.pfReadM16_A1 = LCD_X_ReadM1_16; GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66712, GUIDRV_FLEXCOLOR_M16C0B16); // // Orientation and offset of SEG/COM lines // Config.Orientation = DISPLAY_ORIENTATION; Config.RegEntryMode = 0; GUIDRV_FlexColor_Config(pDevice, &Config); #if (USE_TOUCH == 1) // // Set orientation of touch screen // GUI_TOUCH_SetOrientation(DISPLAY_ORIENTATION); // // Calibrate touch screen // GUI_TOUCH_Calibrate(GUI_COORD_X, 0, WIDTH - 1, TOUCH_LEFT, TOUCH_RIGHT); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, HEIGHT - 1, TOUCH_TOP, TOUCH_BOTTOM); #endif }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { /********************************************************************************************************/ { lcd_info.fd = open("/dev/fb0", O_RDWR, 0666); if (lcd_info.fd < 0) { GUI_X_ErrorOut("emWin failed to open framebuffer device: \"/dev/fb0\", serious error\n"); /* * TODO: 出错处理 */ } ioctl(lcd_info.fd, FBIOGET_VSCREENINFO, &lcd_info.var); ioctl(lcd_info.fd, FBIOGET_FSCREENINFO, &lcd_info.fix); /* * TODO: 这两个值的设置 */ COLOR_CONVERSION = GUICC_M565; DISPLAY_DRIVER = GUIDRV_LIN_16; } /********************************************************************************************************/ // // At first initialize use of multiple buffers on demand // #if (NUM_BUFFERS > 1) GUI_MULTIBUF_Config(NUM_BUFFERS); #endif // // Set display driver and color conversion for 1st layer // GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Display driver configuration, required for Lin-driver // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_VIRT, XSIZE_VIRT); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_VIRT, YSIZE_VIRT); } LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR); // // Set user palette data (only required if no fixed palette is used) // #if defined(PALETTE) LCD_SetLUTEx(0, PALETTE); #endif }
/* **************************************************************************** * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * **************************************************************************** */ void LCD_X_Config(void) { /* 读取EEPROM中的参数 */ ee_ReadBytes((uint8_t *)&g_tTPSL, 1024, sizeof(g_tTPSL)); /* Set display driver and color conversion for 1st layer */ GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); if (g_ChipID == IC_8875) { if (g_ucGPIX == 1) /* GPIX = 1 4.3 480x272 */ { /* Display driver configuration */ LCD_SetSizeEx (0, 480, 272); LCD_SetVSizeEx (0, 480, 272); /* Touch calibration */ GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 479, g_tTPSL.usAdcX1, g_tTPSL.usAdcX2); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 271, g_tTPSL.usAdcY1, g_tTPSL.usAdcY2); /* 查看是否需要切换X,Y*/ if(g_tTPSL.XYChange == 1) { GUI_TOUCH_SetOrientation(GUI_SWAP_XY); } } else /* GPIX = 0 7 800*480 */ { /* Display driver configuration */ LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx (0, VXSIZE_PHYS, VYSIZE_PHYS); GUI_TOUCH_Calibrate(GUI_COORD_X, 0, XSIZE_PHYS - 1, g_tTPSL.usAdcX1, g_tTPSL.usAdcX2); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, YSIZE_PHYS - 1, g_tTPSL.usAdcY1, g_tTPSL.usAdcY2); /* 查看是否需要切换X,Y*/ if(g_tTPSL.XYChange == 1) { GUI_TOUCH_SetOrientation(GUI_SWAP_XY); } } } else { LCD_SetSizeEx (0, 400, 240); LCD_SetVSizeEx (0, 400, 240); /* Touch calibration */ GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 399, 300, 3600); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 239, 273, 3671); } }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { GUI_MULTIBUF_Config(NUM_BUFFERS); // // Set display driver and color conversion for 1st layer // guiDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Display driver configuration, required for Lin-driver // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS); } LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR); #ifdef LCD_DEVFUNC_CONTRADDR if(guiDevice) { void (* pSetControllerAddress) (GUI_DEVICE *, uint32_t reg, uint32_t data); /* now let's take function for setting controller address */ pSetControllerAddress = (void (*) (GUI_DEVICE *, uint32_t, uint32_t))guiDevice->pDeviceAPI->pfGetDevFunc(&guiDevice, LCD_DEVFUNC_CONTRADDR); /* and configure addresses - for writing register and data */ pSetControllerAddress(guiDevice, BC_SSD2119_BASE, BC_SSD2119_BASE + 2); } #endif /* example how to disable default controller initialization function */ #ifdef removeit_LCD_DEVFUNC_INITIALIZE if(guiDevice) { void (* pSetFunc) (GUI_DEVICE *, int, void (*)(void)); /* now let's take function for changing functions in driver */ pSetFunc = (void (*) (GUI_DEVICE *, int, void (*)(void)))guiDevice->pDeviceAPI->pfGetDevFunc(&guiDevice, LCD_DEVFUNC_SETFUNC); /* and replace initialization function. It is possible to remove */ /* initialization function by giving null instead of new function pointer */ pSetFunc(guiDevice, LCD_DEVFUNC_INITIALIZE, (void (*)(void))yourInitFunction); } #endif // // Set user palette data (only required if no fixed palette is used) // #if defined(PALETTE) LCD_SetLUTEx(0, PALETTE); #endif }
/********************************************************************* * * 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}; // // 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.FirstCOM = 0; //modify by fire Config.FirstSEG = 0; //modify by fire Config.Orientation = GUI_MIRROR_Y|GUI_MIRROR_X; //modify by fire 竖屏 // Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y; //modify by fire 横屏 Config.NumDummyReads = 2; //modify by fire 读取的第二个数据才是真实数据 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_F66709, GUIDRV_FLEXCOLOR_M16C0B16); //modify by fire ԭGUIDRV_FLEXCOLOR_F66708 }
/********************************************************************* * * 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}; // // 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_MIRROR_X; Config.RegEntryMode = 0x6230; 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_F66714, GUIDRV_FLEXCOLOR_M16C0B16); }
/********************************************************************* * * LCD_X_Config * * Purpose: * 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}; // // Set display driver and color conversion // pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 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_MIRROR_X | GUI_SWAP_XY; GUIDRV_FlexColor_Config(pDevice, &Config); // // Set controller and operation mode // PortAPI.pfWrite16_A0 = LCD_X_8080_16_Write00_16; PortAPI.pfWrite16_A1 = LCD_X_8080_16_Write01_16; PortAPI.pfWriteM16_A1 = LCD_X_8080_16_WriteM01_16; PortAPI.pfReadM16_A1 = LCD_X_8080_16_ReadM01_16; GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66708, GUIDRV_FLEXCOLOR_M16C0B16); }
/********************************************************************* * * 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}; // // 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); GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 240, TOUCH_AD_TOP, TOUCH_AD_BOTTOM); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 320, TOUCH_AD_LEFT, TOUCH_AD_RIGHT); // // Orientation //配置显示屏的方向 //Config.Orientation = GUI_SWAP_XY|GUI_MIRROR_Y;// 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; //配置总线,缓存,和硬件程序 5.22手册991页有详细解说所支持的控制器 GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B16); }
static void _InitController(unsigned LayerIndex) { // // Set display size and video-RAM address // LCD_SetSizeEx (XSIZE_PHYS, YSIZE_PHYS, LayerIndex); LCD_SetVSizeEx(VXSIZE_PHYS, VYSIZE_PHYS, LayerIndex); LCD_SetVRAMAddrEx(LayerIndex, (void*)LCD_VRAM_BASE_ADDR); // // Init LCD // #if GUI_SUPPORT_TOUCH // Used when touch screen support is enabled { U32 TouchOrientation; TouchOrientation = (GUI_MIRROR_X * LCD_GetMirrorXEx(0)) | (GUI_MIRROR_Y * LCD_GetMirrorYEx(0)) | (GUI_SWAP_XY * LCD_GetSwapXYEx (0)) ; GUI_TOUCH_SetOrientation(TouchOrientation); if (LCD_GetSwapXYEx(0)) { GUI_TOUCH_Calibrate(GUI_COORD_X, 0, XSIZE_PHYS, TOUCH_AD_LEFT, TOUCH_AD_RIGHT); // x axis swapped GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, YSIZE_PHYS, TOUCH_AD_TOP , TOUCH_AD_BOTTOM); // y axis swapped } else { GUI_TOUCH_Calibrate(GUI_COORD_X, 0, XSIZE_PHYS, TOUCH_AD_LEFT, TOUCH_AD_RIGHT); // x axis GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, YSIZE_PHYS, TOUCH_AD_TOP , TOUCH_AD_BOTTOM); // y axis } } #endif }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { GUI_DEVICE * pDevice; CONFIG_S1D13781 Config; #ifndef WIN32 GUI_PORT_API PortAPI = {0}; #endif // // Initialize multibuffering // GUI_MULTIBUF_Config(NUM_BUFFERS); // // Setup port routines // #ifndef WIN32 PortAPI.pfWriteM8_A1 = _WriteM8_A1; PortAPI.pfReadM8_A1 = _ReadM8_A1; PortAPI.pfSetCS = _SetCS; #endif // // Set display driver and color conversion for 1st layer // pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); { // // Common display driver configuration // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS); } // // Driver configuration // #ifndef WIN32 GUIDRV_S1D13781_SetBusSPI(pDevice, &PortAPI); #endif Config.BufferOffset = 0; Config.WriteBufferSize = 320 + 5; Config.UseLayer = 0; Config.WaitUntilVNDP = 1; GUIDRV_S1D13781_Config(pDevice, &Config); } }
void LCD_X_Config(void) { // // Set display driver and color conversion for 1st layer // GUI_DEVICE_CreateAndLink(&GUIDRV_Template_API, COLOR_CONVERSION, 0, 0); // // Display driver configuration, required for Lin-driver // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS); } LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR); }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { CONFIG_SPAGE Config = {0}; GUI_DEVICE * pDevice; #ifndef WIN32 GUI_PORT_API PortAPI = {0}; #endif // // Set display driver and color conversion for 1st layer // pDevice = 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(pDevice, &Config); // // Configure hardware routines // #ifndef WIN32 PortAPI.pfWrite8_A0 = LCD_X_8080_8_Write00; PortAPI.pfWrite8_A1 = LCD_X_8080_8_Write01; PortAPI.pfWriteM8_A0 = LCD_X_8080_8_WriteM00; PortAPI.pfWriteM8_A1 = LCD_X_8080_8_WriteM01; PortAPI.pfRead8_A0 = LCD_X_8080_8_Read00; PortAPI.pfRead8_A1 = LCD_X_8080_8_Read01; PortAPI.pfReadM8_A0 = LCD_X_8080_8_ReadM00; PortAPI.pfReadM8_A1 = LCD_X_8080_8_ReadM01; GUIDRV_SPage_SetBus8(pDevice, &PortAPI); #endif // // Controller configuration // GUIDRV_SPage_Set1512(pDevice); }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { GUI_DEVICE * pDevice; CONFIG_SLIN Config = {0}; // // Set display driver and color conversion // pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Common display driver configuration // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS); } // // Driver specific configuration // Config.UseCache = 1; GUIDRV_SLin_Config(pDevice, &Config); // // Select display controller // GUIDRV_SLin_SetS1D13700(pDevice); // // Setup hardware access routines // #ifndef WIN32 { GUI_PORT_API PortAPI; PortAPI.pfWrite16_A0 = _Write0; PortAPI.pfWrite16_A1 = _Write1; PortAPI.pfWriteM16_A0 = _WriteM0; PortAPI.pfRead16_A1 = _Read1; GUIDRV_SLin_SetBus8(pDevice, &PortAPI); } #endif }
//配置程序,用于创建显示驱动器件,设置颜色转换程序和显示尺寸 void LCD_X_Config (void) { GUI_MULTIBUF_ConfigEx(eLAYER_BSP, 1); GUI_MULTIBUF_ConfigEx(eLAYER_ESP, 1); /*BSP-------------------------------------------------------*/ GUI_DEVICE_CreateAndLink(&BSP_GUIDRV_Template_API, GUICC_M565, 0, eLAYER_BSP); //创建显示驱动器件 LCD_SetSizeEx(eLAYER_BSP, 240, 320); LCD_SetVSizeEx(eLAYER_BSP, 240, 320); GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 240, 0, 239); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 320, 0, 319); /*ESP-------------------------------------------------------*/ GUI_DEVICE_CreateAndLink(&ESP_GUIDRV_Template_API, GUICC_M565, 0, eLAYER_ESP); //创建显示驱动器件 LCD_SetSizeEx(eLAYER_ESP, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(eLAYER_ESP, XSIZE_PHYS, YSIZE_PHYS); GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 480, 0, 479); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 800, 0, 799); }
/********************************************************************* * * _InitController * * Function description: * Initializes the LCD controller and touch screen * */ static void _InitController(unsigned LayerIndex) { // // Set display size and video-RAM address // LCD_SetSizeEx (XSIZE_PHYS, YSIZE_PHYS, LayerIndex); LCD_SetVSizeEx(VXSIZE_PHYS, VYSIZE_PHYS, LayerIndex); LCD_SetVRAMAddrEx(LayerIndex, (void*)LCD_VRAM_BASE_ADDR); // // Init LCD // GLCD_Init(); #if GUI_SUPPORT_TOUCH // Used when touch screen support is enabled { U32 TouchOrientation; U32 pclk; // // Initialize touch screen // LPC_SC->PCONP |= (1 << 12); // Enable clock for ADC LPC_ADC->CR = 0 | (1 << 1) // Sel AD0[1] | (ADC_CLKDIV << 8) | (1 << 21) // Enable ADC ; // // Calibrate touch // TouchOrientation = (GUI_MIRROR_X * LCD_GetMirrorXEx(0)) | (GUI_MIRROR_Y * LCD_GetMirrorYEx(0)) | (GUI_SWAP_XY * LCD_GetSwapXYEx (0)) ; GUI_TOUCH_SetOrientation(TouchOrientation); if (LCD_GetSwapXYEx(0)) { GUI_TOUCH_Calibrate(GUI_COORD_X, 0, XSIZE_PHYS, TOUCH_AD_LEFT, TOUCH_AD_RIGHT); // x axis swapped GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, YSIZE_PHYS, TOUCH_AD_TOP , TOUCH_AD_BOTTOM); // y axis swapped } else { GUI_TOUCH_Calibrate(GUI_COORD_X, 0, XSIZE_PHYS, TOUCH_AD_LEFT, TOUCH_AD_RIGHT); // x axis GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, YSIZE_PHYS, TOUCH_AD_TOP , TOUCH_AD_BOTTOM); // y axis } // // Start touch timer // LPC_SC->PCONP |= (0x1<<2); pclk = SystemCoreClock/4; LPC_TIM1->PR = pclk/1000000; /* Set prescaler to get 1 M counts/sec */ LPC_TIM1->MR0 = 1000 * TOUCH_TIMER_INTERVAL; LPC_TIM1->MCR = (0x3<<0); /* Interrupt and Reset on MR0 */ NVIC_EnableIRQ(TIMER1_IRQn); LPC_TIM1->TCR = 1; /* Enable timer 1 */ } #endif }
/********************************************************************* * * 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}; // // 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 // if (hx8347d_drv.ReadID() == HX8347D_ID) { Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y | GUI_MIRROR_X; } else if (spfd5408_drv.ReadID() == SPFD5408_ID) { Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y; } else if (ili9320_drv.ReadID() == ILI9320_ID) { Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y | GUI_MIRROR_X; } else { Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y | GUI_MIRROR_X; } 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; // Find the current LCD and initialize GUIDRV if (spfd5408_drv.ReadID() == SPFD5408_ID) { GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66708, GUIDRV_FLEXCOLOR_M16C0B16); } else { GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66712, GUIDRV_FLEXCOLOR_M16C0B16); } }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { // // At first initialize use of multiple buffers on demand // #if (NUM_BUFFERS > 1) GUI_MULTIBUF_Config(NUM_BUFFERS); #endif // // Set display driver and color conversion for 1st layer // GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Display driver configuration, required for Lin-driver // if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS); } LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR); // // Set user palette data (only required if no fixed palette is used) // #if defined(PALETTE) LCD_SetLUTEx(0, PALETTE); #endif // // Set custom functions for several operations to optimize native processes // // LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void(*)(void))CUSTOM_LCD_CopyBuffer); // LCD_SetDevFunc(0, LCD_DEVFUNC_COPYRECT, (void(*)(void))CUSTOM_LCD_CopyRect); // LCD_SetDevFunc(0, LCD_DEVFUNC_FILLRECT, (void(*)(void))CUSTOM_LCD_FillRect); // LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_8BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap8bpp); // LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_16BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap16bpp); }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { /* Enable triple buffering */ GUI_MULTIBUF_Config(NUM_BUFFERS); /* Set display driver and color conversion */ GUI_DEVICE_CreateAndLink(GUIDRV_LIN_16, GUICC_M565, 0, 0); /* Set custom callback function for frame copy operation */ LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void (*)())copyBuffer); /* Display driver configuration, required for Lin-driver */ if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, LCD_HEIGHT, LCD_WIDTH); LCD_SetVSizeEx(0, LCD_HEIGHT, LCD_WIDTH); } else { LCD_SetSizeEx (0, LCD_WIDTH, LCD_HEIGHT); LCD_SetVSizeEx(0, LCD_WIDTH, LCD_HEIGHT); } /* Point video memory to start of PSRAM, drawing will start at frame 0 */ LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR_START); }
void LCD_X_Config(void) { // // Set display driver and color conversion //GUIDRV_LIN_24 24bpp, default orientation //GUICC_M666, 18 bpp, red and blue swapped GUI_DEVICE_CreateAndLink(GUIDRV_LIN_24 , // Display driver GUICC_M666, // Color conversion 0, 0); LCD_SetSizeEx (0, 320, 240); // Physical display size in pixels LCD_SetVSizeEx (0, 320, 480); // Virtual display size in pixels LCD_SetVRAMAddrEx(0, (void *)0x20000000); // Video RAM start address }
/********************************************************************* * * 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}; // // 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.FirstCOM = 0; //modify by xiaoku Config.FirstSEG = 0; //modify by xiaoku //Config.Orientation = GUI_MIRROR_Y|GUI_MIRROR_X; //modify by xiaoku 竖屏 // Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y; //modify by xiaoku 横屏 Config.NumDummyReads = 2; //modify by xiaoku 读取的第二个数据才是真实数据 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); GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B16); //modify by xiaoku /* modify by fire 设置触摸原点 */ GUI_TOUCH_SetOrientation((GUI_MIRROR_X * LCD_GetMirrorXEx(0)) | (GUI_MIRROR_Y * LCD_GetMirrorYEx(0)) | (GUI_SWAP_XY * LCD_GetSwapXYEx (0))); /* modify by fire 设置触摸校准 */ GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 240-1,TOUCH_AD_LEFT ,TOUCH_AD_RIGHT ); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 320-1,TOUCH_AD_TOP , TOUCH_AD_BOTTOM); }
void LCD_X_Config(void) { // // Set display driver and color conversion for 1st layer // GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Display driver configuration // LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx (0, VXSIZE_PHYS, VYSIZE_PHYS); // GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 800-1, GUI_TOUCH_AD_LEFT ,GUI_TOUCH_AD_RIGHT ); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 480-1,GUI_TOUCH_AD_TOP ,GUI_TOUCH_AD_BOTTOM ); // GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 800-1, GUI_TOUCH_AD_LEFT ,GUI_TOUCH_AD_RIGHT ); // GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 480-1,GUI_TOUCH_AD_TOP ,GUI_TOUCH_AD_BOTTOM ); }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { // // Set display driver and color conversion for 1st layer // GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // // Display driver configuration // LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx (0, VXSIZE_PHYS, VYSIZE_PHYS); LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR); // // Set user palette data (only required if no fixed palette is used) // #if defined(PALETTE) LCD_SetLUTEx(0, PALETTE); #endif }
//配置程序,用于创建显示驱动器件,设置颜色转换程序和显示尺寸 void LCD_X_Config(void) { GUI_DEVICE_CreateAndLink(&GUIDRV_Template_API, GUICC_M565, 0, 0); //创建显示驱动器件 LCD_SetSizeEx (0, lcddev.width, lcddev.height); LCD_SetVSizeEx (0, lcddev.width, lcddev.height); if(lcddev.dir == 0) //竖屏 { // 6368 3816 //GUI_TOUCH_SetOrientation(GUI_SWAP_XY|GUI_MIRROR_Y); GUI_TOUCH_Calibrate(GUI_COORD_X,0,800,0,799); GUI_TOUCH_Calibrate(GUI_COORD_Y,0,480,0,479); }else //横屏 { GUI_TOUCH_Calibrate(GUI_COORD_X,0,800,0,799); GUI_TOUCH_Calibrate(GUI_COORD_Y,0,480,0,479); } }
/********************************************************************* * * LCD_X_Config * * Purpose: * Called during the initialization process in order to set up the * display driver configuration. * */ void LCD_X_Config(void) { int i, BitsPerPixel; U32 Addr; // // Video RAM start address. // // This address is only required for display drivers with memory // mapped video RAM like the LIN_xxx driver. It does not need to // be adapted for display controllers with a simple bus interface. // Addr = 0x12345678; // // Display driver configuration // for (i = 0; i < GUI_COUNTOF(_aConfigPara); i++) { // // Set display driver and color conversion for 1st layer // GUI_DEVICE_CreateAndLink(_aConfigPara[i].pDisplayDriver, _aConfigPara[i].pColorConv, 0, i); // // Display driver configuration // LCD_SetPosEx (i, _aConfigPara[i].xPos, _aConfigPara[i].yPos); LCD_SetSizeEx (i, _aConfigPara[i].xSize, _aConfigPara[i].ySize); LCD_SetVSizeEx (i, _aConfigPara[i].vxSize, _aConfigPara[i].vySize); LCD_SetVRAMAddrEx(i, (void *)Addr); LCD_SetVisEx (i, 1); // // Set user palette data (only required if no fixed palette is used) // if (_aConfigPara[i].pPalette) { LCD_SetLUTEx(i, _aConfigPara[i].pPalette); } // // Calculate video RAM address for the following layer // BitsPerPixel = LCD_GetBitsPerPixelEx(i); Addr += ((_aConfigPara[i].vxSize * BitsPerPixel) * _aConfigPara[i].vySize) / 8; } }
void LCD_X_Config(void) { // /* Set display driver and color conversion for 1st layer */ GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); // if (g_ChipID == IC_8875) // { // if (g_ucGPIX == 1) /* GPIX = 1 4.3 480x272 */ // { // /* Display driver configuration */ // LCD_SetSizeEx (0, 480, 272); // LCD_SetVSizeEx (0, 480, 272); // // /* Touch calibration */ // GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 479, 985, 50); // GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 271, 920, 100); // } // else /* GPIX = 0 7 800*480 */ // { // /* Display driver configuration */ // LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); // LCD_SetVSizeEx (0, VXSIZE_PHYS, VYSIZE_PHYS); // // LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR); // // /* Touch calibration */ // // GUI_TOUCH_SetOrientation(0); // GUI_TOUCH_Calibrate(GUI_COORD_X, 0, XSIZE_PHYS - 1, GUI_TOUCH_AD_LEFT, GUI_TOUCH_AD_RIGHT); // GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, YSIZE_PHYS - 1, GUI_TOUCH_AD_TOP, GUI_TOUCH_AD_BOTTOM); // } // } // else // { LCD_SetSizeEx (0, 240, 128); LCD_SetVSizeEx (0, 240, 128); /* Touch calibration */ GUI_TOUCH_Calibrate(GUI_COORD_X, 0, 399, 300, 3600); GUI_TOUCH_Calibrate(GUI_COORD_Y, 0, 239, 273, 3671); // } }
/********************************************************************* * * 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}; // 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); // Orientation Config.Orientation = 0;//GUI_MIRROR_Y | GUI_SWAP_XY; /* swap the x & y */ GUIDRV_FlexColor_Config(pDevice, &Config); // Set controller and operation mode PortAPI.pfWrite16_A0 = LcdWriteReg; /* writes one 16 bit value to the controller with C/D line low */ PortAPI.pfWrite16_A1 = LcdWriteData; PortAPI.pfWriteM16_A1 = LcdWriteDataMultiple; PortAPI.pfReadM16_A1 = LcdReadDataMultiple; /* F66702 supports the drive of ssd 1289 */ GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66702, GUIDRV_FLEXCOLOR_M16C0B16); }
/** Tell emWin the size of the frame buffer */ static void setFrameBufferScreenSize(void) { LCD_SetSizeEx (0, BUFFER_VIRTUAL_WIDTH, DISPLAY_HEIGHT); LCD_SetVSizeEx(0, BUFFER_VIRTUAL_WIDTH, DISPLAY_HEIGHT); }
/** Tell emWin the size of the number buffer */ static void setNumberBufferScreenSize(void) { LCD_SetSizeEx (0, NUMBER_BUFFER_WIDTH, FONT_HEIGHT); LCD_SetVSizeEx(0, NUMBER_BUFFER_WIDTH, FONT_HEIGHT); }