PIC18 LaurTec Library
3.3.1
Open Source C Library for PIC18 Microcontrollers based on C18 - XC8 Compilers
|
#include "GLCD_KS0108B.h"
Go to the source code of this file.
Functions | |
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_display (unsigned char display_status) |
void | GLCD_set_page (unsigned char controller_page) |
void | GLCD_set_address (unsigned char controller_address) |
void | GLCD_set_vertical_offset (unsigned char vertical_offset) |
void | GLCD_write_data (unsigned char data_to_send) |
void | GLCD_clear (unsigned char filling_color) |
unsigned char | GLCD_read_data (void) |
void | GLCD_plot_xy (unsigned char x_pos, unsigned char y_pos, 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_horizontal_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 width, unsigned char height, unsigned char filling_color) |
void | GLCD_draw_box (unsigned char x_origin, unsigned char y_origin, unsigned char width, unsigned char height, unsigned char filling_color) |
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_draw_picture (rom unsigned char *picture_table) |
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_backlight (unsigned char backlight) |
void | GLCD_initialize (void) |
Variables | |
unsigned char | font_width = 0 |
unsigned char | font_height = 0 |
void GLCD_backlight | ( | unsigned char | backlight | ) |
This function turns ON-OFF the GLCD back light.
backlight | Control the backlight LED. TURN_ON_LED : Backlight is ON TURN_OFF_LED : Backlight is OFF |
Definition at line 604 of file GLCD_KS0108B_old.c.
References GLCD_LED.
void GLCD_clear | ( | unsigned char | filling_color | ) |
This function clears the display either in black or white color.
filling_color | Filling color allows to set the display either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK] |
Definition at line 250 of file GLCD_KS0108B_old.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.
x_origin | Box X origin [0..127] |
y_origin | Box Y origin [0..63] |
length | Box length. |
length | Box height. |
filling_color | Filling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK] |
Definition at line 428 of file GLCD_KS0108B_old.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.
x_origin | Line X origin [0..127]. |
y_origin | Line Y origin [0..63]. |
length | Line length [0..127]. |
filling_color | Filling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK] |
Definition at line 396 of file GLCD_KS0108B_old.c.
References plot_xy_GLCD.
void GLCD_draw_picture | ( | rom unsigned char * | picture_table | ) |
This function draws a picture with 128x64 resolution.
picture_table | Pointer to the table containing the picture (stored in flash). |
Definition at line 508 of file GLCD_KS0108B_old.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.
x_origin | Line X origin [0..128]. |
y_origin | Line Y origin [0..63]. |
length | Line length [0..63]. |
filling_color | Filling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK] |
Definition at line 383 of file GLCD_KS0108B_old.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.
x_origin | Window X origin [0..127]. |
y_origin | Window Y origin [0..63]. |
length | Window length [0..127]. |
length | Window height [0..63]. |
filling_color | Filling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK] |
Definition at line 410 of file GLCD_KS0108B_old.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.
void |
Definition at line 67 of file GLCD_KS0108B_old.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.
void |
Definition at line 613 of file GLCD_KS0108B_old.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.
x_pos | Position X [0..127]. |
y_pos | Position Y [0..63]. |
filling_color | Filling colour allows to set the dot either on white or black colour [GLCD_FILLING_WHITE, GLCD_FILLING_BLACK] |
Definition at line 331 of file GLCD_KS0108B_old.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.
void |
Definition at line 295 of file GLCD_KS0108B_old.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).
controller_address | Controller address [0..63]. |
Definition at line 161 of file GLCD_KS0108B_old.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.
display_status | Turn ON or OFF the display [GLCD_TURN_ON_DISPLAY, GLCD_TURN_OFF_DISPLAY] |
Definition at line 118 of file GLCD_KS0108B_old.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.
width | Font width. |
width | Font height. |
Definition at line 594 of file GLCD_KS0108B_old.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).
controller_page | Controller page [0..GLCD_NUMBER_OF_PAGES]. |
Definition at line 150 of file GLCD_KS0108B_old.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.
vertical_offset | Vertical offset [0..63]. |
Definition at line 172 of file GLCD_KS0108B_old.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 ().
void |
Definition at line 50 of file GLCD_KS0108B_old.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.
x_pos | Position X [0..127]. |
y_pos | Position Y [0..63]. |
character | ASCII character either as number (unsigned char) or character. Example: 97, 'a'. |
Definition at line 440 of file GLCD_KS0108B_old.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.
command_to_send | Command to be sent to the Controller. |
Definition at line 91 of file GLCD_KS0108B_old.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.
data_to_send | Data byte to be sent out. |
Definition at line 203 of file GLCD_KS0108B_old.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.
x_pos | Position X [0..127]. |
y_pos | Position Y [0..63]. |
value | Integer value to be written (either positive or negative) |
number_of_digits | The number is formatted with a fixed number of digits to ensure a constant string length. |
Definition at line 557 of file GLCD_KS0108B_old.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.
x_pos | Position X [0..127]. |
y_pos | Position Y [0..63]. |
character_array | Pointer to the array that contains the string (stored in flash). |
Definition at line 485 of file GLCD_KS0108B_old.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.
x_pos | Position X [0..127]. |
y_pos | Position Y [0..63]. |
character_array | Pointer to the array that contains the string. |
Definition at line 468 of file GLCD_KS0108B_old.c.
References font_width, GLCD_FONT_SPACE, and write_char_GLCD.
unsigned char font_height = 0 |
Definition at line 44 of file GLCD_KS0108B_old.c.
unsigned char font_width = 0 |
Definition at line 43 of file GLCD_KS0108B_old.c.