;;-----------------------------------------------------------------------------
;;	File:		dscr.asm
;;	Contents:	This file contains descriptor data tables.  
;;
;;	Copyright (c) 1997 AnchorChips, Inc. All rights reserved
;;-----------------------------------------------------------------------------

.module DSCR

DSCR_DEVICE	=	1	;; Descriptor type: Device
DSCR_CONFIG	=	2	;; Descriptor type: Configuration
DSCR_STRING	=	3	;; Descriptor type: String
DSCR_INTRFC	=	4	;; Descriptor type: Interface
DSCR_ENDPNT	=	5	;; Descriptor type: Endpoint

ET_CONTROL	=	0	;; Endpoint type: Control
ET_ISO		=	1	;; Endpoint type: Isochronous
ET_BULK		=	2	;; Endpoint type: Bulk
ET_INT		=	3	;; Endpoint type: Interrupt

.globl	_DeviceDscr, _ConfigDscr, _StringDscr, _UserDscr

.area	CSEG	(CODE)

;;-----------------------------------------------------------------------------
;; Global Variables
;;-----------------------------------------------------------------------------

_DeviceDscr:
DeviceDscr:
	.db	deviceDscrEnd - DeviceDscr		;; Descriptor length
	.db	DSCR_DEVICE						;; Decriptor type
	.dw	0x0001							;; Specification Version (BCD)
	.db	0x00  							;; Device class
	.db	0x00							;; Device sub-class
	.db	0x00							;; Device sub-sub-class
	.db	64								;; Maximum packet size
	.dw	0x4705							;; Vendor ID
	.dw	0x0210							;; Product ID
	.dw	0x0100							;; Product version ID
	.db	1								;; Manufacturer string index
	.db	2								;; Product string index
	.db	0								;; Serial number string index
	.db	1								;; Number of configurations
deviceDscrEnd:

_ConfigDscr:	
ConfigDscr:	
	.db	ConfigDscrEnd-ConfigDscr		;; Descriptor length
	.db	DSCR_CONFIG						;; Descriptor type
	.db	StringDscr-ConfigDscr			;; Configuration + End Points length (LSB)
	.db	(StringDscr-ConfigDscr)/256		;; Configuration + End Points length (MSB)
	.db	1								;; Number of interfaces
	.db	1								;; Interface number
	.db	0								;; Configuration string
	.db	0b10100000						;; Attributes (b7 - buspwr, b6 - selfpwr, b5 - rwu)
	.db	0								;; Power requirement (div 2 ma)
ConfigDscrEnd:

IntrfcDscr:
	.db	IntrfcDscrEnd-IntrfcDscr		;; Descriptor length
	.db	DSCR_INTRFC						;; Descriptor type
	.db	0								;; Zero-based index of this interface
	.db	0								;; Alternate setting
	.db	6								;; Number of end points 
	.db	0xff							;; Interface class
	.db	0x00							;; Interface sub class
	.db	0x00							;; Interface sub sub class
	.db	0								;; Interface descriptor string index
IntrfcDscrEnd:

EpO1Dscr:
	.db	EpO1DscrEnd-EpO1Dscr	;; Descriptor length
	.db	DSCR_ENDPNT				;; Descriptor type
	.db	0x01					;; Endpoint number, and direction
	.db	ET_BULK					;; Endpoint type
	.db	0x40					;; Maximun packet size (LSB)
	.db	0x00					;; Max packect size (MSB)
	.db	0x00					;; Polling interval
EpO1DscrEnd:

EpO2Dscr:
	.db	EpO2DscrEnd-EpO2Dscr	;; Descriptor length
	.db	DSCR_ENDPNT				;; Descriptor type
	.db	0x02					;; Endpoint number, and direction
	.db	ET_BULK					;; Endpoint type
	.db	0x40					;; Maximun packet size (LSB)
	.db	0x00					;; Max packect size (MSB)
	.db	0x00					;; Polling interval
EpO2DscrEnd:

EpO4Dscr:
	.db	EpO2DscrEnd-EpO2Dscr	;; Descriptor length
	.db	DSCR_ENDPNT				;; Descriptor type
	.db	0x04					;; Endpoint number, and direction
	.db	ET_BULK					;; Endpoint type
	.db	0x40					;; Maximun packet size (LSB)
	.db	0x00					;; Max packect size (MSB)
	.db	0x00					;; Polling interval
EpO4DscrEnd:

EpI1Dscr:
	.db	EpI1DscrEnd-EpI1Dscr	;; Descriptor length
	.db	DSCR_ENDPNT				;; Descriptor type
	.db	0x81					;; Endpoint number, and direction
	.db	ET_BULK					;; Endpoint type
	.db	0x40					;; Maximun packet size (LSB)
	.db	0x00					;; Max packect size (MSB)
	.db	0x00					;; Polling interval
EpI1DscrEnd:

EpI2Dscr:
	.db	EpI2DscrEnd-EpI2Dscr	;; Descriptor length
	.db	DSCR_ENDPNT				;; Descriptor type
	.db	0x82					;; Endpoint number, and direction
	.db	ET_BULK					;; Endpoint type
	.db	0x40					;; Maximun packet size (LSB)
	.db	0x00					;; Max packect size (MSB)
	.db	0x00					;; Polling interval
EpI2DscrEnd:

EpI4Dscr:
	.db	EpI4DscrEnd-EpI4Dscr	;; Descriptor length
	.db	DSCR_ENDPNT				;; Descriptor type
	.db	0x84					;; Endpoint number, and direction
	.db	ET_BULK					;; Endpoint type
	.db	0x40					;; Maximun packet size (LSB)
	.db	0x00					;; Max packect size (MSB)
	.db	0x00					;; Polling interval
EpI4DscrEnd:

_StringDscr:
StringDscr:
StringDscr0:
	.db	StringDscr0End-StringDscr0		;; String descriptor length
	.db	DSCR_STRING
	.db	0x09,0x04
StringDscr0End:

StringDscr1:	
	.db	StringDscr1End-StringDscr1		;; String descriptor length
	.db	DSCR_STRING
	.ascii 'R'
	.db 0x00
	.ascii 'G'
	.db	0x00
	.ascii 'I'
	.db	0x00
	.ascii 'O'
	.db	0x00
StringDscr1End:

StringDscr2:	
	.db	StringDscr2End-StringDscr2		;; Descriptor length
	.db	DSCR_STRING
	.ascii 'V'
	.db	0x00
	.ascii '1'
	.db	0x00
	.ascii '0'
	.db	0x00
	.ascii '0'
	.db	0x00
StringDscr2End:

_UserDscr:
UserDscr:
	.dw	0x0000

