// Module for HD44780 LCD Module
// through 74168 shift register
// This work is provided as-is without any warranty whatsoever
// Use it at your own risk
// Modify and redistribute at will, as long as this disclaimer remains
// (C) Brian Starkey, 2010

#define LCD_MOD 1

#define LCD_PORT PORTB
#define SH_DATA 5
#define SH_CLOCK 3
#define RS 5
#define EN 4

#define LCD_COLS 16         //Number of Cols
#define LCD_ROWS 2          //Number of Rows
#define NEXT_STATION 0x10   //Just offscreen Right
#define PREV_STATION 0x18   //Offscreen Left - 16
#define LINE1_START 0x00
#define LINE1_END 0x27
#define LINE2_START 0x40
#define LINE2_END 0x67

#define E_MODE 0x04         //Entry Mode
#define E_MODE_INCDEC 0x02  //Increment/Decrement Cursor
#define E_MODE_SHIFT 0x01   //Display Shift
#define D_CNT 0x08		    //Display Control
#define D_CNT_POW 0x04		//Display on/off
#define D_CNT_CUR 0x02      //Cursor on/off
#define D_CNT_BLINK 0x01    //Cursor Blink on/off
#define D_SHIFT 0x10        //Display Shift
#define D_SHIFT_CD 0x08     //Shift Cursor/Display
#define D_SHIFT_LR 0x04     //Move Right/Left
#define SET_DDRAM 0x80      //Set DDRAM Address

void init_lcd(void);
void instruction_cmd(char data);
void data_cmd(char data);
void print_string(char * string, char pos);
void print_string_pmem(PGM_P pstring, char pos);
void shift_out(char data);
//void ctos(char * s, char i);
