/*
 *	Header file for the Microchip 
 *	PIC 16C57 chip
 *	Baseline Microcontrollers
 */

static volatile unsigned char	TMR0	@ 0x01;
static volatile unsigned char	RTCC	@ 0x01;
static volatile unsigned char	PCL	@ 0x02;
static volatile unsigned char	STATUS	@ 0x03;
static 		unsigned char	FSR	@ 0x04;
static volatile unsigned char	PORTA	@ 0x05;
static volatile unsigned char	PORTB	@ 0x06;

static 		unsigned char control	OPTION	@ 0x00;
static volatile	unsigned char control	TRISA	@ 0x05;
static volatile	unsigned char control	TRISB	@ 0x06;

/*	STATUS bits	*/
static volatile bit	PA1	@ (unsigned)&STATUS*8+6;
static volatile bit	PA0	@ (unsigned)&STATUS*8+5;
static volatile bit	TO	@ (unsigned)&STATUS*8+4;
static volatile bit	PD	@ (unsigned)&STATUS*8+3;
static volatile bit	ZERO	@ (unsigned)&STATUS*8+2;
static volatile bit	DC	@ (unsigned)&STATUS*8+1;
static volatile bit	CARRY	@ (unsigned)&STATUS*8+0;

/*	OPTION bits	*/
#define	T0CS	(1<<5)
#define	T0SE	(1<<4)
#define	PSA	(1<<3)
#define	PS2	(1<<2)
#define	PS1	(1<<1)
#define	PS0	(1<<0)

/*	PORTA	bits	*/
static volatile bit	RA3	@ (unsigned)&PORTA*8+3;
static volatile bit	RA2	@ (unsigned)&PORTA*8+2;
static volatile bit	RA1	@ (unsigned)&PORTA*8+1;
static volatile bit	RA0	@ (unsigned)&PORTA*8+0;

/*	PORTB bits	*/
static volatile bit	RB7	@ (unsigned)&PORTB*8+7;
static volatile bit	RB6	@ (unsigned)&PORTB*8+6;
static volatile bit	RB5	@ (unsigned)&PORTB*8+5;
static volatile bit	RB4	@ (unsigned)&PORTB*8+4;
static volatile bit	RB3	@ (unsigned)&PORTB*8+3;
static volatile bit	RB2	@ (unsigned)&PORTB*8+2;
static volatile bit	RB1	@ (unsigned)&PORTB*8+1;
static volatile bit	RB0	@ (unsigned)&PORTB*8+0;

static volatile unsigned char		PORTC	@ 0x07;
static volatile	unsigned char control	TRISC	@ 0x07;

/*	PORTC bits	*/
static volatile bit 	RC7	@ (unsigned)&PORTC*8+7;
static volatile bit 	RC6	@ (unsigned)&PORTC*8+6;
static volatile bit 	RC5	@ (unsigned)&PORTC*8+5;
static volatile bit 	RC4	@ (unsigned)&PORTC*8+4;
static volatile bit 	RC3	@ (unsigned)&PORTC*8+3;
static volatile bit 	RC2	@ (unsigned)&PORTC*8+2;
static volatile bit 	RC1	@ (unsigned)&PORTC*8+1;
static volatile bit 	RC0	@ (unsigned)&PORTC*8+0;

#define	CONFIG_ADDR	0xFFF

/*watchdog*/
#define WDTEN		0xFFFF
#define WDTDIS		0xFFFB

/*osc configurations*/
#define RC		0xFFFF
#define HS		0xFFFE
#define XT		0xFFFD
#define LP		0xFFFC

/*code protection*/
#define PROTECT		0xFFF7
#define UNPROTECT	0xFFFF
