#ifndef	__USART1_H
#define	__USART1_H

void InitPic(void);
void SetupUSART(void);


//*******************************************************************//
//Constant Definitions
//*******************************************************************//

#define	TRUE		1
#define	FALSE		0
#define	PASS		1
#define	FAIL		0
//#define	ON			1
//#define	OFF			0

//USART
#define	INIT_TRISC	0b10101111
#define DIN_TRISC	0b10101111
#define DOUT_TRISC	INIT_TRISC
#define	INIT_PORTC	0b00100000	// port kezdoerteke

//#define	DS1_IN	PORTDbits.RD0	//	IN
//#define	DS1_OUT	LATDbits.LATD0	//	OUT
#define	PIC_TX	PORTCbits.RC6	//	OUTPUT
//#define	TX_EN	PORTBbits.RB2	//	OUTPUT
//#define	RX_EN	PORTBbits.RB3	//	OUTPUT
#define	PIC_RX	PORTCbits.RC7	//	INPUT
//#define	PGM		PORTBbits.RB5	//	NA
//#define	PGC		PORTBbits.RB6	//	NA
//#define	PGD		PORTBbits.RB7	//

//#define	OSC_SPEED 	10000000		// 10 MHz(PIC oscillator speed)
#define	   SYSCLK		12E6
#define OSC_SPEED 32000
#define	USART_BAUD 	19200			// BaudRate
#define	BRGH_HIGH	1				//
#define    USART_SPEED    (((SYSCLK/USART_BAUD)/16)-1)
#define    USART_BRGH        USART_BRGH_HIGH