#include "asuro.h"
Go to the source code of this file.
Defines | |
#define | LCD_INIT {(LCD_4BIT | LCD_2LINE | LCD_5X7), 0} |
#define | LCD_DEV 0x40 |
#define | LCD_LINES 2 |
#define | LCD_CHARS 8 |
#define | LCD_LINE1 0x00 |
#define | LCD_LINE2 0x40 |
#define | LCD_LINE3 0x10 |
#define | LCD_LINE4 0x50 |
#define | LD4 0 |
#define | LD5 1 |
#define | LD6 2 |
#define | LD7 3 |
#define | LRS 4 |
#define | LRW 5 |
#define | LEN 7 |
#define | LBL 6 |
#define | LCD_D0 (1 << LD4) |
#define | LCD_D1 (1 << LD5) |
#define | LCD_D2 (1 << LD6) |
#define | LCD_D3 (1 << LD7) |
#define | LCD_D4 (1 << LD4) |
#define | LCD_D5 (1 << LD5) |
#define | LCD_D6 (1 << LD6) |
#define | LCD_D7 (1 << LD7) |
#define | LCD_RS (1 << LRS) |
#define | LCD_RW (1 << LRW) |
#define | LCD_EN (1 << LEN) |
#define | LCD_BL (1 << LBL) |
#define | LCD_CLEAR 0x01 |
#define | LCD_HOME 0x02 |
#define | LCD_ENTRYMODE 0x04 |
#define | LCD_INCREASE (LCD_ENTRYMODE | 0x02) |
#define | LCD_DECREASE (LCD_ENTRYMODE | 0x00) |
#define | LCD_DISPLAYSHIFTON (LCD_ENTRYMODE | 0x01) |
#define | LCD_DISPLAYSHIFTOFF (LCD_ENTRYMODE | 0x00) |
#define | LCD_DISPLAYMODE 0x08 |
#define | LCD_DISPLAYON (LCD_DISPLAYMODE | 0x04) |
#define | LCD_DISPLAYOFF (LCD_DISPLAYMODE | 0x00) |
#define | LCD_CURSORON (LCD_DISPLAYMODE | 0x02) |
#define | LCD_CURSOROFF (LCD_DISPLAYMODE | 0x00) |
#define | LCD_BLINKINGON (LCD_DISPLAYMODE | 0x01) |
#define | LCD_BLINKINGOFF (LCD_DISPLAYMODE | 0x00) |
#define | LCD_SHIFTMODE 0x10 |
#define | LCD_DISPLAYSHIFT (LCD_SHIFTMODE | 0x08) |
#define | LCD_CURSORMOVE (LCD_SHIFTMODE | 0x00) |
#define | LCD_RIGHT (LCD_SHIFTMODE | 0x04) |
#define | LCD_LEFT (LCD_SHIFTMODE | 0x00) |
#define | LCD_CONFIGURATION 0x20 |
#define | LCD_8BIT (LCD_CONFIGURATION | 0x10) |
#define | LCD_4BIT (LCD_CONFIGURATION | 0x00) |
#define | LCD_2LINE (LCD_CONFIGURATION | 0x08) |
#define | LCD_1LINE (LCD_CONFIGURATION | 0x00) |
#define | LCD_5X10 (LCD_CONFIGURATION | 0x04) |
#define | LCD_5X7 (LCD_CONFIGURATION | 0x00) |
#define | LCD_CGRAM 0x40 |
#define | LCD_DDRAM 0x80 |
Functions | |
void | InitLCD (void) |
Init LCD Hardware. | |
void | BacklightLCD (unsigned char state) |
Switch LCD Backlight on/off. | |
void | SetIOLCD (unsigned char setCommand, unsigned char bits) |
Set LCD IO Port. | |
unsigned char | GetIOLCD (void) |
Read LCD IO Port. | |
void | SetCursorLCD (unsigned char cursor, unsigned char line) |
Set Cursor. | |
void | ClearLCD (void) |
Clears the Display. | |
void | SetDataLCD (unsigned char data) |
Write Data LCD, for use with CommandLCD or WriteLCD. | |
void | CommandLCD (unsigned char command) |
Set LCD Command, implemented as macro. | |
void | WriteLCD (unsigned char data) |
Write Data. | |
void | PrintLCD (char *string, unsigned char wrap) |
Print String to LCD. | |
void | PrintSetLCD (unsigned char cursor, unsigned char line, char *string) |
Print String at cursor position. | |
void | PrintIntLCD (int value) |
Print Integer Value. | |
void | PrintAlignLCD (unsigned char line, unsigned char alignment, char *string) |
Print a String at aligned position (left, center right). | |
Variables | |
unsigned char | portLCD |
unsigned char | lineLCD |
unsigned char | cursorLCD |
Inspiration from I²C-LCD library by "Nico Eichelmann, Thomas Eichelmann"
Definition in file lcd.h.
void BacklightLCD | ( | unsigned char | state | ) |
Switch LCD Backlight on/off.
state | On or off |
void ClearLCD | ( | void | ) |
Clears the Display.
none |
void CommandLCD | ( | unsigned char | command | ) |
Set LCD Command, implemented as macro.
command | LCD command |
unsigned char GetIOLCD | ( | void | ) |
Read LCD IO Port.
void InitLCD | ( | void | ) |
Init LCD Hardware.
void PrintAlignLCD | ( | unsigned char | line, | |
unsigned char | alignment, | |||
char * | string | |||
) |
Print a String at aligned position (left, center right).
line | Line number | |
alignment | left, center or right aligned | |
string | string pointer |
void PrintIntLCD | ( | int | value | ) |
Print Integer Value.
value | Integer value |
void PrintLCD | ( | char * | string, | |
unsigned char | wrap | |||
) |
Print String to LCD.
string | String pointer | |
wrap | String Wrapped or not |
void PrintSetLCD | ( | unsigned char | cursor, | |
unsigned char | line, | |||
char * | string | |||
) |
Print String at cursor position.
cursor | Cursor position | |
line | line number | |
string | String pointer |
void SetCursorLCD | ( | unsigned char | cursor, | |
unsigned char | line | |||
) |
Set Cursor.
cursor | cursor position | |
line | line number |
void SetDataLCD | ( | unsigned char | data | ) |
Write Data LCD, for use with CommandLCD or WriteLCD.
data | LCD Data |
void SetIOLCD | ( | unsigned char | setCommand, | |
unsigned char | bits | |||
) |
Set LCD IO Port.
setCommand | ON or OFF | |
bits | Bits to set |
void WriteLCD | ( | unsigned char | data | ) |
Write Data.
data | LCD Data |