USB_INT.A51 - common module
; This module declares the variables and constants used in the examples
; It is common to all of the examples
;
; Declare Special Function Registers used
EI		DATA	0A8H
EIE		DATA	0E8H	; EZ-USB specific
EXIF		DATA	091H	; EZ-USB specific
EICON		DATA	0D8H	; EZ-USB specific
PageReg		DATA	092H	; EZ-USB specific, used with MOVX @Ri
DPS		DATA	086H	; EZ-USB specific, used with dual data pointers
;
; "External" memory locations used, EZ-USB specific
; Note that most of these variables are in Page 7FH
SETUPDAT	EQU	07FE8H
SUDPTR		EQU	07FD4H
EP0Control	EQU	07FB4H
EP0InBuffer	EQU	07F00H
EP0OutBuffer	EQU	07EC0H		; Not in Page 7FH
EP1InBuffer	EQU	07E80H		; Not in Page 7FH
IN0ByteCount	EQU	07FB5H
Out0ByteCount	EQU	07FC5H
IN1ByteCount	EQU	07FB7H
IN07IEN		EQU	07FACH
IN07IRQ		EQU	07FA9H
OUT07IEN	EQU	07FADH
OUT07IRQ	EQU	07FAAH
USBIEN		EQU	07FAEH
USBIRQ		EQU	07FABH
USBControl	EQU	07FD6H
I2CData		EQU	07FA6H
I2CControl	EQU	07FA5H
PortA_PINS	EQU	07F99H
PortB_PINS	EQU	07F9AH
PortA_Config	EQU	07F93H
PortB_Config	EQU	07F94H
PortB_OUT	EQU	07F97H
PortA_OE	EQU	07F9CH
PortB_OE	EQU	07F9DH
;
; Byte Variables
		
		DSEG	AT 20H
FLAGS:		DS 	1	; This register is bit-addressable
; Bit Variables
Configured	EQU	FLAGS.0	; Is this device configured
STALL		EQU	FLAGS.1	; Need to STALL endpoint 0
SendData	EQU	FLAGS.2 ; Need to send data to PC Host
IsDescriptor	EQU	FLAGS.3	; Enable a shortcut reply
;
MonitorSpace:	DS	1FH	; Used by Dscope
Temp:		DS	1	; A temporary working register
Idle_Time:	DS	1	; The time the PC host wants us to wait
Expired_Time:	DS	1	; A downcounter for timed Reports
ReplyBuffer:	DS	3	; First byte is Count
;
; Declare the specific variables used by each of the examples
Overlay		EQU	$
Old_Buttons:	DS	1	; Used by BAL: stores current button position
LEDstrobe:	DS	1	; Used by BAL: strobe one LED on at a time
LEDvalue:	DS	1	; Used by BAL: stores current LED value
Msec_Counter:	DS	1	; Used by BAL: counts up to 4 msec

		ORG Overlay	; Overlay the variables (only one set in use at any one time)
I2CDataByte:	DS	1	; Used by I2C: keep a local copy of data read from I2C bus

		ORG Overlay
LightValues:	DS	6	; Used by LP: local buffer for light brightness

		ORG Overlay
LEDBuffer:	DS	42	; Used by RB: local buffer for reader board
;