PIC18 LaurTec Library  3.3.1
Open Source C Library for PIC18 Microcontrollers based on C18 - XC8 Compilers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
GLCD_KS0108B.h File Reference
#include <ctype.h>
#include <delays.h>
#include <delay.h>

Go to the source code of this file.

Macros

#define NOP_DELAY   Delay1TCY()
 
#define GLCD_DATA_WRITE   LATD
 
#define GLCD_DATA_READ   PORTD
 
#define GLCD_DATA_DIRECTION   TRISD
 
#define GLCD_D_I   LATAbits.LATA3
 
#define GLCD_R_W   LATAbits.LATA4
 
#define GLCD_E   LATAbits.LATA5
 
#define GLCD_CS1   LATEbits.LATE0
 
#define GLCD_CS2   LATEbits.LATE1
 
#define GLCD_RST   LATEbits.LATE2
 
#define GLCD_LED   LATCbits.LATC1
 
#define GLCD_INPUT   0xFF
 
#define GLCD_OUTPUT   0x00
 
#define GLCD_NUMBER_OF_PAGES   8
 
#define GLCD_X_RESOLUTION   128
 
#define GLCD_Y_RESOLUTION   64
 
#define GLCD_CONTROLLER_MAX_X   64
 
#define GLCD_ENABLE_FONT_5x7
 
#define GLCD_ENABLE_LOGO_1
 
#define GLCD_FONT_WIDTH_5   5
 
#define GLCD_FONT_HEIGTH_7   7
 
#define GLCD_FONT_SPACE   1
 
#define GLCD_COMM_DISPLAY_ON   0b00111111
 
#define GLCD_COMM_DISPLAY_OFF   0b00111110
 
#define GLCD_COMM_PAGE_SELECT   0b10111000
 
#define GLCD_COMM_ADDRESS_SELECT   0b01000000
 
#define GLCD_COMM_START_LINE   0b11000000
 
#define GLCD_BUSY_FLAG   0x80
 
#define TURN_ON_LED_GLCD   0b00000001
 
#define TURN_OFF_LED_GLCD   0b00000000
 
#define GLCD_TURN_ON_LED   0b00000001
 
#define GLCD_TURN_OFF_LED   0b00000000
 
#define TURN_ON_DISPLAY   0b00000001
 
#define TURN_OFF_DISPLAY   0b00000000
 
#define GLCD_TURN_ON_DISPLAY   0b00000001
 
#define GLCD_TURN_OFF_DISPLAY   0b00000000
 
#define HIGH_GLCD   0b00000001
 
#define LOW_GLCD   0b00000000
 
#define GLCD_HIGH   0b00000001
 
#define GLCD_LOW   0b00000000
 
#define ENABLE_GLCD   0b00000001
 
#define DISABLE_GLCD   0b00000000
 
#define GLCD_ENABLE   0b00000001
 
#define GLCD_DISABLE   0b00000000
 
#define ENABLE_RESET_GLCD   0b00000000
 
#define DISABLE_RESET_GLCD   0b00000001
 
#define GLCD_ENABLE_RESET   0b00000000
 
#define GLCD_DISABLE_RESET   0b00000001
 
#define GLCD_CHIP_SELECT_1   0x00
 
#define GLCD_CHIP_SELECT_2   0x01
 
#define FILLING_WHITE   0x00
 
#define FILLING_BLACK   0xFF
 
#define GLCD_FILLING_WHITE   0x00
 
#define GLCD_FILLING_BLACK   0xFF
 
#define initialize_GLCD   GLCD_initialize
 
#define clear_GLCD   GLCD_clear
 
#define backlight_GLCD   GLCD_backlight
 
#define set_display_GLCD   GLCD_set_display
 
#define set_vertical_offset_GLCD   GLCD_set_vertical_offset
 
#define plot_xy_GLCD   GLCD_plot_xy
 
#define draw_horizontal_line_GLCD   GLCD_draw_horizontal_line
 
#define draw_vertical_line_GLCD   GLCD_draw_vertical_line
 
#define draw_window_GLCD   GLCD_draw_window
 
#define draw_box_GLCD   GLCD_draw_box
 
#define draw_picture_GLCD   GLCD_draw_picture
 
#define write_char_GLCD   GLCD_write_char
 
#define write_string_GLCD   GLCD_write_string
 
#define write_message_GLCD   GLCD_write_message
 
#define write_integer_GLCD   GLCD_write_integer
 
#define set_font_GLCD   GLCD_set_font
 
#define wait_busy_status_GLCD   GLCD_wait_busy_status
 
#define get_controller_status_GLCD   GLCD_get_controller_status
 
#define write_command_GLCD   GLCD_write_command
 
#define set_page_GLCD   GLCD_set_page
 
#define set_address_GLCD   GLCD_set_address
 
#define write_data_GLCD   GLCD_write_data
 
#define read_data_GLCD   GLCD_read_data
 

Functions

void GLCD_initialize (void)
 
void GLCD_clear (unsigned char filling_color)
 
void GLCD_backlight (unsigned char backlight)
 
void GLCD_set_display (unsigned char display_status)
 
void GLCD_set_vertical_offset (unsigned char vertical_offset)
 
void GLCD_plot_xy (unsigned char x_pos, unsigned char y_pos, unsigned char filling_color)
 
void GLCD_draw_horizontal_line (unsigned char x_origin, unsigned char y_origin, unsigned char length, unsigned char filling_color)
 
void GLCD_draw_vertical_line (unsigned char x_origin, unsigned char y_origin, unsigned char length, unsigned char filling_color)
 
void GLCD_draw_window (unsigned char x_origin, unsigned char y_origin, unsigned char length, unsigned char height, unsigned char filling_color)
 
void GLCD_draw_box (unsigned char x_origin, unsigned char y_origin, unsigned char length, unsigned char height, unsigned char filling_color)
 
void GLCD_draw_picture (rom unsigned char *picture_table)
 
void GLCD_write_char (unsigned char x_pos, unsigned char y_pos, unsigned char character)
 
void GLCD_write_string (unsigned char x_pos, unsigned char y_pos, unsigned char *character_array)
 
void GLCD_write_message (unsigned char x_pos, unsigned char y_pos, const rom unsigned char *character)
 
void GLCD_write_integer (unsigned char x_pos, unsigned char y_pos, int value, char number_of_digits)
 
void GLCD_set_font (unsigned char width, unsigned char height)
 
void GLCD_wait_busy_status (void)
 
unsigned char GLCD_get_controller_status (void)
 
void GLCD_write_command (unsigned char command_to_send)
 
void GLCD_set_page (unsigned char controller_page)
 
void GLCD_set_address (unsigned char controller_address)
 
void GLCD_write_data (unsigned char data_to_send)
 
unsigned char GLCD_read_data (void)
 

Variables

rom unsigned char font_5x7 [96][5]
 
rom unsigned char logo_1 []
 

Macro Definition Documentation

#define backlight_GLCD   GLCD_backlight

Definition at line 220 of file GLCD_KS0108B.h.

#define clear_GLCD   GLCD_clear

Definition at line 206 of file GLCD_KS0108B.h.

#define DISABLE_GLCD   0b00000000

Definition at line 159 of file GLCD_KS0108B.h.

#define DISABLE_RESET_GLCD   0b00000001

Definition at line 164 of file GLCD_KS0108B.h.

#define draw_box_GLCD   GLCD_draw_box

Definition at line 350 of file GLCD_KS0108B.h.

#define draw_horizontal_line_GLCD   GLCD_draw_horizontal_line

Definition at line 283 of file GLCD_KS0108B.h.

#define draw_picture_GLCD   GLCD_draw_picture

Definition at line 369 of file GLCD_KS0108B.h.

#define draw_vertical_line_GLCD   GLCD_draw_vertical_line

Definition at line 304 of file GLCD_KS0108B.h.

#define draw_window_GLCD   GLCD_draw_window

Definition at line 327 of file GLCD_KS0108B.h.

#define ENABLE_GLCD   0b00000001

Definition at line 158 of file GLCD_KS0108B.h.

#define ENABLE_RESET_GLCD   0b00000000

Definition at line 163 of file GLCD_KS0108B.h.

#define FILLING_BLACK   0xFF

Definition at line 172 of file GLCD_KS0108B.h.

#define FILLING_WHITE   0x00

Definition at line 171 of file GLCD_KS0108B.h.

#define get_controller_status_GLCD   GLCD_get_controller_status

Definition at line 491 of file GLCD_KS0108B.h.

#define GLCD_BUSY_FLAG   0x80

Definition at line 135 of file GLCD_KS0108B.h.

#define GLCD_CHIP_SELECT_1   0x00

Definition at line 168 of file GLCD_KS0108B.h.

#define GLCD_CHIP_SELECT_2   0x01

Definition at line 169 of file GLCD_KS0108B.h.

#define GLCD_COMM_ADDRESS_SELECT   0b01000000

Definition at line 126 of file GLCD_KS0108B.h.

#define GLCD_COMM_DISPLAY_OFF   0b00111110

Definition at line 122 of file GLCD_KS0108B.h.

#define GLCD_COMM_DISPLAY_ON   0b00111111

Definition at line 121 of file GLCD_KS0108B.h.

#define GLCD_COMM_PAGE_SELECT   0b10111000

Definition at line 124 of file GLCD_KS0108B.h.

#define GLCD_COMM_START_LINE   0b11000000

Definition at line 128 of file GLCD_KS0108B.h.

#define GLCD_CONTROLLER_MAX_X   64

Definition at line 96 of file GLCD_KS0108B.h.

#define GLCD_CS1   LATEbits.LATE0

Definition at line 80 of file GLCD_KS0108B.h.

#define GLCD_CS2   LATEbits.LATE1

Definition at line 81 of file GLCD_KS0108B.h.

#define GLCD_D_I   LATAbits.LATA3

Definition at line 77 of file GLCD_KS0108B.h.

#define GLCD_DATA_DIRECTION   TRISD

Definition at line 75 of file GLCD_KS0108B.h.

#define GLCD_DATA_READ   PORTD

Definition at line 74 of file GLCD_KS0108B.h.

#define GLCD_DATA_WRITE   LATD

Definition at line 73 of file GLCD_KS0108B.h.

#define GLCD_DISABLE   0b00000000

Definition at line 161 of file GLCD_KS0108B.h.

#define GLCD_DISABLE_RESET   0b00000001

Definition at line 166 of file GLCD_KS0108B.h.

#define GLCD_E   LATAbits.LATA5

Definition at line 79 of file GLCD_KS0108B.h.

#define GLCD_ENABLE   0b00000001

Definition at line 160 of file GLCD_KS0108B.h.

#define GLCD_ENABLE_FONT_5x7

Definition at line 103 of file GLCD_KS0108B.h.

#define GLCD_ENABLE_LOGO_1

Definition at line 105 of file GLCD_KS0108B.h.

#define GLCD_ENABLE_RESET   0b00000000

Definition at line 165 of file GLCD_KS0108B.h.

#define GLCD_FILLING_BLACK   0xFF

Definition at line 174 of file GLCD_KS0108B.h.

#define GLCD_FILLING_WHITE   0x00

Definition at line 173 of file GLCD_KS0108B.h.

#define GLCD_FONT_HEIGTH_7   7

Definition at line 112 of file GLCD_KS0108B.h.

#define GLCD_FONT_SPACE   1

Definition at line 114 of file GLCD_KS0108B.h.

#define GLCD_FONT_WIDTH_5   5

Definition at line 111 of file GLCD_KS0108B.h.

#define GLCD_HIGH   0b00000001

Definition at line 155 of file GLCD_KS0108B.h.

#define GLCD_INPUT   0xFF

Definition at line 89 of file GLCD_KS0108B.h.

#define GLCD_LED   LATCbits.LATC1

Definition at line 83 of file GLCD_KS0108B.h.

#define GLCD_LOW   0b00000000

Definition at line 156 of file GLCD_KS0108B.h.

#define GLCD_NUMBER_OF_PAGES   8

Definition at line 92 of file GLCD_KS0108B.h.

#define GLCD_OUTPUT   0x00

Definition at line 90 of file GLCD_KS0108B.h.

#define GLCD_R_W   LATAbits.LATA4

Definition at line 78 of file GLCD_KS0108B.h.

#define GLCD_RST   LATEbits.LATE2

Definition at line 82 of file GLCD_KS0108B.h.

#define GLCD_TURN_OFF_DISPLAY   0b00000000

Definition at line 151 of file GLCD_KS0108B.h.

#define GLCD_TURN_OFF_LED   0b00000000

Definition at line 146 of file GLCD_KS0108B.h.

#define GLCD_TURN_ON_DISPLAY   0b00000001

Definition at line 150 of file GLCD_KS0108B.h.

#define GLCD_TURN_ON_LED   0b00000001

Definition at line 145 of file GLCD_KS0108B.h.

#define GLCD_X_RESOLUTION   128

Definition at line 93 of file GLCD_KS0108B.h.

#define GLCD_Y_RESOLUTION   64

Definition at line 94 of file GLCD_KS0108B.h.

#define HIGH_GLCD   0b00000001

Definition at line 153 of file GLCD_KS0108B.h.

#define initialize_GLCD   GLCD_initialize

Definition at line 194 of file GLCD_KS0108B.h.

#define LOW_GLCD   0b00000000

Definition at line 154 of file GLCD_KS0108B.h.

#define NOP_DELAY   Delay1TCY()

Definition at line 58 of file GLCD_KS0108B.h.

#define plot_xy_GLCD   GLCD_plot_xy

Definition at line 262 of file GLCD_KS0108B.h.

#define read_data_GLCD   GLCD_read_data

Definition at line 560 of file GLCD_KS0108B.h.

#define set_address_GLCD   GLCD_set_address

Definition at line 534 of file GLCD_KS0108B.h.

#define set_display_GLCD   GLCD_set_display

Definition at line 233 of file GLCD_KS0108B.h.

#define set_font_GLCD   GLCD_set_font

Definition at line 459 of file GLCD_KS0108B.h.

#define set_page_GLCD   GLCD_set_page

Definition at line 520 of file GLCD_KS0108B.h.

#define set_vertical_offset_GLCD   GLCD_set_vertical_offset

Definition at line 245 of file GLCD_KS0108B.h.

#define TURN_OFF_DISPLAY   0b00000000

Definition at line 149 of file GLCD_KS0108B.h.

#define TURN_OFF_LED_GLCD   0b00000000

Definition at line 144 of file GLCD_KS0108B.h.

#define TURN_ON_DISPLAY   0b00000001

Definition at line 148 of file GLCD_KS0108B.h.

#define TURN_ON_LED_GLCD   0b00000001

Definition at line 143 of file GLCD_KS0108B.h.

#define wait_busy_status_GLCD   GLCD_wait_busy_status

Definition at line 478 of file GLCD_KS0108B.h.

#define write_char_GLCD   GLCD_write_char

Definition at line 385 of file GLCD_KS0108B.h.

#define write_command_GLCD   GLCD_write_command

Definition at line 507 of file GLCD_KS0108B.h.

#define write_data_GLCD   GLCD_write_data

Definition at line 546 of file GLCD_KS0108B.h.

#define write_integer_GLCD   GLCD_write_integer

Definition at line 444 of file GLCD_KS0108B.h.

#define write_message_GLCD   GLCD_write_message

Definition at line 426 of file GLCD_KS0108B.h.

#define write_string_GLCD   GLCD_write_string

Definition at line 403 of file GLCD_KS0108B.h.

Function Documentation

void GLCD_backlight ( unsigned char  backlight)

This function turns ON-OFF the GLCD back light.

Parameters
backlightControl the backlight LED. TURN_ON_LED : Backlight is ON TURN_OFF_LED : Backlight is OFF
Returns
void

Definition at line 575 of file GLCD_KS0108B.c.

References GLCD_LED.

void GLCD_clear ( unsigned char  filling_color)

This function clears the display either in black or white color.

Parameters
filling_colorFilling color allows to set the display either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK]
Returns
void

Definition at line 227 of file GLCD_KS0108B.c.

References GLCD_CS1, GLCD_CS2, GLCD_NUMBER_OF_PAGES, GLCD_Y_RESOLUTION, HIGH_GLCD, LOW_GLCD, set_address_GLCD, set_page_GLCD, and write_data_GLCD.

void GLCD_draw_box ( unsigned char  x_origin,
unsigned char  y_origin,
unsigned char  length,
unsigned char  height,
unsigned char  filling_color 
)

This function plots a coloured box either in black or white colour. Origin and length and height can be set by the user.

Parameters
x_originBox X origin [0..127]
y_originBox Y origin [0..63]
lengthBox length.
lengthBox height.
filling_colorFilling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK]
Returns
void
Warning
It is user responsibility to make sure that the window length and height are valid, depending on x_origin, y_origin.

Definition at line 399 of file GLCD_KS0108B.c.

References draw_vertical_line_GLCD.

void GLCD_draw_horizontal_line ( unsigned char  x_origin,
unsigned char  y_origin,
unsigned char  length,
unsigned char  filling_color 
)

This function plots an horizontal line either in black or white colour. Origin and length can be set by the user.

Parameters
x_originLine X origin [0..127].
y_originLine Y origin [0..63].
lengthLine length [0..127].
filling_colorFilling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK]
Returns
void
Warning
It is user responsibility to make sure that the line length is valid, depending on x_origin, y_origin.

Definition at line 367 of file GLCD_KS0108B.c.

References plot_xy_GLCD.

void GLCD_draw_picture ( rom unsigned char *  picture_table)

This function draws a picture with 128x64 resolution.

Parameters
picture_tablePointer to the table containing the picture (stored in flash).
Returns
void

Definition at line 479 of file GLCD_KS0108B.c.

References GLCD_CS1, GLCD_CS2, GLCD_draw_picture(), GLCD_NUMBER_OF_PAGES, GLCD_Y_RESOLUTION, HIGH_GLCD, LOW_GLCD, set_address_GLCD, set_page_GLCD, and write_data_GLCD.

void GLCD_draw_vertical_line ( unsigned char  x_origin,
unsigned char  y_origin,
unsigned char  length,
unsigned char  filling_color 
)

This function plots a vertical line either in black or white colour. Origin and length can be set by the user.

Parameters
x_originLine X origin [0..128].
y_originLine Y origin [0..63].
lengthLine length [0..63].
filling_colorFilling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK]
Returns
void
Warning
It is user responsibility to make sure that the line length is valid, depending on x_origin, y_origin.

Definition at line 354 of file GLCD_KS0108B.c.

References plot_xy_GLCD.

void GLCD_draw_window ( unsigned char  x_origin,
unsigned char  y_origin,
unsigned char  length,
unsigned char  height,
unsigned char  filling_color 
)

This function plots an empty window either with black or white colour borders. Origin and length and height can be set by the user.

Parameters
x_originWindow X origin [0..127].
y_originWindow Y origin [0..63].
lengthWindow length [0..127].
lengthWindow height [0..63].
filling_colorFilling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK]
Returns
void
Warning
It is user responsibility to make sure that the window length and height are valid, depending on x_origin, y_origin.

Definition at line 381 of file GLCD_KS0108B.c.

References draw_horizontal_line_GLCD, and draw_vertical_line_GLCD.

unsigned char GLCD_get_controller_status ( void  )

This function gets the Controller Status, among which the status bit.

Parameters
void
Returns
status Controller status (refer to the datasheet)
Note
This is a private function. The user should not use it.

Definition at line 67 of file GLCD_KS0108B.c.

References GLCD_D_I, GLCD_DATA_DIRECTION, GLCD_DATA_READ, GLCD_E, GLCD_INPUT, GLCD_OUTPUT, GLCD_R_W, HIGH_GLCD, LOW_GLCD, and NOP_DELAY.

void GLCD_initialize ( void  )

GLCD Initialization. This function should be called before using the GLCD. Controller are initialized, backlight is set to OFF, Display is cleared and font is set.

Parameters
void
Returns
void

Definition at line 584 of file GLCD_KS0108B.c.

References backlight_GLCD, clear_GLCD, delay_ms(), FILLING_WHITE, GLCD_CS1, GLCD_CS2, GLCD_D_I, GLCD_DATA_DIRECTION, GLCD_E, GLCD_FONT_HEIGTH_7, GLCD_FONT_WIDTH_5, GLCD_LED, GLCD_OUTPUT, GLCD_R_W, GLCD_RST, HIGH_GLCD, LOW_GLCD, set_display_GLCD, set_font_GLCD, set_vertical_offset_GLCD, TURN_OFF_LED_GLCD, and TURN_ON_DISPLAY.

void GLCD_plot_xy ( unsigned char  x_pos,
unsigned char  y_pos,
unsigned char  filling_color 
)

This function plots a single dot either in black or white colour. Plot position is set accordingly to x,y.

Parameters
x_posPosition X [0..127].
y_posPosition Y [0..63].
filling_colorFilling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK]
Returns
void

Definition at line 302 of file GLCD_KS0108B.c.

References FILLING_BLACK, GLCD_CONTROLLER_MAX_X, GLCD_CS1, GLCD_CS2, GLCD_Y_RESOLUTION, HIGH_GLCD, LOW_GLCD, read_data_GLCD, set_address_GLCD, set_page_GLCD, and write_data_GLCD.

unsigned char GLCD_read_data ( void  )

This function reads a data byte from the controller. It is used to know the data byte value of a certain address before writing into it.

Parameters
void
Returns
Data byte out of selected address.
Note
This is a private function. The user should not use it.

Definition at line 272 of file GLCD_KS0108B.c.

References GLCD_D_I, GLCD_DATA_DIRECTION, GLCD_DATA_READ, GLCD_E, GLCD_INPUT, GLCD_OUTPUT, GLCD_R_W, HIGH_GLCD, LOW_GLCD, and NOP_DELAY.

void GLCD_set_address ( unsigned char  controller_address)

This function sets the controller address (0 to 63).

Parameters
controller_addressController address [0..63].
Returns
void
Note
This is a private function. The user should not use it.

Definition at line 161 of file GLCD_KS0108B.c.

References GLCD_COMM_ADDRESS_SELECT, wait_busy_status_GLCD, and write_command_GLCD.

void GLCD_set_display ( unsigned char  display_status)

This function sets the display turning it ON or OFF.

Parameters
display_statusTurn ON or OFF the display [GLCD_TURN_ON_DISPLAY, GLCD_TURN_OFF_DISPLAY]
Returns
void
Note
If the display is turned OFF the RAM retains the data.

Definition at line 118 of file GLCD_KS0108B.c.

References GLCD_COMM_DISPLAY_OFF, GLCD_COMM_DISPLAY_ON, GLCD_CS1, GLCD_CS2, HIGH_GLCD, LOW_GLCD, wait_busy_status_GLCD, and write_command_GLCD.

void GLCD_set_font ( unsigned char  width,
unsigned char  height 
)

This function sets the font. Currently only one font is supported so is not yet that important. The initialization function is calling it so there is no reason to call it till new fonts will be supported.

Parameters
widthFont width.
widthFont height.
Returns
void

Definition at line 565 of file GLCD_KS0108B.c.

References font_height, and font_width.

void GLCD_set_page ( unsigned char  controller_page)

This function sets the controller page (0 to GLCD_NUMBER_OF_PAGES).

Parameters
controller_pageController page [0..GLCD_NUMBER_OF_PAGES].
Returns
void
Note
This is a private function. The user should not use it.

Definition at line 150 of file GLCD_KS0108B.c.

References GLCD_COMM_PAGE_SELECT, wait_busy_status_GLCD, and write_command_GLCD.

void GLCD_set_vertical_offset ( unsigned char  vertical_offset)

This function sets the vertical offset allowing a display shift.

Parameters
vertical_offsetVertical offset [0..63].
Returns
void

Definition at line 172 of file GLCD_KS0108B.c.

References GLCD_COMM_START_LINE, GLCD_CS1, GLCD_CS2, HIGH_GLCD, LOW_GLCD, NOP_DELAY, and write_command_GLCD.

void GLCD_wait_busy_status ( void  )

This function waits until the controller is not busy any longer. It calls the private function GLCD_get_controller_status ().

Parameters
void
Returns
void
Note
The function is a blocking function. This is a private function, the user should not use it.

Definition at line 50 of file GLCD_KS0108B.c.

References get_controller_status_GLCD, and GLCD_BUSY_FLAG.

void GLCD_write_char ( unsigned char  x_pos,
unsigned char  y_pos,
unsigned char  character 
)

This function writes an ASCII character.

Parameters
x_posPosition X [0..127].
y_posPosition Y [0..63].
characterASCII character either as number (unsigned char) or character. Example: 97, 'a'.
Returns
void

Definition at line 411 of file GLCD_KS0108B.c.

References FILLING_BLACK, FILLING_WHITE, font_5x7, font_height, font_width, and plot_xy_GLCD.

void GLCD_write_command ( unsigned char  command_to_send)

This function writes a command to the controller. The available commands are GLCD command constants. For each command there is a dedicated function. The User should use these rather than sending commands.

Parameters
command_to_sendCommand to be sent to the Controller.
Returns
void
Note
This is a private function. The user should not use it.

Definition at line 91 of file GLCD_KS0108B.c.

References GLCD_D_I, GLCD_DATA_WRITE, GLCD_E, GLCD_R_W, HIGH_GLCD, LOW_GLCD, and NOP_DELAY.

void GLCD_write_data ( unsigned char  data_to_send)

This function writes a data byte to the controller.

Parameters
data_to_sendData byte to be sent out.
Returns
void
Note
This is a private function. The user should not use it.

Definition at line 197 of file GLCD_KS0108B.c.

References GLCD_D_I, GLCD_DATA_WRITE, GLCD_E, GLCD_R_W, HIGH_GLCD, LOW_GLCD, and NOP_DELAY.

void GLCD_write_integer ( unsigned char  x_pos,
unsigned char  y_pos,
int  value,
char  number_of_digits 
)

This function writes variable that contains an integer number.

Parameters
x_posPosition X [0..127].
y_posPosition Y [0..63].
valueInteger value to be written (either positive or negative)
number_of_digitsThe number is formatted with a fixed number of digits to ensure a constant string length.
Returns
void

Definition at line 528 of file GLCD_KS0108B.c.

References write_string_GLCD.

void GLCD_write_message ( unsigned char  x_pos,
unsigned char  y_pos,
const rom unsigned char *  character 
)

This function writes a constant string of char.

Parameters
x_posPosition X [0..127].
y_posPosition Y [0..63].
character_arrayPointer to the array that contains the string (stored in flash).
Returns
void

Definition at line 456 of file GLCD_KS0108B.c.

References font_width, GLCD_FONT_SPACE, GLCD_write_message(), and write_char_GLCD.

void GLCD_write_string ( unsigned char  x_pos,
unsigned char  y_pos,
unsigned char *  character_array 
)

This function writes an entire string of char. The string must be terminated with /0.

Parameters
x_posPosition X [0..127].
y_posPosition Y [0..63].
character_arrayPointer to the array that contains the string.
Returns
void
Warning
The array of unsigned char must be terminated with the /0 character.

Definition at line 439 of file GLCD_KS0108B.c.

References font_width, GLCD_FONT_SPACE, and write_char_GLCD.

Variable Documentation

rom unsigned char font_5x7[96][5]

Definition at line 571 of file GLCD_KS0108B.h.

rom unsigned char logo_1[]

Definition at line 685 of file GLCD_KS0108B.h.