emWin driver GUIDRV_Lin
This driver supports all display controllers with linear video memory accessible via direct interface. It can be used with
and without a display controller. The driver does only manage the contents of the video memory. It does not send any
commands to the display controller or assumes any specific registers. So it is independent of the register interface of
the display controller and can be used for managing each linear mapped video memory.
Color depth and display orientation
The driver consists of several files. They are named GUIDRV_Lin_[O]_BPP.c. where the optional ’O’ stands for the
desired display orientation and ’BPP’ for the the color depth. The following table shows the driver files and the configuration
macros which should be used to create and link the driver during the initialization:
| Display driver | Identifier | Color depth and orientation |
|---|---|---|
| GUIDRV_Lin_1.c | GUIDRV_LIN_1 | 1bpp, default orientation |
| GUIDRV_Lin_2.c | GUIDRV_LIN_2 | 2bpp, default orientation |
| GUIDRV_Lin_4.c | GUIDRV_LIN_4 | 4bpp, default orientation |
| GUIDRV_Lin_8.c | GUIDRV_LIN_8 | 8bpp, default orientation |
| GUIDRV_Lin_16.c | GUIDRV_LIN_16 | 16bpp, default orientation |
| GUIDRV_Lin_OX_16.c | GUIDRV_LIN_OX_16 | 16bpp, X axis mirrored |
| GUIDRV_Lin_OY_16.c | GUIDRV_LIN_OY_16 | 16bpp, Y axis mirrored |
| GUIDRV_Lin_OS_16.c | GUIDRV_LIN_OS_16 | 16bpp, X and Y swapped |
| GUIDRV_Lin_OSX_16.c | GUIDRV_LIN_OSX_16 | 16bpp, X axis mirrored, X and Y swapped |
| GUIDRV_Lin_OSY_16.c | GUIDRV_LIN_OSY_16 | 16bpp, Y axis mirrored, X and Y swapped |
| GUIDRV_Lin_24.c | GUIDRV_LIN_24 | 24bpp, default orientation |
| GUIDRV_Lin_OX_24.c | GUIDRV_LIN_OX_24 | 24bpp, X axis mirrored |
| GUIDRV_Lin_OY_24.c | GUIDRV_LIN_OY_24 | 24bpp, Y axis mirrored |
| GUIDRV_Lin_OS_24.c | GUIDRV_LIN_OS_24 | 24bpp, X and Y swapped |
| GUIDRV_Lin_OSX_24.c | GUIDRV_LIN_OSX_24 | 24bpp, X axis mirrored, X and Y swapped |
| GUIDRV_Lin_OSY_24.c | GUIDRV_LIN_OSY_24 | 24bpp, Y axis mirrored, X and Y swapped |
| GUIDRV_Lin_32.c | GUIDRV_LIN_32 | 32bpp, default orientation |
| GUIDRV_Lin_OX_32.c | GUIDRV_LIN_OX_32 | 32bpp, X axis mirrored |
| GUIDRV_Lin_OY_32.c | GUIDRV_LIN_OY_32 | 32bpp, Y axis mirrored |
| GUIDRV_Lin_OS_32.c | GUIDRV_LIN_OS_32 | 32bpp, X and Y swapped |
| GUIDRV_Lin_OSX_32.c | GUIDRV_LIN_OSX_32 | 32bpp, X axis mirrored, X and Y swapped |
| GUIDRV_Lin_OSY_32.c | GUIDRV_LIN_OSY_32 | 32bpp, Y axis mirrored, X and Y swapped |
The table above does not show each possible combination of orientation and color depth. But it should make clear
how the right driver can be selected. Each combination of orientation and color depth is possible. Note that currently
not all combinations are shipped with the driver. If the required combination is not available, contact support.
Supported hardware
Controllers
The driver supports all systems with linear mapped video memory.
Bits per pixel
Supported color depths are 1, 2, 4, 8, 16, 24 and 32 bits per pixel.
Interfaces
The driver supports a direct bus interface from the CPU to the video memory. The video memory needs to be accessible
8, 16 and 32 bit wise.
Display data RAM organization

The picture above shows the relation between the display memory and the pixels of the LCD in terms of the color depth
and the endian mode.
Little endian video mode
Least significant bits are used and output first. The least significant bits are for the first (left-most) pixel.
Big endian video mode
Most significant bits are used and output first. The most significant bits are for the first (left-most) pixel.
RAM requirements of the driver
None.
Additional callback commands
None.
Available configuration macros (compile time configuration)
The following table lists the macros which must be defined for hardware access:
| Macro | Description |
|---|---|
| LCD_ENDIAN_BIG | Should be set to 1 for big endian mode, 0 (default) for little endian mode. |
Available configuraion routines (run-time configuration)
The following table lists the available run-time configuration routines:
| Routine | Description |
|---|---|
| LCD_SetSizeEx() | Changes the size of the visible area. |
| LCD_SetVRAMAddrEx() | Changes the video RAM start address. |
| LCD_SetVSizeEx() | Changes the size of the virtual display area. |
Configuration example
The following shows how to create a display driver device with this driver and how to configure it:
void LCD_X_Config(void) {
//
// Set display driver and color conversion
//
GUI_DEVICE_CreateAndLink(GUIDRV_LIN_8, // Display driver
GUICC_8666, // Color conversion
0, 0);
//
// Display driver configuration
//
LCD_SetSizeEx (0, 320, 240); // Physical display size in pixels
LCD_SetVSizeEx (0, 320, 480); // Virtual display size in pixels
LCD_SetVRAMAddrEx(0, (void *)0x20000000); // Video RAM start address
}
Additional driver functions
None
GUIDRV_Lin
Head office Germany
US office 
