#ifndef MAIN_H
#define MAIN_H

//#include "../../../struct.h"

#include <stdint.h>
#include <util/delay.h>
 
#define DDR_LCD   DDRB
#define PORT_LCD  PORTB
#define PIN_WR    0
#define PIN_Data  1 
#define PIN_CS    2

#define CS_OFF   do{PORT_LCD |=  (1 << PIN_CS);}while(0)
#define CS_ON    do{PORT_LCD &= ~(1 << PIN_CS);}while(0)

#define WR0		 do{PORT_LCD &= ~(1 << PIN_WR);}while(0)
#define WR1		 do{PORT_LCD |=  (1 << PIN_WR);}while(0)

#define Data0	 do{PORT_LCD &= ~(1 << PIN_Data);}while(0)
#define Data1	 do{PORT_LCD |=  (1 << PIN_Data);}while(0)

#define Pause     _delay_us(100)

enum{SEND_COMM, SEND_DATE, END_PROG};
	

typedef void (*FUN)(void);

extern volatile uint16_t  Flag_Prog;

#endif
