/********************************************************************* * * LCD_X_DisplayDriver * * Purpose: * This function is called by the display driver for several purposes. * To support the according task the routine needs to be adapted to * the display controller. Please note that the commands marked with * 'optional' are not cogently required and should only be adapted if * the display controller supports these features. * * Parameter: * LayerIndex - Index of layer to be configured * Cmd - Please refer to the details in the switch statement below * pData - Pointer to a LCD_X_DATA structure * * Return Value: * < -1 - Error * -1 - Command not handled * 0 - Ok */ int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) { int r; (void) LayerIndex; (void) pData; switch (Cmd) { // // Required // 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... // // ... _InitController(); return 0; } default: r = -1; } return r; }
/********************************************************************* * * LCD_X_DisplayDriver * * Purpose: * This function is called by the display driver for several purposes. * To support the according task the routine needs to be adapted to * the display controller. Please note that the commands marked with * 'optional' are not cogently required and should only be adapted if * the display controller supports these features. * * Parameter: * LayerIndex - Index of layer to be configured * Cmd - Please refer to the details in the switch statement below * pData - Pointer to a LCD_X_DATA structure * * Return Value: * < -1 - Error * -1 - Command not handled * 0 - Ok */ int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) { int r; LCD_X_SETORG_INFO * pSetOrg; (void) LayerIndex; switch (Cmd) { // // Required // 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... // // ... _InitController(0); return 0; case LCD_X_SETORG: // // Required for setting the display origin which is passed in the 'xPos' and 'yPos' element of p // pSetOrg = (LCD_X_SETORG_INFO *)pData; _SetDisplayOrigin(pSetOrg->xPos, pSetOrg->yPos); return 0; default: r = -1; } return r; }
/********************************************************************* * * 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, required for Lin-driver // _InitController(0); LCD_SetPosEx (0, 0, 0); if (LCD_GetSwapXYEx(0)) { 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); } LCD_SetVRAMAddrEx(0, (void*)VRAM_ADDR_VIRT); // // Set user palette data (only required if no fixed palette is used) // #if defined(PALETTE) LCD_SetLUTEx(0, PALETTE); #endif }
/********************************************************************* * * LCD_X_DisplayDriver * * Purpose: * This function is called by the display driver for several purposes. * To support the according task the routine needs to be adapted to * the display controller. Please note that the commands marked with * 'optional' are not cogently required and should only be adapted if * the display controller supports these features. * * Parameter: * LayerIndex - Index of layer to be configured * Cmd - Please refer to the details in the switch statement below * pData - Pointer to a LCD_X_DATA structure * * Return Value: * < -1 - Error * -1 - Command not handled * 0 - Ok */ int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) { int r; switch (Cmd) { case LCD_X_INITCONTROLLER: { if (LayerIndex == 0) { _InitController(); } return 0; } default: r = -1; } return r; }
/********************************************************************* * * LCD_X_DisplayDriver * * Purpose: * This function is called by the display driver for several purposes. * To support the according task the routine needs to be adapted to * the display controller. Please note that the commands marked with * 'optional' are not cogently required and should only be adapted if * the display controller supports these features. * * Parameter: * LayerIndex - Index of layer to be configured * Cmd - Please refer to the details in the switch statement below * pData - Pointer to a LCD_X_DATA structure * * Return Value: * < -1 - Error * -1 - Command not handled * 0 - Ok */ int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) { int r; LCD_X_SETORG_INFO * pSetOrg; (void) LayerIndex; switch (Cmd) { // // Required // case LCD_X_INITCONTROLLER: _InitController(0); return 0; case LCD_X_SETORG: pSetOrg = (LCD_X_SETORG_INFO *)pData; _SetDisplayOrigin(pSetOrg->xPos, pSetOrg->yPos); return 0; default: r = -1; } return r; }
/********************************************************************* * * LCD_X_DisplayDriver * * Purpose: * This function is called by the display driver for several purposes. * To support the according task the routine needs to be adapted to * the display controller. Please note that the commands marked with * 'optional' are not cogently required and should only be adapted if * the display controller supports these features. * * Parameter: * LayerIndex - Index of layer to be configured * Cmd - Please refer to the details in the switch statement below * pData - Pointer to a LCD_X_DATA structure * * Return Value: * < -1 - Error * -1 - Command not handled * 0 - Ok */ int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) { int r; (void)LayerIndex; /* Unused parameter */ switch (Cmd) { // // Required // 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... // _InitController(); return 0; } case LCD_X_SETVRAMADDR: { // // Required for setting the address of the video RAM for drivers // with memory mapped video RAM which is passed in the 'pVRAM' element of p // LCD_X_SETVRAMADDR_INFO * p; p = (LCD_X_SETVRAMADDR_INFO *)pData; _SetVRAMAddr(p->pVRAM); return 0; } case LCD_X_SETORG: { // // Required for setting the display origin which is passed in the 'xPos' and 'yPos' element of p // LCD_X_SETORG_INFO * p; p = (LCD_X_SETORG_INFO *)pData; _SetOrg(p->xPos, p->yPos); return 0; } case LCD_X_SETLUTENTRY: { // // Required for setting a lookup table entry which is passed in the 'Pos' and 'Color' element of p // LCD_X_SETLUTENTRY_INFO * p; p = (LCD_X_SETLUTENTRY_INFO *)pData; _SetLUTEntry(p->Color, p->Pos); return 0; } case LCD_X_ON: { // // Required if the display controller should support switching on and off // return 0; } case LCD_X_OFF: { // // Required if the display controller should support switching on and off // // ... return 0; } /* This command is received every time the GUI is done drawing a frame */ case LCD_X_SHOWBUFFER: { /* Get the data object */ // LCD_X_SHOWBUFFER_INFO * p; // p = (LCD_X_SHOWBUFFER_INFO *)pData; } default: r = -1; } return r; }