LTlib LaurTec Library
4.0.3
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
|
Go to the source code of this file.
Functions | |
void | LCD_enable_pulse (void) |
void | LCD_send_command (unsigned char data) |
void | LCD_home (void) |
void | LCD_shift (unsigned char shift, unsigned char number_of_shift) |
void | LCD_shift_cursor (unsigned char shift, unsigned char number_of_shift) |
void | goto_line_LCD (unsigned char line) |
void | goto_xy_LCD (unsigned char x, unsigned char y) |
void | LCD_write_char (unsigned char value) |
void | LCD_write_message (const rom unsigned char *buffer) |
void | LCD_write_string (unsigned char *buffer) |
void | LCD_write_integer (int value, unsigned char number_of_digits, unsigned char zero_cleaning) |
void | LCD_clear (void) |
void | LCD_cursor (unsigned char active, unsigned char blinking) |
void | LCD_backlight (unsigned char active) |
void | LCD_initialize (unsigned char quartz_frequency) |
#define backlight_LCD LCD_backlight |
Definition at line 408 of file LCD_44780_I2C.h.
#define BLINKING_OFF 0b00000000 |
Definition at line 197 of file LCD_44780_I2C.h.
#define BLINKING_ON 0b00000001 |
Definition at line 196 of file LCD_44780_I2C.h.
#define BUS_DATA_RATE_LCD 100 |
Definition at line 177 of file LCD_44780_I2C.h.
#define BUS_DATA_RATE_LCD 100 |
Definition at line 177 of file LCD_44780_I2C.h.
#define clear_LCD LCD_clear |
Definition at line 379 of file LCD_44780_I2C.h.
#define cursor_LCD LCD_cursor |
Definition at line 394 of file LCD_44780_I2C.h.
#define DEVICE_ADDRESS_H 0x00 |
Definition at line 130 of file LCD_44780_I2C.h.
#define DEVICE_ADDRESS_L 0x00 |
Definition at line 131 of file LCD_44780_I2C.h.
#define enable_pulse_LCD LCD_enable_pulse |
Definition at line 235 of file LCD_44780_I2C.h.
#define goto_line_LCD LCD_goto_line |
Definition at line 295 of file LCD_44780_I2C.h.
#define goto_xy_LCD LCD_goto_xy |
Definition at line 309 of file LCD_44780_I2C.h.
#define home_LCD LCD_home |
Definition at line 255 of file LCD_44780_I2C.h.
#define initialize_LCD LCD_initialize |
Definition at line 421 of file LCD_44780_I2C.h.
#define LCD_BLINKING_OFF 0b00000000 |
Definition at line 199 of file LCD_44780_I2C.h.
#define LCD_BLINKING_ON 0b00000001 |
Definition at line 198 of file LCD_44780_I2C.h.
#define LCD_BUS_DATA_RATE 100 |
Definition at line 178 of file LCD_44780_I2C.h.
#define LCD_BUS_DATA_RATE 100 |
Definition at line 178 of file LCD_44780_I2C.h.
#define LCD_D0 0b00000001 |
Definition at line 140 of file LCD_44780_I2C.h.
#define LCD_D1 0b00000010 |
Definition at line 141 of file LCD_44780_I2C.h.
#define LCD_D2 0b00000100 |
Definition at line 142 of file LCD_44780_I2C.h.
#define LCD_D3 0b00001000 |
Definition at line 143 of file LCD_44780_I2C.h.
#define LCD_DRIVER_NPN |
Definition at line 163 of file LCD_44780_I2C.h.
#define LCD_E 0b00010000 |
Definition at line 144 of file LCD_44780_I2C.h.
#define LCD_LED 0b10000000 |
Definition at line 147 of file LCD_44780_I2C.h.
#define LCD_LEFT 0b00000000 |
Definition at line 188 of file LCD_44780_I2C.h.
#define LCD_RIGHT 0b00000100 |
Definition at line 189 of file LCD_44780_I2C.h.
#define LCD_RS 0b01000000 |
Definition at line 146 of file LCD_44780_I2C.h.
#define LCD_RW 0b00100000 |
Definition at line 145 of file LCD_44780_I2C.h.
#define LCD_TURN_OFF_CURSOR 0b00000000 |
Definition at line 194 of file LCD_44780_I2C.h.
#define LCD_TURN_OFF_LED 0b00000000 |
Definition at line 214 of file LCD_44780_I2C.h.
#define LCD_TURN_ON_CURSOR 0b00000010 |
Definition at line 193 of file LCD_44780_I2C.h.
#define LCD_TURN_ON_LED LCD_LED |
Definition at line 213 of file LCD_44780_I2C.h.
#define LCD_ZERO_CLEANING_OFF 0x00 |
Definition at line 204 of file LCD_44780_I2C.h.
#define LCD_ZERO_CLEANING_ON 0x01 |
Definition at line 203 of file LCD_44780_I2C.h.
#define LEFT 0b00000000 |
Definition at line 186 of file LCD_44780_I2C.h.
#define MCP23008 |
Definition at line 105 of file LCD_44780_I2C.h.
#define RIGHT 0b00000100 |
Definition at line 187 of file LCD_44780_I2C.h.
#define send_command_LCD LCD_send_command |
Definition at line 247 of file LCD_44780_I2C.h.
#define shift_cursor_LCD LCD_shift_cursor |
Definition at line 284 of file LCD_44780_I2C.h.
#define shift_LCD LCD_shift |
Definition at line 269 of file LCD_44780_I2C.h.
#define TURN_OFF_CURSOR 0b00000000 |
Definition at line 192 of file LCD_44780_I2C.h.
#define TURN_OFF_LED_LCD 0b00000000 |
Definition at line 212 of file LCD_44780_I2C.h.
#define TURN_ON_CURSOR 0b00000010 |
Definition at line 191 of file LCD_44780_I2C.h.
#define TURN_ON_LED_LCD LCD_LED |
Definition at line 211 of file LCD_44780_I2C.h.
#define write_char_LCD LCD_write_char |
Definition at line 320 of file LCD_44780_I2C.h.
#define write_integer_LCD LCD_write_integer |
Definition at line 371 of file LCD_44780_I2C.h.
#define write_message_LCD LCD_write_message |
Definition at line 340 of file LCD_44780_I2C.h.
#define write_string_LCD LCD_write_string |
Definition at line 352 of file LCD_44780_I2C.h.
#define ZERO_CLEANING_OFF 0x00 |
Definition at line 202 of file LCD_44780_I2C.h.
#define ZERO_CLEANING_ON 0x01 |
Definition at line 201 of file LCD_44780_I2C.h.
void goto_line_LCD | ( | unsigned char | line | ) |
This function locates the LCD cursor on the selected line. Tested on 20x4 16x2 LCD displays.
line | Specify the number of the line [1,2,3,4] |
void goto_xy_LCD | ( | unsigned char | x, |
unsigned char | y | ||
) |
This function locates the LCD cursor to an arbitrary X Y location. Y represents the line number from top.
x | It Specifies horizontal position |
y | It Specifies vertical position (line number) |
void LCD_backlight | ( | unsigned char | active | ) |
This function controls the backligth LED.
active | Activate the LED backlight [LCD_TURN_ON_LED, LCD_TURN_OFF_LED] |
blinking | Let the cursor blink [LCD_BLINKING_ON, LCD_BLINKING_OFF] |
This function controls the backligth LED.
active | Activate the LED backlight [LCD_TURN_ON_LED, LCD_TURN_OFF_LED] |
blinking | Let the cursor blink [LCD_BLINKING_ON, LCD_BLINKING_OFF] |
Definition at line 274 of file LCD_44780.c.
References data_buffer, I2C_device_address, LCD_LED, LCD_TURN_ON_LED, MCP2300x_set_port_value(), and PCF8574_write_data().
void LCD_clear | ( | void | ) |
This Function cleans the LCD display.
Definition at line 256 of file LCD_44780.c.
References LCD_send_command().
void LCD_cursor | ( | unsigned char | active, |
unsigned char | blinking | ||
) |
This function controls the cursor option (blinking, active)
active | Activate the cursor, showing it or not [LCD_TURN_ON_CURSOR, LCD_TURN_OFF_CURSOR] |
blinking | Let the cursor blink [LCD_BLINK_ON, LCD_BLINK_OFF] |
This function controls the cursor option (blinking, active)
active | Activate the cursor, showing it or not [LCD_TURN_ON_CURSOR, LCD_TURN_OFF_CURSOR] |
blinking | Let the cursor blink [LCD_BLINKING_ON, LCD_BLINKING_OFF] |
Definition at line 265 of file LCD_44780.c.
References LCD_send_command().
void LCD_enable_pulse | ( | void | ) |
This function generates the Enable pulse.
Definition at line 48 of file LCD_44780.c.
References data_buffer, delay_ms(), I2C_device_address, LCD_E, MCP2300x_set_port_value(), and PCF8574_write_data().
void LCD_home | ( | void | ) |
This function locates the cursor at home location. First line first character.
Definition at line 73 of file LCD_44780.c.
References LCD_send_command().
void LCD_initialize | ( | unsigned char | quartz_frequency | ) |
This function initializes the LCD to work in 4 bit modality.
quartz_frequency | Quartz freq. expressed in MHz used to run the CPU. |
Definition at line 282 of file LCD_44780.c.
References data_buffer, delay_ms(), delay_set_quartz(), DEVICE_ADDRESS_H, DEVICE_ADDRESS_L, I2C_device_address, LCD_BLINKING_OFF, LCD_BUS_DATA_RATE, LCD_clear(), LCD_cursor(), LCD_D0_TRIS, LCD_D1_TRIS, LCD_D2_TRIS, LCD_D3_TRIS, LCD_E, LCD_E_TRIS, LCD_LED_TRIS, LCD_RS, LCD_RS_TRIS, LCD_RW, LCD_RW_TRIS, LCD_send_command(), LCD_TURN_OFF_CURSOR, MCP2300x_initialize(), MCP2300x_set_port_direction(), MCP2300x_set_port_value(), PCF8574_initialize(), PCF8574_write_data(), and PIN_AS_OUTPUT.
void LCD_send_command | ( | unsigned char | data | ) |
This function generates the Enable pulse.
data | Data to be sent [0..255] |
Definition at line 78 of file LCD_44780_I2C.c.
References data_buffer, I2C_device_address, LCD_D0, LCD_D1, LCD_D2, LCD_D3, LCD_enable_pulse(), MCP2300x_set_port_value(), and PCF8574_write_data().
void LCD_shift | ( | unsigned char | shift, |
unsigned char | number_of_shift | ||
) |
This function shifts the LCD screen on the left or right.
shift | Specify where the shift should be [LCD_LEFT, LCD_RIGHT]. |
number_of_shift | Specify the number of times the shift is executed. |
This function shifts the LCD screen on the left or right.
shift | Specify where the shift should be [LCD_LEFT, LCD_RIGHT]. |
number_of_shift | Specify the number of times the shift is executed. |
Definition at line 83 of file LCD_44780.c.
References LCD_send_command().
void LCD_shift_cursor | ( | unsigned char | shift, |
unsigned char | number_of_shift | ||
) |
This function shifts the LCD cursor on the left or right. The position of the cursor is where the next writting will be performed.
shift | Specify where the shift should be [LCD_LEFT, LCD_RIGHT]. |
number_of_shift | Specify the number of times the shift is executed. |
This function shifts the LCD cursor on the left or right. The position of the cursor is where the next writing will be performed.
shift | Specify where the shift should be [LCD_LEFT, LCD_RIGHT]. |
number_of_shift | Specify the number of times the shift is executed. |
Definition at line 97 of file LCD_44780.c.
References LCD_send_command().
void LCD_write_char | ( | unsigned char | value | ) |
This function writes a char to the LCD display. (e.g LCD_write_char ('a'); )
value | Specify the character to be sent [0-128 ASCII code]. |
Definition at line 144 of file LCD_44780.c.
References data_buffer, I2C_device_address, LCD_RS, LCD_send_command(), MCP2300x_set_port_value(), and PCF8574_write_data().
void LCD_write_integer | ( | int | value, |
unsigned char | number_of_digits, | ||
unsigned char | zero_cleaning | ||
) |
This function writes an integer to the LCD display. The integer is converted to string.
value | It is integer that must be written to the LCD display. |
numeber_of_digits | It specifies the number of shown digit [0-5]. 0: Left Justified 1-5: Right Justified with n digit |
zero_cleaning | It specifies whether the left zero must be removed [LCD_ZERO_CLEANING_ON, LCD_ZERO_CLEANING_OFF]. |
void LCD_write_message | ( | const rom unsigned char * | buffer | ) |
This function writes a const string to the LCD display, e.g LCD_write_message ("Hello"); .
buffer | Is a const string written in rom (is not an array). |
This function writes a const string to the LCD display, e.g LCD_write_message("Hello"); .
buffer | Is a const string written in rom (is not an array). |
Definition at line 173 of file LCD_44780.c.
References LCD_write_char(), and LCD_write_message().
void LCD_write_string | ( | unsigned char * | buffer | ) |
This function writes an array of char to the LCD display, terminated with /0 .
buffer | It is an array of char terminated with /0 . |
This function writes an array of char to the LCD display, terminated with /0 .
buffer | It is an array of char terminated with /0 . |
Definition at line 193 of file LCD_44780.c.
References LCD_write_char().