
#ifndef	_HTC_H_
#warning Header file cy7c68013.h included directly. Use #include <htc.h> instead.
#endif


 /* header file for the Cypress microcontroller
	CY7C68013
 */

#ifndef	__CY7C68013_H

#define	__CY7C68013_H

typedef struct {
	unsigned B7:1; //This is the most signifigant bit
	unsigned B6:1;
	unsigned B5:1;
	unsigned B4:1;
	unsigned B3:1;
	unsigned B2:1;
	unsigned B1:1;
	unsigned B0:1;
}	SFR_BITS;

//Special Function Registers
static volatile unsigned char IOA	@ 0x80;
static volatile unsigned char SP	@ 0x81;
static volatile unsigned char DPL0	@ 0x82;
static volatile unsigned char DPH0	@ 0x83;
// 16-Bit definition
// Alternate definition
static volatile unsigned char DPL1	@ 0x84;
static volatile unsigned char DPH1	@ 0x85;
// 16-Bit definition
static          unsigned char DPS	@ 0x86;
static volatile unsigned char PCON	@ 0x87;
static volatile unsigned char TCON	@ 0x88;
static          unsigned char TMOD	@ 0x89;
static volatile unsigned char TL0	@ 0x8A;
static volatile unsigned char TL1	@ 0x8B;
static volatile unsigned char TH0	@ 0x8C;
static volatile unsigned char TH1	@ 0x8D;
static          unsigned char CKCON	@ 0x8E;
static volatile unsigned char IOB	@ 0x90;
static volatile unsigned char EXIF	@ 0x91;
static		unsigned char MPAGE	@ 0x92;
static volatile unsigned char SCON0	@ 0x98;
static volatile unsigned char SBUF0	@ 0x99;
static volatile unsigned char AUTOPTRH1	@ 0x9A;
static volatile unsigned char AUTOPTRL1	@ 0x9B;
static volatile unsigned char AUTOPTRH2	@ 0x9D;
static volatile unsigned char AUTOPTRL2	@ 0x9E;
static volatile unsigned char IOC	@ 0xA0;
static volatile unsigned char INT2CLR	@ 0xA1;
static volatile unsigned char INT4CLR	@ 0xA2;
static          unsigned char IE	@ 0xA8;
static volatile unsigned char EP2468STAT	@ 0xAA;
static volatile unsigned char EP24FIFOFLGS	@ 0xAB;
static volatile unsigned char EP68FIFOFLGS	@ 0xAC;
static		unsigned char AUTOPTRSETUP	@ 0xAF;
static volatile unsigned char IOD	@ 0xB0;
static volatile unsigned char IOE	@ 0xB1;
static		unsigned char OEA	@ 0xB2;
static		unsigned char OEB	@ 0xB3;
static		unsigned char OEC	@ 0xB4;
static		unsigned char OED	@ 0xB5;
static		unsigned char OEE	@ 0xB6;
static          unsigned char IP	@ 0xB8;
static volatile unsigned char EP01STAT	@ 0xBA;
static volatile unsigned char GPIFTRIG	@ 0xBB;
static volatile unsigned char GPIFSGLDATH	@ 0xBD;
static volatile unsigned char GPIFSGLDATLX	@ 0xBE;
static volatile unsigned char GPIFSGLDATLNOX	@ 0xBF;
static volatile unsigned char SCON1	@ 0xC0;
static volatile unsigned char SBUF1	@ 0xC1;
static volatile unsigned char T2CON	@ 0xC8;
static volatile unsigned char RCAP2L	@ 0xCA;
static volatile unsigned char RCAP2H	@ 0xCB;
static volatile unsigned char TL2	@ 0xCC;
static volatile unsigned char TH2	@ 0xCD;
static volatile unsigned char PSW	@ 0xD0;
static volatile unsigned char EICON	@ 0xD8;
static volatile unsigned char ACC	@ 0xE0;
static          unsigned char EIE	@ 0xE8;
static volatile unsigned char B		@ 0xF0;
static          unsigned char EIP	@ 0xF8;

static volatile SFR_BITS	 IOA_BITS	@ 0x80;
static          SFR_BITS	 DPS_BITS	@ 0x86;
static volatile SFR_BITS	 PCON_BITS	@ 0x87;
static volatile SFR_BITS	 TCON_BITS	@ 0x88;
static          SFR_BITS	 TMOD_BITS	@ 0x89;
static          SFR_BITS	 CKCON_BITS	@ 0x8E;
static volatile SFR_BITS	 IOB_BITS	@ 0x90;
static volatile SFR_BITS	 EXIF_BITS	@ 0x91;
static volatile SFR_BITS	 SCON0_BITS	@ 0x98;
static volatile SFR_BITS	 IOC_BITS	@ 0xA0;
static          SFR_BITS	 IE_BITS	@ 0xA8;
static volatile SFR_BITS	 EP2468STAT_BITS	@ 0xAA;
static volatile SFR_BITS	 EP24FIFOFLGS_BITS	@ 0xAB;
static volatile SFR_BITS	 EP68FIFOFLGS_BITS	@ 0xAC;
static		SFR_BITS	 AUTOPTRSETUP_BITS	@ 0xAF;
static volatile SFR_BITS	 IOD_BITS	@ 0xB0;
static volatile SFR_BITS	 IOE_BITS	@ 0xB1;
static		SFR_BITS	 OEA_BITS	@ 0xB2;
static		SFR_BITS	 OEB_BITS	@ 0xB3;
static		SFR_BITS	 OEC_BITS	@ 0xB4;
static		SFR_BITS	 OED_BITS	@ 0xB5;
static		SFR_BITS	 OEE_BITS	@ 0xB6;
static          SFR_BITS	 IP_BITS	@ 0xB8;
static volatile SFR_BITS	 EP01STAT_BITS	@ 0xBA;
static volatile SFR_BITS	 GPIFTRIG_BITS	@ 0xBB;
static volatile SFR_BITS	 SCON1_BITS	@ 0xC0;
static volatile SFR_BITS	 T2CON_BITS	@ 0xC8;
static volatile SFR_BITS	 PSW_BITS	@ 0xD0;
static volatile SFR_BITS	 EICON_BITS	@ 0xD8;
static volatile SFR_BITS	 ACC_BITS	@ 0xE0;
static          SFR_BITS	 EIE_BITS	@ 0xE8;
static volatile SFR_BITS	 B_BITS		@ 0xF0;
static          SFR_BITS	 EIP_BITS	@ 0xF8;

// USB related registers and buffers
static volatile xdata unsigned char 	WAVEDATA[128]	@ 0xE400;	// GPIF Waveform Descriptor 0, 1, 2, 3 data
static volatile xdata unsigned char	CPUCS		@ 0xE600;	// CPU Control & Status
static volatile xdata unsigned char	IFCONFIG	@ 0xE601;	// Interface Configuration (Ports, GPIF, slave FIFOs)
static volatile xdata unsigned char	PINFLAGSAB	@ 0xE602;	// Slave FIFO FLAGA and FLAGB Pin Configuration
static volatile xdata unsigned char	PINFLAGSCD	@ 0xE603;	// Slave FIFO FLAGC and FLAGD Pin Configuration
static volatile xdata unsigned char	FIFORESET	@ 0xE604;	// Restore FIFOS to default state
static volatile xdata unsigned char	BREAKPT		@ 0xE605;	// Breakpoint Control
static volatile xdata unsigned char	BPADDRH		@ 0xE606;	// Breakpoint Address H
static volatile xdata unsigned char	BPADDRL		@ 0xE607;	// Breakpoint Address L
static volatile xdata unsigned char	UART230		@ 0xE608;	// 230 Kbaud internally generated ref. clock
static volatile xdata unsigned char	FIFOPINPOLAR	@ 0xE609;	// Slave FIFO Interface pins polarity
static volatile xdata unsigned char	REVID		@ 0xE60A;	// Chip Revision
static volatile xdata unsigned char	REVCTL		@ 0xE60B;	// Chip Revision Control
static volatile xdata unsigned char	GPIFHOLDTIME	@ 0xE60C;	// MSTB Hold Time (for UDMA)
static volatile xdata unsigned char	EP1OUTCFG	@ 0xE610;	// Endpoint 1-OUT Configuration
static volatile xdata unsigned char	EP1INCFG	@ 0xE611;	// Endpoint 1-IN Configuration
static volatile xdata unsigned char	EP2CFG		@ 0xE612;	// Endpoint 2 Configuration
static volatile xdata unsigned char	EP4CFG		@ 0xE613;	// Endpoint 4 Configuration
static volatile xdata unsigned char	EP6CFG		@ 0xE614;	// Endpoint 6 Configuration
static volatile xdata unsigned char	EP8CFG		@ 0xE615;	// Endpoint 8 Configuration
static volatile xdata unsigned char	EP2FIFOCFG	@ 0xE618;	// Endpoint 2 / slave FIFO configuration
static volatile xdata unsigned char	EP4FIFOCFG	@ 0xE619;	// Endpoint 4 / slave FIFO configuration
static volatile xdata unsigned char	EP6FIFOCFG	@ 0xE61A;	// Endpoint 6 / slave FIFO configuration
static volatile xdata unsigned char	EP8FIFOCFG	@ 0xE61B;	// Endpoint 8 / slave FIFO configuration
static volatile xdata unsigned char	EP2AUTOINLENH	@ 0xE620;	// Endpoint 2 AUTOIN Packet Length H
static volatile xdata unsigned char	EP2AUTOINLENL	@ 0xE621;	// Endpoint 2 AUTOIN Packet Length L
static volatile xdata unsigned char	EP4AUTOINLENH	@ 0xE622;	// Endpoint 4 AUTOIN Packet Length H
static volatile xdata unsigned char	EP4AUTOINLENL	@ 0xE623;	// Endpoint 4 AUTOIN Packet Length L
static volatile xdata unsigned char	EP6AUTOINLENH	@ 0xE624;	// Endpoint 6 AUTOIN Packet Length H
static volatile xdata unsigned char	EP6AUTOINLENL	@ 0xE625;	// Endpoint 6 AUTOIN Packet Length L
static volatile xdata unsigned char	EP8AUTOINLENH	@ 0xE626;	// Endpoint 8 AUTOIN Packet Length H
static volatile xdata unsigned char	EP8AUTOINLENL	@ 0xE627;	// Endpoint 8 AUTOIN Packet Length L
static volatile xdata unsigned char	EP2FIFOPFH	@ 0xE630;	// Endpoint 2 / slave FIFO Programmable Flag H
static volatile xdata unsigned char	EP2FIFOPFL	@ 0xE631;	// Endpoint 2 / slave FIFO Programmable Flag L
static volatile xdata unsigned char	EP4FIFOPFH	@ 0xE632;	// Endpoint 4 / slave FIFO Programmable Flag H
static volatile xdata unsigned char	EP4FIFOPFL	@ 0xE633;	// Endpoint 4 / slave FIFO Programmable Flag L
static volatile xdata unsigned char	EP6FIFOPFH	@ 0xE634;	// Endpoint 6 / slave FIFO Programmable Flag H
static volatile xdata unsigned char	EP6FIFOPFL	@ 0xE635;	// Endpoint 6 / slave FIFO Programmable Flag L
static volatile xdata unsigned char	EP8FIFOPFH	@ 0xE636;	// Endpoint 8 / slave FIFO Programmable Flag H
static volatile xdata unsigned char	EP8FIFOPFL	@ 0xE637;	// Endpoint 8 / slave FIFO Programmable Flag L
static volatile xdata unsigned char	EP2ISOINPKTS	@ 0xE640;	// EP2 (if ISO) IN Packets per frame (1-3)
static volatile xdata unsigned char	EP4ISOINPKTS	@ 0xE641;	// EP4 (if ISO) IN Packets per frame (1-3)
static volatile xdata unsigned char	EP6ISOINPKTS	@ 0xE642;	// EP6 (if ISO) IN Packets per frame (1-3)
static volatile xdata unsigned char	EP8ISOINPKTS	@ 0xE643;	// EP8 (if ISO) IN Packets per frame (1-3)
static volatile xdata unsigned char	INPKTEND	@ 0xE648;	// Force IN Packet End
static volatile xdata unsigned char	OUTPKTEND[7]	@ 0xE649;	// Force OUT Packet End
static volatile xdata unsigned char	EP2FIFOIE	@ 0xE650;	// Endpoint 2 slave FIFO Flag Interrupt Enable
static volatile xdata unsigned char	EP2FIFOIRQ	@ 0xE651;	// Endpoint 2 slave FIFO Flag Interrupt Request
static volatile xdata unsigned char	EP4FIFOIE	@ 0xE652;	// Endpoint 4 slave FIFO Flag Interrupt Enable
static volatile xdata unsigned char	EP4FIFOIRQ	@ 0xE653;	// Endpoint 4 slave FIFO Flag Interrupt Request
static volatile xdata unsigned char	EP6FIFOIE	@ 0xE654;	// Endpoint 6 slave FIFO Flag Interrupt Enable
static volatile xdata unsigned char	EP6FIFOIRQ	@ 0xE655;	// Endpoint 6 slave FIFO Flag Interrupt Request
static volatile xdata unsigned char	EP8FIFOIE	@ 0xE656;	// Endpoint 8 slave FIFO Flag Interrupt Enable
static volatile xdata unsigned char	EP8FIFOIRQ	@ 0xE657;	// Endpoint 8 slave FIFO Flag Interrupt Request
static volatile xdata unsigned char	IBNIE		@ 0xE658;	// IN-BULK-NAK Interrupt Enable
static volatile xdata unsigned char	IBNIRQ		@ 0xE659;	// IN-BULK-NAK interrupt Request
static volatile xdata unsigned char	NAKIE		@ 0xE65A;	// Endpoint Ping-NAK / IBN Interrupt Enable
static volatile xdata unsigned char	NAKIRQ		@ 0xE65B;	// Endpoint Ping-NAK / IBN Interrupt Request
static volatile xdata unsigned char	USBIE		@ 0xE65C;	// USB Int Enables
static volatile xdata unsigned char	USBIRQ		@ 0xE65D;	// USB Interrupt Requests
static volatile xdata unsigned char	EPIE		@ 0xE65E;	// Endpoint Interrupt Enables
static volatile xdata unsigned char	EPIRQ		@ 0xE65F;	// Endpoint Interrupt Requests
static volatile xdata unsigned char	GPIFIE		@ 0xE660;	// GPIF Interrupt Enable
static volatile xdata unsigned char	GPIFIRQ		@ 0xE661;	// GPIF Interrupt Request
static volatile xdata unsigned char	USBERRIE	@ 0xE662;	// USB Error Interrupt Enables
static volatile xdata unsigned char	USBERRIRQ	@ 0xE663;	// USB Error Interrupt Requests
static volatile xdata unsigned char	ERRCNTLIM	@ 0xE664;	// USB Error counter and limit
static volatile xdata unsigned char	CLRERRCNT	@ 0xE665;	// Clear Error Counter EC3:0
static volatile xdata unsigned char	INT2IVEC	@ 0xE666;	// Interrupt 2 (USB) Autovector
static volatile xdata unsigned char	INT4IVEC	@ 0xE667;	// Interrupt 4 (slave FIFO & GPIF) Autovector
static volatile xdata unsigned char	INTSETUP	@ 0xE668;	// Interrupt 2&4 Setup
static volatile xdata unsigned char	PORTACFG	@ 0xE670;	// I/O PORTA Alternate Configuration
static volatile xdata unsigned char	PORTCCFG	@ 0xE671;	// I/O PORTC Alternate Configuration
static volatile xdata unsigned char	PORTECFG	@ 0xE672;	// I/O PORTE Alternate Configuration
static volatile xdata unsigned char	I2CS		@ 0xE678;	// I²C-Compatible Bus Control & Status
static volatile xdata unsigned char	I2DAT		@ 0xE679;	// I²C-Compatible Bus Data
static volatile xdata unsigned char	I2CTL		@ 0xE67A;	// I²C-Compatible Bus Control
static volatile xdata unsigned char	XAUTODAT1	@ 0xE67B;	// Autoptr1 MOVX access, when APTREN=1
static volatile xdata unsigned char	XAUTODAT2	@ 0xE67C;	// Autoptr2 MOVX access, when APTREN=1
static volatile xdata unsigned char	UDMACRCH	@ 0xE67D;	// UDMA CRC MSB
static volatile xdata unsigned char	UDMACRCL	@ 0xE67E;	// UDMA CRC LSB
static volatile xdata unsigned char	UDMACRCQUALIFIER @ 0xE67F;	// UDMA CRC Qualifier
static volatile xdata unsigned char	USBCS		@ 0xE680;	// USB Control & Status
static volatile xdata unsigned char	SUSPEND		@ 0xE681;	// Put chip into suspend
static volatile xdata unsigned char	WAKEUPCS	@ 0xE682;	// Wakeup Control & Status
static volatile xdata unsigned char	TOGCTL		@ 0xE683;	// Toggle Control
static volatile xdata unsigned char	USBFRAMEH	@ 0xE684;	// USB Frame count H
static volatile xdata unsigned char	USBFRAMEL	@ 0xE685;	// USB Frame count L
static volatile xdata unsigned char	MICROFRAME	@ 0xE686;	// Microframe count, 0-7
static volatile xdata unsigned char	FNADDR		@ 0xE687;	// USB Function address
static volatile xdata unsigned char	EP0BCH		@ 0xE68A;	// Endpoint 0 Byte Count H
static volatile xdata unsigned char	EP0BCL		@ 0xE68B;	// Endpoint 0 Byte Count L
static volatile xdata unsigned char	EP1OUTBC	@ 0xE68D;	// Endpoint 1 OUT Byte Count
static volatile xdata unsigned char	EP1INBC		@ 0xE68F;	// Endpoint 1 IN Byte Count
static volatile xdata unsigned char	EP2BCH		@ 0xE690;	// Endpoint 2 Byte Count H
static volatile xdata unsigned char	EP2BCL		@ 0xE691;	// Endpoint 2 Byte Count L
static volatile xdata unsigned char	EP4BCH		@ 0xE694;	// Endpoint 4 Byte Count H
static volatile xdata unsigned char	EP4BCL		@ 0xE695;	// Endpoint 4 Byte Count L
static volatile xdata unsigned char	EP6BCH		@ 0xE698;	// Endpoint 6 Byte Count H
static volatile xdata unsigned char	EP6BCL		@ 0xE699;	// Endpoint 6 Byte Count L
static volatile xdata unsigned char	EP8BCH		@ 0xE69C;	// Endpoint 8 Byte Count H
static volatile xdata unsigned char	EP8BCL		@ 0xE69D;	// Endpoint 8 Byte Count L
static volatile xdata unsigned char	EP0CS		@ 0xE6A0;	// Endpoint 0 Control and Status
static volatile xdata unsigned char	EP1OUTCS	@ 0xE6A1;	// Endpoint 1 OUT Control and Status
static volatile xdata unsigned char	EP1INCS		@ 0xE6A2;	// Endpoint 1 IN Control and Status
static volatile xdata unsigned char	EP2CS		@ 0xE6A3;	// Endpoint 2 Control and Status
static volatile xdata unsigned char	EP4CS		@ 0xE6A4;	// Endpoint 4 Control and Status
static volatile xdata unsigned char	EP6CS		@ 0xE6A5;	// Endpoint 6 Control and Status
static volatile xdata unsigned char	EP8CS		@ 0xE6A6;	// Endpoint 8 Control and Status
static volatile xdata unsigned char	EP2FIFOFLGS	@ 0xE6A7;	// Endpoint 2 slave FIFO Flags
static volatile xdata unsigned char	EP4FIFOFLGS	@ 0xE6A8;	// Endpoint 4 slave FIFO Flags
static volatile xdata unsigned char	EP6FIFOFLGS	@ 0xE6A9;	// Endpoint 6 slave FIFO Flags
static volatile xdata unsigned char	EP8FIFOFLGS	@ 0xE6AA;	// Endpoint 8 slave FIFO Flags
static volatile xdata unsigned char	EP2FIFOBCH	@ 0xE6AB;	// Endpoint 2 slave FIFO total byte count H
static volatile xdata unsigned char	EP2FIFOBCL	@ 0xE6AC;	// Endpoint 2 slave FIFO total byte count L
static volatile xdata unsigned char	EP4FIFOBCH	@ 0xE6AD;	// Endpoint 4 slave FIFO total byte count H
static volatile xdata unsigned char	EP4FIFOBCL	@ 0xE6AE;	// Endpoint 4 slave FIFO total byte count L
static volatile xdata unsigned char	EP6FIFOBCH	@ 0xE6AF;	// Endpoint 6 slave FIFO total byte count H
static volatile xdata unsigned char	EP6FIFOBCL	@ 0xE6B0;	// Endpoint 6 slave FIFO total byte count L
static volatile xdata unsigned char	EP8FIFOBCH	@ 0xE6B1;	// Endpoint 8 slave FIFO total byte count H
static volatile xdata unsigned char	EP8FIFOBCL	@ 0xE6B2;	// Endpoint 8 slave FIFO total byte count L
static volatile xdata unsigned char	SUDPTRH		@ 0xE6B3;	// Setup Data Pointer high address byte
static volatile xdata unsigned char	SUDPTRL		@ 0xE6B4;	// Setup Data Pointer low address byte
static volatile xdata unsigned char	SUDPTRCTL	@ 0xE6B5;	// Setup Data Pointer Auto Mode
static volatile xdata unsigned char	SETUPDAT[8]	@ 0xE6B8;	// 8 bytes of SETUP data
static volatile xdata unsigned char	GPIFWFSELECT	@ 0xE6C0;	// Waveform Selector
static volatile xdata unsigned char	GPIFIDLECS	@ 0xE6C1;	// GPIF Done, GPIF IDLE drive mode
static volatile xdata unsigned char	GPIFIDLECTL	@ 0xE6C2;	// Inactive Bus, CTL states
static volatile xdata unsigned char	GPIFCTLCFG	@ 0xE6C3;	// CTL Drive Type
static volatile xdata unsigned char	GPIFADRH	@ 0xE6C4;	// GPIF Address H
static volatile xdata unsigned char	GPIFADRL	@ 0xE6C5;	// GPIF Address L
static volatile xdata unsigned char	FLOWSTATE	@ 0xE6C6;	// Flowstate Enable and Selector
static volatile xdata unsigned char	FLOWLOGIC	@ 0xE6C7;	// Flowstate Logic
static volatile xdata unsigned char	FLOWEQ0CTL	@ 0xE6C8;	// CTL-Pin States in Flowstate (when Logic = 0)
static volatile xdata unsigned char	FLOWEQ1CTL	@ 0xE6C9;	// CTL-Pin States in Flowstate (when Logic = 1)
static volatile xdata unsigned char	FLOWHOLDOFF	@ 0xE6CA;	// Holdoff Configuration
static volatile xdata unsigned char	FLOWSTB		@ 0xE6CB;	// Flowstate Strobe Configuration
static volatile xdata unsigned char	FLOWSTBEDGE	@ 0xE6CC;	// Flowstate Rising/Falling Edge Configuration
static volatile xdata unsigned char	FLOWSTBPERIOD	@ 0xE6CD;	// Master-Strobe Half-Period
static volatile xdata unsigned char	GPIFTCB3	@ 0xE6CE;	// GPIF Transaction Count Byte 3
static volatile xdata unsigned char	GPIFTCB2	@ 0xE6CF;	// GPIF Transaction Count Byte 2
static volatile xdata unsigned char	GPIFTCB1	@ 0xE6D0;	// GPIF Transaction Count Byte 1
static volatile xdata unsigned char	GPIFTCB0	@ 0xE6D1;	// GPIF Transaction Count Byte 0
static volatile xdata unsigned char	EP2GPIFFLGSEL	@ 0xE6D2;	// Endpoint 2 GPIF Flag select
static volatile xdata unsigned char	EP2GPIFPFSTOP	@ 0xE6D3;	// Endpoint 2 GPIF stop transaction on prog. flag
static volatile xdata unsigned char	EP2GPIFTRIG	@ 0xE6D4;	// Endpoint 2 GPIF Trigger
static volatile xdata unsigned char	EP4GPIFFLGSEL	@ 0xE6DA;	// Endpoint 4 GPIF Flag select
static volatile xdata unsigned char	EP4GPIFPFSTOP	@ 0xE6DB;	// Endpoint 4 GPIF stop transaction on GPIF Flag
static volatile xdata unsigned char	EP4GPIFTRIG	@ 0xE6DC;	// Endpoint 4 GPIF Trigger
static volatile xdata unsigned char	EP6GPIFFLGSEL	@ 0xE6E2;	// Endpoint 6 GPIF Flag select
static volatile xdata unsigned char	EP6GPIFPFSTOP	@ 0xE6E3;	// Endpoint 6 GPIF stop transaction on prog. flag
static volatile xdata unsigned char	EP6GPIFTRIG	@ 0xE6E4;	// Endpoint 6 GPIF Trigger
static volatile xdata unsigned char	EP8GPIFFLGSEL	@ 0xE6EA;	// Endpoint 8 GPIF Flag select
static volatile xdata unsigned char	EP8GPIFPFSTOP	@ 0xE6EB;	// Endpoint 8 GPIF stop transaction on prog. flag
static volatile xdata unsigned char	EP8GPIFTRIG	@ 0xE6EC;	// Endpoint 8 GPIF Trigger
static volatile xdata unsigned char	XGPIFSGLDATH	@ 0xE6F0;	// GPIF Data H (16-bit mode only)
static volatile xdata unsigned char	XGPIFSGLDATLX	@ 0xE6F1;	// Read/Write GPIF Data L & trigger transaction
static volatile xdata unsigned char	XGPIFSGLDATLNOX	@ 0xE6F2;	// Read GPIF Data L, no transaction trigger
static volatile xdata unsigned char	GPIFREADYCFG	@ 0xE6F3;	// Internal RDY, Sync/Async, RDY pin states
static volatile xdata unsigned char	GPIFREADYSTAT	@ 0xE6F4;	// GPIF Ready Status
static volatile xdata unsigned char	GPIFABORT	@ 0xE6F5;	// Abort GPIF Waveforms
static volatile xdata unsigned char	EP0BUF[64]	@ 0xE740;	// EP0-IN/-OUT buffer
static volatile xdata unsigned char	EP10UTBUF[64]	@ 0xE780;	// EP1-OUT buffer
static volatile xdata unsigned char	EP1INBUF[64]	@ 0xE7C0;	// EP1-IN buffer
static volatile xdata unsigned char	EP2FIFOBUF[1024] @ 0xF000;	// 512/1024-byte EP 2 / slave FIFO buffer (IN or OUT)
static volatile xdata unsigned char	EP4FIFOBUF[512]	@ 0xF400;	// 512 byte EP 4 / slave FIFO buffer (IN or OUT)
static volatile xdata unsigned char	EP6FIFOBUF[1024] @ 0xF800;	// 512/1024-byte EP 6 / slave FIFO buffer (IN or OUT)
static volatile xdata unsigned char	EP8FIFOBUF[512]	@ 0xFC00;	// 512 byte EP 8 / slave FIFO buffer (IN or OUT)

// Bit Addressable Locations
// definitions for register IOA
static volatile bit	IOA0	@ 0x80;
static volatile bit	IOA1	@ 0x81;
static volatile bit	IOA2	@ 0x82;
static volatile bit	IOA3	@ 0x83;
static volatile bit	IOA4	@ 0x84;
static volatile bit	IOA5	@ 0x85;
static volatile bit	IOA6	@ 0x86;
static volatile bit	IOA7	@ 0x87;

// Timer Control TCON
static 		bit	IT0	@ 0x88;
static volatile bit	IE0	@ 0x89;
static 		bit	IT1	@ 0x8A;
static volatile bit	IE1	@ 0x8B;
static 		bit	TR0	@ 0x8C;
static volatile bit	TF0	@ 0x8D;
static 		bit	TR1	@ 0x8E;
static volatile bit	TF1	@ 0x8F;

// definitions for register IOB
static volatile bit	IOB0	@ 0x90;
static volatile bit	IOB1	@ 0x91;
static volatile bit	IOB2	@ 0x92;
static volatile bit	IOB3	@ 0x93;
static volatile bit	IOB4	@ 0x94;
static volatile bit	IOB5	@ 0x95;
static volatile bit	IOB6	@ 0x96;
static volatile bit	IOB7	@ 0x97;

// Serial Control Register 0 SCON0
static volatile bit	RI_0	@ 0x98;
static volatile bit	TI_0	@ 0x99;
static volatile bit	RB8_0	@ 0x9A;
static 		bit	TB8_0	@ 0x9B;
static 		bit	REN_0	@ 0x9C;
static 		bit	SM2_0	@ 0x9D;
static 		bit	SM1_0	@ 0x9E;
static 		bit	SM0_0	@ 0x9F;

// definitions for register IOC
static volatile bit	IOC0	@ 0xA0;
static volatile bit	IOC1	@ 0xA1;
static volatile bit	IOC2	@ 0xA2;
static volatile bit	IOC3	@ 0xA3;
static volatile bit	IOC4	@ 0xA4;
static volatile bit	IOC5	@ 0xA5;
static volatile bit	IOC6	@ 0xA6;
static volatile bit	IOC7	@ 0xA7;

// Interrupt Enable IE
static		bit	EX0	@ 0xA8;
static		bit	ET0	@ 0xA9;
static		bit	EX1	@ 0xAA;
static		bit	ET1	@ 0xAB;
static 		bit	ES0	@ 0xAC;
static		bit	ET2	@ 0xAD;
static 		bit	ES1	@ 0xAE;
static 		bit	EA	@ 0xAF;

// definitions for register IOD
static volatile bit	IOD0	@ 0xB0;
static volatile bit	IOD1	@ 0xB1;
static volatile bit	IOD2	@ 0xB2;
static volatile bit	IOD3	@ 0xB3;
static volatile bit	IOD4	@ 0xB4;
static volatile bit	IOD5	@ 0xB5;
static volatile bit	IOD6	@ 0xB6;
static volatile bit	IOD7	@ 0xB7;

// Interrupt Priority
static 		bit	PX0	@ 0xB8;
static 		bit	PT0	@ 0xB9;
static 		bit	PX1	@ 0xBA;
static 		bit	PT1	@ 0xBB;
static 		bit	PS0	@ 0xBC;
static 		bit	PT2	@ 0xBD;
static 		bit	PS1	@ 0xBE;

// Serial Control 1 SCON1
static volatile	bit	RI_1	@ 0xC0;
static volatile	bit	TI_1	@ 0xC1;
static volatile	bit	RB8_1	@ 0xC2;
static 		bit	TB8_1	@ 0xC3;
static 		bit	REN_1	@ 0xC4;
static 		bit	SM2_1	@ 0xC5;
static 		bit	SM1_1	@ 0xC6;
static volatile	bit	SM0_1	@ 0xC7;

// Timer 2 Control T2CON
static 		bit	CPRL2	@ 0xC8;
static 		bit	CT2	@ 0xC9;
static 		bit	TR2	@ 0xCA;
static 		bit	EXEN2	@ 0xCB;
static		bit	TCLK	@ 0xCC;
static		bit	RCLK	@ 0xCD;
static volatile	bit	EXF2	@ 0xCE;
static volatile	bit	TF2	@ 0xCF;

// Program Status Word PSW
static volatile bit	P	@ 0xD0;
static volatile bit	F1	@ 0xD1;
static volatile bit	OV	@ 0xD2;
static 		bit	RS0	@ 0xD3;
static 		bit	RS1	@ 0xD4;
static volatile bit	F0	@ 0xD5;
static volatile bit	AC	@ 0xD6;
static volatile bit	CY	@ 0xD7;

// Extended Interrupt Control EICON
static volatile bit	INT6	@ 0xDB;
static volatile bit	RESI	@ 0xDC;
static		bit	ERESI	@ 0xDD;
static		bit	SMOD1	@ 0xDF;

// Accumulator ACC
static volatile bit	ACC0	@ 0xE0;
static volatile bit	ACC1	@ 0xE1;
static volatile bit	ACC2	@ 0xE2;
static volatile bit	ACC3	@ 0xE3;
static volatile bit	ACC4	@ 0xE4;
static volatile bit	ACC5	@ 0xE5;
static volatile bit	ACC6	@ 0xE6;
static volatile bit	ACC7	@ 0xE7;

// External Interrupt Control EIE
static		bit	EUSB	@ 0xE8;
static		bit	EI2C	@ 0xE9;
static		bit	EX4	@ 0xEA;
static		bit	EX5	@ 0xEB;
static		bit	EX6	@ 0xEC;

// B register
static volatile bit	B0	@ 0xF0;
static volatile bit	B1	@ 0xF1;
static volatile bit	B2	@ 0xF2;
static volatile bit	B3	@ 0xF3;
static volatile bit	B4	@ 0xF4;
static volatile bit	B5	@ 0xF5;
static volatile bit	B6	@ 0xF6;
static volatile bit	B7	@ 0xF7;

// Extended Interrupt Priority EIP
static		bit	PUSB	@ 0xF8;
static		bit	PI2C	@ 0xF9;
static		bit	PX4	@ 0xFA;
static		bit	PX5	@ 0xFB;
static		bit	PX6	@ 0xFC;


// Interrupt Vectors
#define	RESET	0
#define	EXTINT0	0x03
#define TIMER0	0x0B
#define	EXTINT1	0x13
#define	TIMER1	0x1B
#define	SERIAL	0x23
#define	TIMER2	0x2B

#endif
