You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.1 KiB

#ifndef LCD_H
#define LCD_H
#define LCD_ROWS 2
#define LCD_COLUMNS 16
#define LCD_CURSOR_OFF 0x0C
#define LCD_CURSOR_OFF_BLINK 0x0D
#define LCD_CURSOR_NO_BLINK 0x0E
#define LCD_CURSOR_BLINK 0x0F
#define LCD_CLEAR 0x01
#define LCD_CLOSE_INIT 0x80
/**
* Entry modes
**/
#define LCD_ENTRY_AUTOINC 0x04
#define LCD_ENTRY_SHIFT 0x02
/**
* Shifting commands
**/
#define LCD_GO_HOME 0x02
#define LCD_SHIFT_RIGHT 0x1C
#define LCD_SHIFT_LEFT 0x18
/**
* Display off command
**/
#define LCD_TURN_OFF 0x0A
/**
* Character font
**/
#define LCD_CHARSET_0 0x00
#define LCD_CHARSET_1 0x04
/**
* Number of lines
**/
#define LCD_LINES_1 0x00
#define LCD_LINES_2 0x08
#define LCD_FUNCTION_MASK B00100000
// Choose the fonction modes here
#define LCD_FUNCTION_SET LCD_LINES_2 | LCD_CHARSET_0
// Choose the cursor mode here
#define LCD_CURSOR LCD_CURSOR_OFF
// Choose the entry mode here
#define LCD_ENTRY_MODE LCD_ENTRY_AUTOINC
// Uncomment this if you want clearScreen to call back a function named onClearScreen
#define LCD_USE_CLRSCREEN_CALLBACK
#endif