|
#define | LCD_CLR 0 |
| DB0: clear display. More...
|
|
#define | LCD_HOME 1 |
| DB1: return to home position. More...
|
|
#define | LCD_ENTRY_MODE 2 |
| DB2: set entry mode. More...
|
|
#define | LCD_ENTRY_INC 1 |
| DB1: 1=increment, 0=decrement. More...
|
|
#define | LCD_ENTRY_SHIFT 2 |
| DB2: 1=display shift on. More...
|
|
#define | LCD_ON 3 |
| DB3: turn lcd/cursor on. More...
|
|
#define | LCD_ON_DISPLAY 2 |
| DB2: turn display on. More...
|
|
#define | LCD_ON_CURSOR 1 |
| DB1: turn cursor on. More...
|
|
#define | LCD_ON_BLINK 0 |
| DB0: blinking cursor ? More...
|
|
#define | LCD_MOVE 4 |
| DB4: move cursor/display. More...
|
|
#define | LCD_MOVE_DISP 3 |
| DB3: move display (0-> cursor) ? More...
|
|
#define | LCD_MOVE_RIGHT 2 |
| DB2: move right (0-> left) ? More...
|
|
#define | LCD_FUNCTION 5 |
| DB5: function set. More...
|
|
#define | LCD_FUNCTION_8BIT 4 |
| DB4: set 8BIT mode (0->4BIT mode) More...
|
|
#define | LCD_FUNCTION_2LINES 3 |
| DB3: two lines (0->one line) More...
|
|
#define | LCD_FUNCTION_10DOTS 2 |
| DB2: 5x10 font (0->5x7 font) More...
|
|
#define | LCD_CGRAM 6 |
| DB6: set CG RAM address. More...
|
|
#define | LCD_DDRAM 7 |
| DB7: set DD RAM address. More...
|
|
#define | LCD_BUSY 7 |
| DB7: LCD is busy. More...
|
|
#define | LCD_ENTRY_DEC 0x04 |
| display shift off, dec cursor move dir More...
|
|
#define | LCD_ENTRY_DEC_SHIFT 0x05 |
| display shift on, dec cursor move dir More...
|
|
#define | LCD_ENTRY_INC_ 0x06 |
| display shift off, inc cursor move dir More...
|
|
#define | LCD_ENTRY_INC_SHIFT 0x07 |
| display shift on, inc cursor move dir More...
|
|
#define | LCD_MOVE_CURSOR_LEFT 0x10 |
| move cursor left (decrement) More...
|
|
#define | LCD_MOVE_CURSOR_RIGHT 0x14 |
| move cursor right (increment) More...
|
|
#define | LCD_MOVE_DISP_LEFT 0x18 |
| shift display left More...
|
|
#define | LCD_MOVE_DISP_RIGHT 0x1C |
| shift display right More...
|
|
#define | LCD_FUNCTION_4BIT_1LINE 0x20 |
| 4-bit interface, single line, 5x7 dots More...
|
|
#define | LCD_FUNCTION_4BIT_2LINES 0x28 |
| 4-bit interface, dual line, 5x7 dots More...
|
|
#define | LCD_FUNCTION_8BIT_1LINE 0x30 |
| 8-bit interface, single line, 5x7 dots More...
|
|
#define | LCD_FUNCTION_8BIT_2LINES 0x38 |
| 8-bit interface, dual line, 5x7 dots More...
|
|
#define | LCD_START_LINE1 0x00 |
| DDRAM address of first char of line 1. More...
|
|
#define | LCD_START_LINE2 0x40 |
| DDRAM address of first char of line 2. More...
|
|
#define | LCD_START_LINE3 0x10 |
| DDRAM address of first char of line 3. More...
|
|
#define | LCD_START_LINE4 0x50 |
| DDRAM address of first char of line 4. More...
|
|
#define | LCD_MODE_DEFAULT ((1<<LCD_ENTRY_MODE) | (1<<LCD_ENTRY_INC) ) |
|
#define | LCD_STROBE() (sbi(LCD_E_PORT, LCD_E_PIN), cbi(LCD_E_PORT, LCD_E_PIN)) |
|
#define | LCD_DATA_BITS (_BV(LCD_DATA_D7_PIN) | _BV(LCD_DATA_D6_PIN) | _BV(LCD_DATA_D5_PIN) | _BV(LCD_DATA_D4_PIN)) |
|
#define | TIME_S1_MS ( 1*(F_CPU/4000) ) |
|
#define | delay_us(us) delay_short( ((TIME_S1_MS*(us))/1000) ) |
|
LCD interface example.
Uses routines from delay.c This code will interface to a standard LCD controller like the Hitachi HD44780. It uses it in 4 bit mode.
Ported to AVR-GCC by Alex Shepherd and modified to be compatible with previous LCD API
- Version
- $Id: lcd.c 159 2016-09-03 06:51:47Z pischky $
- Author
- Craig Lee
-
Alex Shepherd
- Copyright
- Copywrite Craig Lee 1998
Definition in file lcd.c.