LCD Display. More...
Defines | |
#define | LCD_WIDTH 16 |
#define | LCD_HEIGHT 2 |
#define | LCD_LASTLINE (LCD_HEIGHT - 1) |
#define | LCD_LASTPOS (LCD_WIDTH - 1) |
#define | backlightOn() (LCD_BACKLIGHT = 1) |
Enable LCD backlight. | |
#define | backlightOff() (LCD_BACKLIGHT = 0) |
Disable LCD backlight. | |
#define | appendStringToLCD(message) appendStringToLCD_((const FAR_ROM char*)(message)) |
Write a string to the LCD display. | |
Functions | |
void | initLCD (void) |
Initialize LCD display. | |
void | clearLCD (void) |
Clears the LCD display. | |
void | commandLCD (const BYTE commandData) |
Send command to LCD display. | |
void | setCursorLCD (BYTE l, BYTE p) |
Set cursor to the desired position. | |
void | appendCharToLCD (const char c) |
Write a character to the LCD display. | |
void | printCharToLCD (const char c, BYTE l, BYTE p) |
Write character to a desired position. | |
void | appendStringToLCD_ (const FAR_ROM char *message) |
Write a ROM string to the LCD display. | |
void | printStringToLCD (char *message, BYTE l, BYTE p) |
Write a ROM string to a desired position on the LCD display. | |
void | appendIntToLCD (int i) |
Write an integer to the LCD display. | |
void | printIntToLCD (int i, BYTE l, BYTE p) |
Write an integer to a desired position on the LCD display. |
LCD Display.
Control of LCD display on the Dwengo board
#define appendStringToLCD | ( | message | ) | appendStringToLCD_((const FAR_ROM char*)(message)) |
Write a string to the LCD display.
The string is written to the current cursor position of the LCD display, and the cursor is incremented.
message | the NULL-terminated ASCII string to write |
#define LCD_HEIGHT 2 |
Number of lines on the LCD
#define LCD_LASTLINE (LCD_HEIGHT - 1) |
Line number of the last line of the LCD
#define LCD_LASTPOS (LCD_WIDTH - 1) |
Column number of the last column of the LCD
#define LCD_WIDTH 16 |
Number of columns on the LCD
void appendCharToLCD | ( | const char | c | ) |
Write a character to the LCD display.
Character is written to the current cursor position of the LCD display, and the cursor is incremented. Line wrapping is automatic, assuming a line size of LCD_WIDTH characters.
This function assumes a 2-lines display
c | the ASCII character to write |
void appendIntToLCD | ( | int | i | ) |
Write an integer to the LCD display.
Converts an integer to an ASCII string and writes it to the current cursor position of the LCD display, incrementing the cursor.
i | the signed integer to write |
void appendStringToLCD_ | ( | const FAR_ROM char * | message | ) |
Write a ROM string to the LCD display.
The string is written to the current cursor position of the LCD display, and the cursor is incremented.
message | the NULL-terminated ASCII string to write |
void commandLCD | ( | const BYTE | commandData | ) |
Send command to LCD display.
Also saves and restores the state of the LEDS, and waits for the command to be processed by the LCD.
commandData | the command, see the datasheet of the HD45... controller for a list of possible commands |
void initLCD | ( | void | ) |
Initialize LCD display.
Sets the display to use 8-bit interface, turns the blinking cursor off, ... TODO
Must be called when the LCD is connected, even when it is not in use, to avoid the display ""doing strange things with its pins""
void printCharToLCD | ( | const char | c, |
BYTE | l, | ||
BYTE | p | ||
) |
Write character to a desired position.
Character is written to a position given by the the user.
c | the ASCII character to write |
l | cursor line can be 0 or 1 |
p | cursor position between 0 and 15 |
void printIntToLCD | ( | int | i, |
BYTE | l, | ||
BYTE | p | ||
) |
Write an integer to a desired position on the LCD display.
Converts an integer to an ASCII string and writes it to a user defined cursor position of the LCD display.
i | the signed integer to write |
l | cursor line can be 0 or 1 |
p | cursor position between 0 and 15 |
void printStringToLCD | ( | char * | message, |
BYTE | l, | ||
BYTE | p | ||
) |
Write a ROM string to a desired position on the LCD display.
The string is written to a desired position of the LCD display, and the cursor is incremented.
message | the NULL-terminated ASCII string to write |
l | cursor line can be 0 or 1 |
p | cursor position between 0 and 15 |
void setCursorLCD | ( | BYTE | l, |
BYTE | p | ||
) |
Set cursor to the desired position.
Set cursor to desired position. Append functions will start from this location.
l | cursor line can be 0 or 1 |
p | cursor position between 0 and 15 |