131 #define LCD_I2C_DEVICE 0x4E
134 #define LCD_LINE_MODE LCD_2LINE
135 #define LCD_LIGHT_LOW_ACTIVE 0
137 #define LCD_LINE1 0x00
138 #define LCD_LINE2 0x40
139 #define LCD_LINE3 0x14
140 #define LCD_LINE4 0x54
145 #error "#define LCD_LINES must be less or equal to 4"
149 #error "#define LCD_COLS must be less or equal to 20"
169 #define LCD_LIGHT_PIN 3
180 #define LCD_D4 (1 << LCD_D4_PIN)
181 #define LCD_D5 (1 << LCD_D5_PIN)
182 #define LCD_D6 (1 << LCD_D6_PIN)
183 #define LCD_D7 (1 << LCD_D7_PIN)
185 #define LCD_RS (1 << LCD_RS_PIN)
186 #define LCD_RW (1 << LCD_RW_PIN)
187 #define LCD_LIGHT (1 << LCD_LIGHT_PIN)
188 #define LCD_E (1 << LCD_E_PIN)
194 #define CMD_D0 (1 << 0)
195 #define CMD_D1 (1 << 1)
196 #define CMD_D2 (1 << 2)
197 #define CMD_D3 (1 << 3)
198 #define CMD_RS (1 << 4)
199 #define CMD_RW (1 << 5)
204 #define LCD_ADDRESS 0
223 #define LCD_CLEAR 0x01
224 #define LCD_HOME 0x02
225 #define LCD_DEF_CHAR 0x40
230 #define LCD_ENTRYMODE 0x04
231 #define LCD_INCREASE LCD_ENTRYMODE | 0x02
232 #define LCD_DECREASE LCD_ENTRYMODE | 0x00
233 #define LCD_DISPLAYSHIFTON LCD_ENTRYMODE | 0x01
234 #define LCD_DISPLAYSHIFTOFF LCD_ENTRYMODE | 0x00
239 #define LCD_DISPLAYMODE 0x08
240 #define LCD_DISPLAYON LCD_DISPLAYMODE | 0x04
241 #define LCD_DISPLAYOFF LCD_DISPLAYMODE | 0x00
242 #define LCD_CURSORON LCD_DISPLAYMODE | 0x02
243 #define LCD_CURSOROFF LCD_DISPLAYMODE | 0x00
244 #define LCD_BLINKINGON LCD_DISPLAYMODE | 0x01
245 #define LCD_BLINKINGOFF LCD_DISPLAYMODE | 0x00
250 #define LCD_SHIFTMODE 0x10
251 #define LCD_DISPLAYSHIFT LCD_SHIFTMODE | 0x08
252 #define LCD_CURSORMOVE LCD_SHIFTMODE | 0x00
253 #define LCD_RIGHT LCD_SHIFTMODE | 0x04
254 #define LCD_LEFT LCD_SHIFTMODE | 0x00
259 #define LCD_CONFIGURATION 0x20
260 #define LCD_8BIT LCD_CONFIGURATION | 0x10
261 #define LCD_4BIT LCD_CONFIGURATION | 0x00
262 #define LCD_2LINE LCD_CONFIGURATION | 0x08
263 #define LCD_1LINE LCD_CONFIGURATION | 0x00
264 #define LCD_5X10 LCD_CONFIGURATION | 0x04
265 #define LCD_5X7 LCD_CONFIGURATION | 0x00
267 #define LCD_LIGHT_OFF 0
268 #define LCD_LIGHT_ON LCD_LIGHT
372 bool lcd_printlc(uint8_t line, uint8_t col,
char *
string);
392 bool lcd_printlcc(uint8_t line, uint8_t col,
char *
string);
418 bool lcd_getlc(uint8_t *line, uint8_t*col);
void lcd_light(bool light)
Turn backlight ON/OFF.
Definition: i2clcd.c:333
bool lcd_printlc(uint8_t line, uint8_t col, char *string)
Print string to position (If string is longer than LCD_COLS overwrite first chars in line) ...
Definition: i2clcd.c:190
uint8_t lcd_read(bool mode)
Read data from display over i2c (for internal use)
Definition: i2clcd.c:98
bool lcd_printlcc(uint8_t line, uint8_t col, char *string)
Print string to position (If string is longer than LCD_COLS continue in next line) ...
Definition: i2clcd.c:226
bool lcd_printlc_P(uint8_t line, uint8_t col, PGM_P string)
Print string from Flash to position (If string is longer than LCD_COLS overwrite first chars in line)...
Definition: i2clcd.c:208
bool lcd_putcharlc(uint8_t line, uint8_t col, char value)
Put char to position.
Definition: i2clcd.c:180
void lcd_command(uint8_t command)
Issue a command to the display.
Definition: i2clcd.c:145
bool lcd_busy(void)
Check if LCD is busy.
Definition: i2clcd.c:353
void lcd_putchar(char value)
Put char to cursor position.
Definition: i2clcd.c:172
uint8_t lcd_getbyte(bool mode)
Read one byte over i2c from display.
Definition: i2clcd.c:135
void lcd_print_P(PGM_P string)
Print string from Flash to cursor position.
Definition: i2clcd.c:162
void lcd_print(char *string)
Print string to cursor position.
Definition: i2clcd.c:153
bool lcd_getlc(uint8_t *line, uint8_t *col)
Get line and col of the cursor position.
Definition: i2clcd.c:304
void lcd_write(uint8_t value)
Write nibble to display with toggle of enable-bit.
Definition: i2clcd.c:76
bool lcd_nextline(void)
Go to nextline (if next line > LCD_LINES return false)
Definition: i2clcd.c:291
void lcd_def_char(PGM_P chardata, uint8_t number)
Define a user character.
Definition: i2clcd.c:366
void lcd_init(void)
Display initialization sequence.
Definition: i2clcd.c:49
bool lcd_printlcc_P(uint8_t line, uint8_t col, PGM_P string)
Print string from flash to position (If string is longer than LCD_COLS continue in next line) ...
Definition: i2clcd.c:248
bool lcd_gotolc(uint8_t line, uint8_t col)
Go to position.
Definition: i2clcd.c:270