lcd driver for Xmega More...
Functions | |
void | lcd_init (void) |
Initialize the lcd. More... | |
void | lcd_putc (char c) |
Writes a character to the LCD. More... | |
void | lcd_cmd (uint8_t cmd) |
Writes a command char to the LCD. More... | |
void | lcd_data (uint8_t b) |
Writes a data byte to the LCD. More... | |
void | lcd_puts (char *s) |
Writes a string to the LCD. More... | |
void | lcd_gotoxy (uint8_t x, uint8_t y) |
Set cursor to specified position. More... | |
void | lcd_clear (void) |
Clear lcd. More... | |
void | lcd_home (void) |
Cursor to home position. More... | |
Variables | |
volatile uint8_t | lcd_line = 0 |
Current line number (0 is first line) | |
lcd driver for Xmega
This file contains the routines for interfacing a HD44780U-based text lcd display for Atmel Xmega devices.
It is based on the lcd libray from Peter Fleury (http://homepage.hispeed.ch/peterfleury/) for the ATmega devices.
This library is suitable for four different io modes:
There are defines for these four modes:
In 8 bit mode all 8 data pins must be connected to one 8-pin port of the Xmega. In 4 bit mode all 4 data pins must be connected to one port of Xmega, but the 4 data lines may be connected to any pin of that port and in any order. The header file lcd.h contains macro definitions that can be for that purpose.
The control lines RS, E and R/W can connected to any pin of any port of the Xmega.
void lcd_clear | ( | void | ) |
Clear lcd.
This function clears the LCD and sets cursor to home position.
void lcd_cmd | ( | uint8_t | cmd | ) |
Writes a command char to the LCD.
This function writes a command char to the LCD.
cmd | command character |
void lcd_data | ( | uint8_t | b | ) |
Writes a data byte to the LCD.
This function writes a data byte to the LCD.
b | data byte |
void lcd_gotoxy | ( | uint8_t | x, |
uint8_t | y | ||
) |
Set cursor to specified position.
This function sets the cursor to the specified position.
x | horizontal position (0: left most position) |
y | vertical position (0: first line) |
void lcd_home | ( | void | ) |
Cursor to home position.
This function sets cursor to home position.
void lcd_init | ( | void | ) |
Initialize the lcd.
This function initializes the LCD in one of the four modes depending on de values of LCD_4BIT_MODE and LCD_BUSY_FLAG in the header file.
void lcd_putc | ( | char | c | ) |
Writes a character to the LCD.
This function writes a character to the LCD. The characters '\n' and '\f' have a special meaning
c | the character to be written |
void lcd_puts | ( | char * | s | ) |
Writes a string to the LCD.
This function writes a character string to the LCD.
s | pointer to the character string |