#include "GUI.h"
/*********************************************************************
*
* Layer configuration (to be modified)
*
**********************************************************************
*/
//
// Physical display size
// The display size should be adapted in order to match the size of
// the target display.
//
#define XSIZE_PHYS 480
#define YSIZE_PHYS 272
//
// Color conversion
// The color conversion functions should be selected according to
// the color mode of the target display. Detaileds can be found in
// the chapter "Colors" in the emWin user manual.
//
#define COLOR_CONVERSION GUICC_8888
//
// Display driver
// GUIDRV_WIN32 is for use only within the emWin Simulation
// environment. In order to use the target display controller, the
// according emWin display driver should be configured as it is
// described in the chapter "Display Drivers" in the emWin user
// manual. Beyond that sample configuration files can be found in
// The folder "Sample\LCDConf\%DISPLAY_DRIVER%\".
//
#define DISPLAY_DRIVER GUIDRV_WIN32
/*********************************************************************
*
* Configuration checking
*
**********************************************************************
*/
#ifndef XSIZE_PHYS
#error Physical X size of display is not defined!
#endif
#ifndef YSIZE_PHYS
#error Physical Y size of display is not defined!
#endif
#ifndef COLOR_CONVERSION
#error Color conversion not defined!
#endif
#ifndef DISPLAY_DRIVER
#error No display driver defined!
#endif
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* LCD_X_Config
*
* Function description
* 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
//
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_X_DisplayDriver
*
* Function description
* Display driver callback function. This function is called by the
* Display driver for certain purposes. Using GUIDRV_Win32 it is not
* required to react to any command.
*/
int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
GUI_USE_PARA(LayerIndex);
GUI_USE_PARA(Cmd);
GUI_USE_PARA(pData);
return 0;
}
/*************************** End of file ****************************/
/*********************************************************************
*
* Layer configuration (to be modified)
*
**********************************************************************
*/
//
// Physical display size
// The display size should be adapted in order to match the size of
// the target display.
//
#define XSIZE_PHYS 480
#define YSIZE_PHYS 272
//
// Color conversion
// The color conversion functions should be selected according to
// the color mode of the target display. Detaileds can be found in
// the chapter "Colors" in the emWin user manual.
//
#define COLOR_CONVERSION GUICC_8888
//
// Display driver
// GUIDRV_WIN32 is for use only within the emWin Simulation
// environment. In order to use the target display controller, the
// according emWin display driver should be configured as it is
// described in the chapter "Display Drivers" in the emWin user
// manual. Beyond that sample configuration files can be found in
// The folder "Sample\LCDConf\%DISPLAY_DRIVER%\".
//
#define DISPLAY_DRIVER GUIDRV_WIN32
/*********************************************************************
*
* Configuration checking
*
**********************************************************************
*/
#ifndef XSIZE_PHYS
#error Physical X size of display is not defined!
#endif
#ifndef YSIZE_PHYS
#error Physical Y size of display is not defined!
#endif
#ifndef COLOR_CONVERSION
#error Color conversion not defined!
#endif
#ifndef DISPLAY_DRIVER
#error No display driver defined!
#endif
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* LCD_X_Config
*
* Function description
* 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
//
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_X_DisplayDriver
*
* Function description
* Display driver callback function. This function is called by the
* Display driver for certain purposes. Using GUIDRV_Win32 it is not
* required to react to any command.
*/
int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
GUI_USE_PARA(LayerIndex);
GUI_USE_PARA(Cmd);
GUI_USE_PARA(pData);
return 0;
}
/*************************** End of file ****************************/
Комментариев нет:
Отправить комментарий