/*********************************************************************
* SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.26 - 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 ARM LIMITED whose registered office
is situated at 110 Fulbourn Road, Cambridge CB1 9NJ, England solely
for the purposes of creating libraries for ARM7, ARM9, Cortex-M
series, and Cortex-R4 processor-based devices, sublicensed and
distributed as part of the MDK-ARM Professional under the terms and
conditions of the End User License supplied with the MDK-ARM
Professional.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCDConf.c
Purpose : Display controller configuration, sample
/*********************************************************************
*
* _InitController
*
* Purpose:
* Initializes the display controller
*/
static void _InitController(void) {
int i;
LCD_X_Init();
_SetAddr(0);
for (i = 0; i < 100; i++) {
_PortAPI.pfWrite8_A0(0xff);
_PortAPI.pfWrite8_A1(CMD_WRITE1);
}
_SetAddr(0);
for (i = 0; i < LCD_RAMSIZE; i++) {
_PortAPI.pfWrite8_A0(0x0);
_PortAPI.pfWrite8_A1(CMD_WRITE1);
}
_PortAPI.pfWrite8_A1(0x81); // SetModeXor
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* 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;
GUI_USE_PARA(LayerIndex);
GUI_USE_PARA(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...
//
// Nothing done here, see 'LCD_X_ON'.
#ifndef WIN32
_InitController();
#endif
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) {
GUI_DEVICE * pDevice;
//
// Set display driver and color conversion
//
pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
//
// Common display driver configuration
//
LCD_SetSizeEx(0, XSIZE, YSIZE);
LCD_SetVSizeEx(0, XSIZE, YSIZE);
//
// Set driver specific configuration items
//
#ifndef WIN32
{
CONFIG_SLIN Config = {0};