Hardware Low Level Operation for Graphic Display Manager


Functions

void _gdm_hw_set_side (gdm_display *dp, unsigned short side)
void _gdm_hw_set_y (gdm_display *dp, unsigned short y)
void _gdm_hw_set_x (gdm_display *dp, unsigned short x)
void _gdm_hw_set_data (gdm_display *dp, unsigned char data)
void _gdm_hw_set_line (gdm_display *dp, unsigned short line)
void _gdm_hw_set_mode (gdm_display *dp, unsigned short mode)

Detailed Description

The hardware low level operations must be provided by the BSP to access the LCD hardware. They are very basic operations that in general just write one LCD hardware register. They should be inline if possible.

When porting the Graphic Display Manager to a new board, you must provide the following API:

_gdm_hw_set_side
is used to select the KS0108 driver. This operation is called by GDM before setting X, Y or writing a data to the LCD DDRAM. The library optimizes calls to avoid changing the KS0108 driver if the correct driver was previously selected.

_gdm_hw_set_y
is used to set the Y register of the KS0108 driver. This is called before writing a data to the LCD DDRAM. It is assumed that the Y register is automatically incremented after each read/write operation in DDRAM.

_gdm_hw_set_x
is used to set the X register of the KS0108 driver. This is called before writing the Y register and the data to the LCD RAM. The library optimizes calls to to avoid changing the X register when it has the correct value already.

_gdm_hw_set_data
is used to write a byte in the LCD DDRAM at the current X, Y register.

_gdm_hw_set_mode
is used to enable/disble the display, hide/show the backlight LED.

Function Documentation

void _gdm_hw_set_data gdm_display   dp,
unsigned char    data
[inline]
 

Send data to the LCD graphics DDRAM.

This function is board specific. It must write the data value to the LCD graphics DDRAM. The data is written at the current X, Y position set by _gdm_hw_set_x and _gdm_hw_set_y. The Y register is assumed to be incremented after each data write.

Parameters:
dp  Display Manager
data  Data byte to write

Definition at line 102 of file gdm.h.

void _gdm_hw_set_line gdm_display   dp,
unsigned short    line
[inline]
 

Setup the start line of the display data.

This function is board specific. It must set the start line of the KS0108 driver to the value specified in line.

Parameters:
dp  Display Manager
line  Start line to display on top of LCD side (0..63)

Definition at line 114 of file gdm.h.

void _gdm_hw_set_mode gdm_display   dp,
unsigned short    mode
[inline]
 

Setup the display mode and backlight.

This function is board specific. The mode parameter controls some modes provided by the graphics display:

GDM_DISPLAY_ON When this flag is set, the graphics LCD display is on. GDM_BACKLIGHT_ON When this flag is set the backlight LED must be switched on.

Parameters:
dp  Display Manager
mode  Control mode

Definition at line 131 of file gdm.h.

References GDM_DISPLAY_ON.

void _gdm_hw_set_side gdm_display   dp,
unsigned short    side
[inline]
 

Set the active side of the LCD controller.

This function is board specific. The 128x64 display has two drivers. The left driver is selected when @side is 0. The right driver is selected when @side is 1.

Parameters:
dp  Display Manager
side  Left or right side of the LCD display

Definition at line 55 of file gdm.h.

void _gdm_hw_set_x gdm_display   dp,
unsigned short    x
[inline]
 

Set the LCD graphics hardware X register.

This function is board specific. It must set the X register of the KS0108 driver to the value x. The value passed is guarranteed to be in the range 0 .. GDM_WIDTH / 2 * 8 that is 0 .. 7.

Parameters:
dp  Display Manager
x  X register value (0..7)

Definition at line 87 of file gdm.h.

void _gdm_hw_set_y gdm_display   dp,
unsigned short    y
[inline]
 

Set the LCD graphics hardware Y register.

This function is board specific. It must set the Y register of the KS0108 driver to the value y. The Y register is assumed to be incremented after each data write. The value passed is guarranteed to be in the range 0 .. GDM_HEIGHT that is 0 .. 63.

Parameters:
dp  Display Manager
y  Y register value (0..63)

Definition at line 73 of file gdm.h.