C18 LaurTec Library
2.5
Open Source C Library for PIC18 Microcontrollers
|
Go to the source code of this file.
Defines | |
#define | LCD_D0 0b00000001 |
#define | LCD_D1 0b00000010 |
#define | LCD_D2 0b00000100 |
#define | LCD_D3 0b00001000 |
#define | LCD_E 0b00010000 |
#define | LCD_RW 0b00100000 |
#define | LCD_RS 0b01000000 |
#define | LCD_LED 0b10000000 |
#define | PCF8574_ADDRESS_H 0x70 |
#define | PCF8574_ADDRESS_L 0x00 |
#define | LEFT 0b00000000 |
#define | RIGHT 0b00000100 |
#define | TURN_ON_CURSOR 0b00000010 |
#define | TURN_OFF_CURSOR 0b00000000 |
#define | TURN_ON_LED 0b00000000 |
#define | TURN_OFF_LED 0b10000000 |
#define | BLINK_ON 0b00000001 |
#define | BLINK_OFF 0b00000000 |
Functions | |
char * | itoa (int value, char *s) |
void | Epulse (void) |
void | SendCommand (unsigned char data) |
void | Line2LCD (void) |
void | HomeLCD (void) |
void | ShiftLCD (char shift, char number_of_shift) |
void | ShiftCursorLCD (char shift, char number_of_shift) |
void | GotoLineLCD (char line) |
void | WriteCharLCD (unsigned char value) |
void | WriteStringLCD (const rom char *buffer) |
void | WriteVarLCD (unsigned char *buffer) |
void | WriteIntLCD (int value, char number_of_digits) |
void | ClearLCD (void) |
void | CursorLCD (char active, char blinking) |
void | BacklightLCD (char active) |
void | OpenLCD (unsigned char quartz_frequency) |
#define BLINK_OFF 0b00000000 |
Definition at line 114 of file LCD_44780_I2C.h.
#define BLINK_ON 0b00000001 |
Definition at line 113 of file LCD_44780_I2C.h.
#define LCD_D0 0b00000001 |
Definition at line 78 of file LCD_44780_I2C.h.
#define LCD_D1 0b00000010 |
Definition at line 79 of file LCD_44780_I2C.h.
#define LCD_D2 0b00000100 |
Definition at line 80 of file LCD_44780_I2C.h.
#define LCD_D3 0b00001000 |
Definition at line 81 of file LCD_44780_I2C.h.
#define LCD_E 0b00010000 |
Definition at line 82 of file LCD_44780_I2C.h.
#define LCD_LED 0b10000000 |
Definition at line 85 of file LCD_44780_I2C.h.
#define LCD_RS 0b01000000 |
Definition at line 84 of file LCD_44780_I2C.h.
#define LCD_RW 0b00100000 |
Definition at line 83 of file LCD_44780_I2C.h.
#define LEFT 0b00000000 |
Definition at line 104 of file LCD_44780_I2C.h.
#define PCF8574_ADDRESS_H 0x70 |
Definition at line 97 of file LCD_44780_I2C.h.
#define PCF8574_ADDRESS_L 0x00 |
Definition at line 99 of file LCD_44780_I2C.h.
#define RIGHT 0b00000100 |
Definition at line 105 of file LCD_44780_I2C.h.
#define TURN_OFF_CURSOR 0b00000000 |
Definition at line 108 of file LCD_44780_I2C.h.
#define TURN_OFF_LED 0b10000000 |
Definition at line 111 of file LCD_44780_I2C.h.
#define TURN_ON_CURSOR 0b00000010 |
Definition at line 107 of file LCD_44780_I2C.h.
#define TURN_ON_LED 0b00000000 |
Definition at line 110 of file LCD_44780_I2C.h.
void BacklightLCD | ( | char | active | ) |
This function controls the backligth LED.
active | Activate the LED backlight [TURN_ON_LED, TURN_OFF_LED] |
blinking | Let the cursor blink [BLINK_ON,BLINK_OFF] |
This function controls the backligth LED.
active | Activate the LED backlight [TURN_ON_LED, TURN_OFF_LED] |
blinking | Let the cursor blink [BLINK_ON,BLINK_OFF] |
Definition at line 248 of file LCD_44780.c.
References data_buffer, LCD_LED, PCF8574_address, PCF8574_write_data(), and TURN_ON_LED.
void ClearLCD | ( | void | ) |
This Function cleans the LCD display.
Definition at line 230 of file LCD_44780.c.
References SendCommand().
void CursorLCD | ( | char | active, |
char | blinking | ||
) |
This function controls the cursor option (blinking, active)
active | Activate the cursor, showing it or not [TURN_ON_CURSOR, TURN_OFF_CURSOR] |
blinking | Let the cursor blink [BLINK_ON,BLINK_OFF] |
This function controls the cursor option (blinking, active)
active | Activate the cursor, showing it or not [TURN_ON_CURSOR, TURN_OFF_CURSOR] |
blinking | Let the cursor blink [BLINK_ON,BLINK_OFF] |
Definition at line 239 of file LCD_44780.c.
References SendCommand().
void Epulse | ( | void | ) |
This function generates the Enable pulse.
Definition at line 42 of file LCD_44780.c.
References data_buffer, delay_ms(), LCD_E, PCF8574_address, and PCF8574_write_data().
void GotoLineLCD | ( | 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] |
Definition at line 114 of file LCD_44780.c.
References SendCommand().
void HomeLCD | ( | void | ) |
This function locates the cursor at home location. First line first character.
Definition at line 77 of file LCD_44780.c.
References SendCommand().
char* itoa | ( | int | value, |
char * | s | ||
) |
void Line2LCD | ( | void | ) |
This function locates the cursor at the beginning of Line 2.
Definition at line 67 of file LCD_44780.c.
References SendCommand().
void OpenLCD | ( | unsigned char | quartz_frequency | ) |
This funnction initializes the LCD to work in 4 bit modality.
quartz_frequency | Quartz freq. expressed in MHz used to run the CPU. |
Definition at line 256 of file LCD_44780.c.
References BLINK_OFF, ClearLCD(), CursorLCD(), data_buffer, delay_ms(), LCD_E, LCD_RS, LCD_RW, PCF8574_address, PCF8574_ADDRESS_H, PCF8574_ADDRESS_L, PCF8574_write_data(), SendCommand(), setQuartz(), and TURN_OFF_CURSOR.
void SendCommand | ( | unsigned char | data | ) |
This function generates the Enable pulse.
data | Data to be sent [0..255] |
Definition at line 58 of file LCD_44780_I2C.c.
References data_buffer, Epulse(), PCF8574_address, and PCF8574_write_data().
void ShiftCursorLCD | ( | char | shift, |
char | number_of_shift | ||
) |
This function shifts the LCD cursor on the left or rigt. The position of the cursor is where the next writting will be performed.
shift | Specify where the shift should be [LEFT, RIGHT]. |
number_of_shift | Specify the number of times the shift is executed. |
This function shifts the LCD cursor on the left or rigt. The position of the cursor is where the next writting will be performed.
shift | Specify where the shift should be [LEFT, RIGHT]. |
number_of_shift | Specify the number of times the shift is executed. |
Definition at line 101 of file LCD_44780.c.
References SendCommand().
void ShiftLCD | ( | char | shift, |
char | number_of_shift | ||
) |
This function shifts the LCD screen on the left or rigt.
shift | Specify where the shift should be [LEFT, RIGHT]. |
number_of_shift | Specify the number of times the shift is executed. |
This function shifts the LCD screen on the left or rigt.
shift | Specify where the shift should be [LEFT, RIGHT]. |
number_of_shift | Specify the number of times the shift is executed. |
Definition at line 87 of file LCD_44780.c.
References SendCommand().
void WriteCharLCD | ( | unsigned char | value | ) |
This function writes a char to the LCD display. (e.g WriteCharLCD ('a'); )
value | Specify the character to be sent [0-128 ASCII code]. |
Definition at line 138 of file LCD_44780.c.
References data_buffer, LCD_RS, PCF8574_address, PCF8574_write_data(), and SendCommand().
void WriteIntLCD | ( | int | value, |
char | number_of_digits | ||
) |
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 diplay. |
numeber_of_digits | It specifies the number of shown digit [0-5]. 0: Left Justified 1-5: Right Justified with n digit |
Definition at line 197 of file LCD_44780.c.
References itoa(), and WriteVarLCD().
void WriteStringLCD | ( | const rom char * | buffer | ) |
This function writes a const string to the LCD display, e.g WriteStringLCD("Hello"); .
buffer | Is a const string written in rom (is not an array). |
Definition at line 166 of file LCD_44780.c.
References WriteCharLCD().
void WriteVarLCD | ( | 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 . |
Definition at line 181 of file LCD_44780.c.
References WriteCharLCD().