STM32CubeF7/Projects/WIN32/STemWin_Simulation/Config/LCDConf.c

150 lines
5.4 KiB
C

/*********************************************************************
* SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2017 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.40 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
Licensing information
Licensor: SEGGER Software GmbH
Licensed to: STMicroelectronics International NV, 39, Chemin du Champ-des Filles, 1228 Plan Les Ouates, Geneva, SWITZERLAND
Licensed SEGGER software: emWin
License number: GUI-00429
License model: Buyout SRC [Buyout Source Code License, signed November 29th 2012]
Licensed product: -
Licensed platform: STMs ARM Cortex-M based 32 BIT CPUs
Licensed number of seats: -
----------------------------------------------------------------------
Support and Update Agreement (SUA)
SUA period: 2012-12-07 - 2017-12-31
Contact to extend SUA: sales@segger.com
----------------------------------------------------------------------
File : LCDConf.c
Purpose : Display controller configuration (single layer)
---------------------------END-OF-HEADER------------------------------
*/
#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 ****************************/