/*! \file lcd.h \brief Character LCD driver for HD44780/SED1278 displays. */ //***************************************************************************** // // File Name : 'lcd.h' // Title : Character LCD driver for HD44780/SED1278 displays // (usable in mem-mapped, or I/O mode) // Author : Pascal Stang // Created : 11/22/2000 // Revised : 4/30/2002 // Version : 1.1 // Target MCU : Atmel AVR series // Editor Tabs : 4 // // This code is distributed under the GNU Public License // which can be found at http://www.gnu.org/licenses/gpl.txt // //***************************************************************************** #ifndef LCD_H #define LCD_H #include "global.h" // include project-dependent configurations #include "lcdconf.h" // HD44780 LCD controller command set (do not modify these) // writing: #define LCD_CLR 0 // DB0: clear display #define LCD_HOME 1 // DB1: return to home position #define LCD_ENTRY_MODE 2 // DB2: set entry mode #define LCD_ENTRY_INC 1 // DB1: increment #define LCD_ENTRY_SHIFT 0 // DB2: shift #define LCD_ON_CTRL 3 // DB3: turn lcd/cursor on #define LCD_ON_DISPLAY 2 // DB2: turn display on #define LCD_ON_CURSOR 1 // DB1: turn cursor on #define LCD_ON_BLINK 0 // DB0: blinking cursor #define LCD_MOVE 4 // DB4: move cursor/display #define LCD_MOVE_DISP 3 // DB3: move display (0-> move cursor) #define LCD_MOVE_RIGHT 2 // DB2: move right (0-> left) #define LCD_FUNCTION 5 // DB5: function set #define LCD_FUNCTION_8BIT 4 // DB4: set 8BIT mode (0->4BIT mode) #define LCD_FUNCTION_2LINES 3 // DB3: two lines (0->one line) #define LCD_FUNCTION_10DOTS 2 // DB2: 5x10 font (0->5x7 font) #define LCD_CGRAM 6 // DB6: set CG RAM address #define LCD_DDRAM 7 // DB7: set DD RAM address // reading: #define LCD_BUSY 7 // DB7: LCD is busy // Default LCD setup // this default setup is loaded on LCD initialization #ifdef LCD_DATA_4BIT #define LCD_FDEF_1 (0< is a pointer to a ROM array containing custom characters // is the index of the character to load from lcdCustomCharArray // is the RAM location in the LCD (legal value: 0-7) void lcdLoadCustomChar(u08* lcdCustomCharArray, u08 romCharNum, u08 lcdCharNum); // prints a series of bytes/characters to the display void lcdPrintData(char* data, u08 nBytes); // displays a horizontal progress bar at the current cursor location // is the value the bargraph should indicate // is the value at the end of the bargraph // is the number of LCD characters that the bargraph should cover void lcdProgressBar(u16 progress, u16 maxprogress, u08 length); #endif