/*
 * Copyright (c) 2007 by Hartmut Birr
 *
 * This program is free software; you can redistribute it and/or
 * mmodify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
 *
 */

#ifndef __LCD_H__
#define __LCD_H__

#include <inttypes.h>
#include <avr/pgmspace.h>


//#define DISPLAY208
#define DISPLAY420


#if defined (DISPLAY208)
	#define SPALTEN_MAX     8  			/* LCD Zeichen je Zeile */
	#define ZEILEN_MAX      2   		/* LCD Zeilenanzahl     */
	#define LCD_PCA9555D_ADRESS 0x40	/* Adress of the i2c-chip */
#elif defined (DISPLAY420)
	#define SPALTEN_MAX     20  		/* LCD Zeichen je Zeile */
	#define ZEILEN_MAX      4   		/* LCD Zeilenanzahl     */
	#define LCD_PCA9555D_ADRESS 0x40	// TODO adapt/* Adress of the i2c-chip */
#endif


#define BUTTON_DOWN     	0x01
#define BUTTON_UP       	0x02
#define BUTTON_ENTER    	0x04

/* ADDED DKS */
#define BUTTON_SOFT_KEY_1	0x08
#define BUTTON_SOFT_KEY_2  	0x10
/* ADDED DKS */

#define CURSOR_SOLID    0
#define CURSOR_CONCAVE  1
#define CURSOR_HATCHED  2
#define BLOCK_SOLID     255
#define BLOCK_HATCHED   3

uint8_t LCDInit(void);
void LCDWrite(uint8_t, uint8_t, uint8_t, const char*);
void LCDWrite_P(uint8_t, uint8_t, uint8_t, const prog_char*);
void LCDOverwrite_P(uint8_t, uint8_t, uint8_t, const prog_char*);
void LCDClearLine(uint8_t y);
uint8_t LCDGetButton(void);

#endif

