Set of routines to access 16*32character LCD display on WattBob I board.
Dependents: Assignment_2_herpe Final_V1 ass2 ass2 ... more
Diff: WattBob_TextLCD.h
- Revision:
- 8:5a1c4254e4a6
- Parent:
- 7:020722c18a8b
- Child:
- 9:3b26cd028e85
diff -r 020722c18a8b -r 5a1c4254e4a6 WattBob_TextLCD.h --- a/WattBob_TextLCD.h Thu Mar 24 13:46:06 2011 +0000 +++ b/WattBob_TextLCD.h Thu Dec 08 16:22:17 2011 +0000 @@ -14,6 +14,63 @@ #define E_BIT 5 #define BL_BIT 4 +// +// Registers and bit definitions for 2*16 character display chip +// +#define CMD_CLEAR_DISPLAY 0x01 + +#define CMD_RETURN_HOME 0x02 + +#define CMD_ENTRY_MODE 0x04 +#define CURSOR_STEP_LEFT 0x00 +#define CURSOR_STEP_RIGHT 0x02 +#define DISPLAY_SHIFT_OFF 0x00 +#define DISPLAY_SHIFT_ON 0x01 + +#define CMD_DISPLAY_CONTROL 0x08 +#define DISPLAY_OFF 0x00 +#define DISPLAY_ON 0x04 +#define CURSOR_OFF 0x00 +#define CURSOR_ON 0x02 +#define CURSOR_CHAR_BLINK_OFF 0x00 +#define CURSOR_CHAR_BLINK_ON 0x01 + +#define CMD_CURSOR_SHIFT 0x10 +#define SHIFT_CURSOR_LEFT 0x00 +#define SHIFT_CURSOR_RIGHT 0x04 +#define SHIFT_DISPLAY_LEFT 0x08 +#define SHIFT_DISPLAY_RIGHT 0x0C + +#define CMD_MODE_POWER 0x13 +#define CHARACTER_MODE 0x00 +#define GRAPHICS_MODE 0x08 +#define INTERNAL_POWER_OFF 0x00 +#define INTERNAL_POWER_ON 0x04 + +#define CMD_FUNCTION_SET 0x20 +#define ENGL_JAPAN_FONT_SET 0x00 +#define EUROPE_FONT_SET 0x01 +#define ENGL_RUSSIAN_FONT_SET 0x20 +#define FONT_5x8 0x00 +#define FONT_5x10 0x04 +#define ONE_LINE_DISPLAY 0x00 +#define TWO_LINE_DISPLAY 0x08 +#define INTERFACE_4_BIT 0x00 +#define INTERFACE_8_BIT 0x10 + +#define CMD_SET_CGRAM_ADDRESS 0x40 + +#define CMD_SET_DDRAM_ADDRESS 0x80 +// +// nibble commands +// +#define CMD4_SET_4_BIT_INTERFACE 0x2 +#define CMD4_SET_8_BIT_INTERFACE 0x3 +// +// Misc 2*16 character display constants +// +#define DISPLAY_INIT_DELAY_SECS 0.025f // 25mS + /** Class to access 16*2 LCD display connected to an MCP23017 I/O extender chip * * Derived from the "stream" class to be able to use methods such as "printf"