#ifndef	MAIN_H
#define	MAIN_H

#define	SONY_SIRC_12

#ifdef	SONY_SIRC_12
	#define	INITIAL	0x74
	#define	ZERO	0x1B
	#define	ONE		0x3B
#endif

#define	OSC_FREQ		48000000		// 48 MHz
#define	FREQUENCY		OSC_FREQ / 4	// 12 MHz
#define	BUTTON_INPUT	TRISB = TRISB | 0x01
#define	BUTTON_PRESSED	(~PORTB & 0x01)

#define	TOGGLE_PERIOD	83		// (Fin / 4) / 36 000; Fin = 48MHz / 4 = 12MHz --> 83.(3)
#define	HALF_PERIOD		41		// 83/2 = 41;

#define	OFF				0
#define	ON				1
#define	TOGGLE			2

void DelayMs (volatile unsigned int Ms);

void System_Init (void);

void Clock_Init (void);

void Digital_PIN_Init (void);

void GPIO_Init (void);

void Infrared_Init (void);

void Timer1_Init (void);

void Timer2_Init (void);

void Infrared_Blink_State (char State);

void Infrared_Transmit (char State);

#endif