#ifndef DISPLAY__H
#define DISPLAY__H
#include <stdio.h>
#include <msp430x16x.h>

// defines display layout
#define LCD_LINES         2
#define LCD_WIDTH         16

// defines for data
#define	LDOUT	        P2OUT	// dataport
#define LDIN	        P2IN
#define	LDSEL	        P2SEL
#define	LDDIR	        P2DIR

// defines for control
#define LCOUT	        P1OUT
#define	LCDIR	        P1DIR
#define LCSEL	        P1SEL
#define	LCD_RS	        BIT0	// bit meaning: 1 = Data , 0 = Control
#define LCD_RW	        BIT1	// bit meanings: 0 = Write, 1 = Read
#define	LCD_E	        BIT2	// Enable

unsigned char get_pos(void);
void set_pos(unsigned char add);
void send_cmd(unsigned char value);
unsigned char lcd_addr(int line);
void lcd_scroll_up(void);
int putchar(int c);
void init_display(void);

#endif
