emWin driver GUIDRV_SLin

Supported hardware

Controllers

The driver works with the following display controllers:

  • Epson S1D13700
  • Solomon SSD1848
  • Toshiba T6963
  • Ultrachip UC1617

Bits per pixel

Supported color depth is 1 and 2 bits per pixel. Please note that the Ultrachip UC1617 controller does not support
the 1bpp mode.

Interfaces

The driver supports the 8 bit indirect interface.

Display data RAM organization


Additional RAM-requirement

This display driver may be used with or without a display data cache, containing a complete copy of the LCD data RAM.
If a cache is not used, there are no additional RAM requirements. It is recommended to use this driver with a data
cache for faster LCD-access. The amount of memory used by the cache may be calculated as follows:

Size of RAM (in bytes) = BitsPerPixel * (LCD_XSIZE + 7) / 8 * LCD_YSIZE

Additional run-time configuration

The table below shows the available run-time configuration routines of this driver:

Routine Explanation
GUIDRV_SLin_Config Passes a pointer to a CONFIG_SLIN structure to the driver.
GUIDRV_SLin_SetS1D13700 Tells the driver to use an Epson S1D13700 controller.
GUIDRV_SLin_SetSSD1848 Tells the driver to use a Solomon SSD1848 controller.
GUIDRV_SLin_SetT6963 Tells the driver to use a Toshiba T6963 controller.
GUIDRV_SLin_SetUC1617 Tells the driver to use an Ultrachip UC1617 controller.

GUIDRV_SLin_Config()

Description

Passes a pointer to a CONFIG_SLIN structure to the driver.

Prototype

void GUIDRV_SLin_Config(GUI_DEVICE * pDevice, CONFIG_SLIN * pConfig);
Parameter Description
pDevice Pointer to the driver device.
pConfig Pointer to a CONFIG_SLIN structure described below.

Elements of CONFIG_SLIN

Data type Element Description
int FirstSEG First segment address to be used in the data RAM of the display controller.
The value can be determined experimentally or taken from
the display documentation. The value is normally 0.
int FirstCOM First common address to be used in the data RAM of the display controller.
The value can be determined experimentally or taken from
the display documentation. The value is normally 0.
int UseCache Enables or disables use of a data cache. Should be set to 1 for
enabling and to 0 for disabling.
int UseMirror Only used with SSD1848. Should be normally 1.

GUIDRV_SLin_SetBus8()

Description

Tells the driver to use the 8 Bus indirect interface and passes a pointer to a GUI_PORT_API structure to the driver
containing function pointers to the hardware routines to be used.

Prototype

void GUIDRV_SLin_SetBus8(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API);
Parameter Description
pDevice Pointer to the driver device.
pHW_API Pointer to a GUI_PORT_API structure explained below.

Elements of GUI_PORT_API

Data type Element Description
void (*)(U8 Data) pfWrite8_A0

Pointer to a function which writes one byte
to the controller with C/D line low.

void (*)(U8 Data) pfWrite8_A1 Pointer to a function which writes one byte
to the controller with C/D line high.
void (*)(U8 Data, int NumItems) pfWriteM8_A0 Pointer to a function which writes multiple bytes
to the controller with C/D line low.
void (*)(U8 Data, int NumItems) pfWriteM8_A1 Pointer to a function which writes multiple bytes
to the controller with C/D line high.
void (*)(void) pfRead8_A1 Pointer to a function which reads one byte
from the controller with C/D line high.

GUIDRV_SLin_SetS1D13700()

Description

Tells the driver that an Epson S1D13700 controller should be used.

Prototype

void GUIDRV_SLin_SetS1D13700(GUI_DEVICE * pDevice);
Parameter Description
pDevice Pointer to the driver device.

GUIDRV_SLin_SetSSD1848()

Description

Tells the driver that a Solomon SSD1848 controller should be used.

Prototype

void GUIDRV_SLin_SetSSD1848(GUI_DEVICE * pDevice);
Parameter Description
pDevice Pointer to the driver device.

GUIDRV_SLin_SetT6963()

Description

Tells the driver that a Toshiba T6963 controller should be used.

Prototype

void GUIDRV_SLin_SetT6963(GUI_DEVICE * pDevice);
Parameter Description
pDevice Pointer to the driver device.

GUIDRV_SLin_SetUC1617()

Description

Tells the driver that an Ultrachip UC1617 controller should be used.

Prototype

void GUIDRV_SLin_SetUC1617(GUI_DEVICE * pDevice);
Parameter Description
pDevice Pointer to the driver device.

Configuration Example

#define XSIZE 320
#define YSIZE 240

void LCD_X_Config(void) {
  GUI_DEVICE   * pDevice;
  CONFIG_SLIN    Config   = {0};
  GUI_PORT_API   PortAPI  = {0};

  //
  // 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);
  //
  // Driver specific configuration
  //
  Config.UseCache = 1;
  GUIDRV_SLin_Config(pDevice, &Config);
  //
  // Select display controller
  //
  GUIDRV_SLin_SetS1D13700(pDevice);
  //
  // Setup hardware access routines
  //
  PortAPI.pfWrite16_A0  = _Write0;
  PortAPI.pfWrite16_A1  = _Write1;
  PortAPI.pfWriteM16_A0 = _WriteM0;
  PortAPI.pfRead16_A1   = _Read1;
  GUIDRV_SLin_SetBus8(pDevice, &PortAPI);
}