;;-----------------------------------------------------------------------------
;;   File:      dscr.a51
;;   Contents:  This file contains descriptor data tables.
;;
;; $Archive: /USB/Examples/Fx2lp/bulkloop/dscr.a51 $
;; $Date: 9/01/03 8:51p $
;; $Revision: 3 $
;;
;;
;;-----------------------------------------------------------------------------
;; Copyright 2003, Cypress Semiconductor Corporation
;;-----------------------------------------------------------------------------;;-----------------------------------------------------------------------------
   
DSCR_DEVICE   equ   1   ;; Descriptor type: Device
DSCR_CONFIG   equ   2   ;; Descriptor type: Configuration
DSCR_STRING   equ   3   ;; Descriptor type: String
DSCR_INTRFC   equ   4   ;; Descriptor type: Interface
DSCR_ENDPNT   equ   5   ;; Descriptor type: Endpoint
DSCR_DEVQUAL  equ   6   ;; Descriptor type: Device Qualifier

DSCR_DEVICE_LEN   equ   18
DSCR_CONFIG_LEN   equ    9
DSCR_INTRFC_LEN   equ    9
DSCR_ENDPNT_LEN   equ    7
DSCR_DEVQUAL_LEN  equ   10

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

public      DeviceDscr, HighSpeedConfigDscr, StringDscr, UserDscr

DSCR   SEGMENT   CODE PAGE

;;-----------------------------------------------------------------------------
;; Global Variables
;;-----------------------------------------------------------------------------
      rseg DSCR      ;; locate the descriptor table in on-part memory.

;; Device Descriptor
DeviceDscr:   
      db   12H      			;; Descriptor length
      db   01H	   				;; Decriptor type
      dw   0002H      			;; Specification Version (BCD)
      db   00H        			;; Device class
      db   00H         			;; Device sub-class
      db   00H         			;; Device sub-sub-class
      db   64         			;; Maximum packet size
      dw   0a215H      			;; Vendor ID
      dw   00102H      			;; Product ID (Sample Device)
      dw   0000H      			;; Product version ID
      db   1         			;; Manufacturer string index
      db   2         			;; Product string index
      db   0         			;; Serial number string index
      db   1         			;; Number of configurations

;;DeviceQualDscr:
;;      db   DSCR_DEVQUAL_LEN   	;; Descriptor length
;;      db   DSCR_DEVQUAL   		;; Decriptor type
;;      db   00H,02H      		;; Specification Version (BCD)
;;      db   0EFH        			;; Device class
;;      db   02H         			;; Device sub-class
;;      db   01H         			;; Device sub-sub-class
;;      db   64         			;; Maximum packet size
;;      db   0         			;; Number of configurations
;;      db   0         			;; Reserved

;; Configuration Descriptor
HighSpeedConfigDscr:   
    db   9      				;; Descriptor length
    db   02H          			;; Descriptor type
    db   64H,00H				;; Total Length 
    db   2      				;; Number of interfaces - 0:AudioControl 1:AudioStreaming
    db   1      				;; Configuration number
    db   0      				;; Configuration string
    db   10000000b   			;; Attributes (b7 - buspwr, b6 - selfpwr, b5 - rwu)
    db   50      				;; Power requirement (div 2 ma)

;; *** INTERFACE 0 ***

;; Standard AC Interface Descriptor
    db	9       				;; bLength 
    db	04H       				;; bDescriptorType : INTERFACE 
    db	00H       				;; bInterfaceNumber
    db	00H       				;; bAlternateSetting
    db	00H       				;; bNumEndpoints 
    db	01H       				;; bInterfaceClass : AUDIO 
    db	01H       				;; bInterfaceSubClass : AUDIO_CONTROL
    db	00H       				;; bInterfaceProtocol
    db	00H       				;; iInterface 
	
;; Class-Specific AC Interface Descriptor
    db	9	       				;; bLength
    db	24H       				;; bDescriptorType : CS_INTERFACE 
    db	01H       				;; bDescriptorSubType : HEADER
	db	00H,01H					;; bcdADC
	db 	1EH,00H					;; wTotalLength
	db	01H						;; bInCollection
	db 	01H						;; baInterfaceNr
	
;; Input Terminal Descriptor
    db	12       				;; bLength
    db	24H       				;; bDescriptorType : CS_INTERFACE 
    db	02H       				;; bDescriptorSubType : INPUT_TERMINAL
	db	01H						;; bTerminalID
	db	01H,01H					;; wTerminalType : USB Streaming
	db	00H						;; bAssocTerminal
	db	01H						;; bNrChannels
	db	00H,00H					;; wChannelConfig : Mono
	db	00H						;; iChannelNames
	db	00H						;; iTerminal

;; Feature Unit
;    db	9       				;; bLength
;    db	24H       				;; bDescriptorType : CS_INTERFACE 
;    db	06H       				;; bDescriptorSubType : FEATURE_UNIT
;	db	02H						;; bUnitID
;	db	01H						;; bSourceID : USB Streaming
;	db	01H						;; bControlSize
;	db	01H,00H					;; bmaControls : Master, CH0
;	db	00H						;; iTerminal
	
;; Output Terminal
    db	9       				;; bLength
    db	24H       				;; bDescriptorType : CS_INTERFACE 
    db	03H       				;; bDescriptorSubType : OUTPUT_TERMINAL
	db	03H						;; bTerminalID
	db	01H,03H					;; wTerminalType: Speaker
	db	00H						;; bAssocTerminal
	db	01H						;; bSourceID: Feature Unit
	db	00H						;; iTerminal	
	
;; *** INTERFACE 0 ***

;; *** INTERFACE 1 ***

;; Standard AS Interface Descriptor - Alt Set 0 - Zero Bandwidth
    db	9       				;; bLength
    db	04H       				;; bDescriptorType : INTERFACE 
    db	01H       				;; bInterfaceNumber
    db	00H       				;; bAlternateSetting
    db	00H       				;; bNumEndpoints
    db	01H       				;; bInterfaceClass : AUDIO 
	db	02H       				;; bInterfaceSubClass : AUDIO_STREAMING 
    db	00H       				;; bInterfaceProtocol
    db	00H       				;; iInterface 
	
;; Standard AS Interface Descriptor - Alt Set 1 - Normal Streaming
    db	9       				;; bLength
    db	04H       				;; bDescriptorType : INTERFACE 
    db	01H       				;; bInterfaceNumber
    db	01H       				;; bAlternateSetting
    db	01H       				;; bNumEndpoints 
    db	01H       				;; bInterfaceClass : AUDIO 
	db	02H       				;; bInterfaceSubClass : AUDIO_STREAMING 
    db	00H       				;; bInterfaceProtocol
    db	00H       				;; iInterface 

;; Class-Specific AS Interface Descriptor
    db	7       				;; bLength
    db	24H       				;; bDescriptorType : CS_INTERFACE 
    db	01H       				;; bDescriptorSubType : AS_GENERAL 
    db	01H       				;; bTerminalLink : Input Terminal
	db	01H						;; bDelay
	db	01H,00H					;; wFormatTag: PCM

;; Type I Format Type Descriptor
    db	11       				;; bLength
    db	24H       				;; bDescriptorType : CS_INTERFACE 
    db	02H       				;; bDescriptorSubtype : FORMAT_TYPE 
    db	01H       				;; bFormatType : FORMAT_TYPE_I 
	db	01H						;; bNrChannels
	db	02H						;; bSubFrameSize
    db	10H      				;; bBitResolution : 16 bits per sample 
	db	01H						;; bSampFreqType
	db	80H,0bbH,00H			;; tSamFreq

;; Standard Endpoint Descriptor
	db	9						;; bLength
	db	05H						;; bDescriptorType : ENDPOINT
	db	02H						;; bEndpointAddress : EP2OUT
	db	05H						;; bmAttributes
	db	00H,04H					;; wMaxPacketSize
	db	01H						;; bInterval
	db	00H						;; bRefresh
	db	00H						;; bSynchAddress
	
;; Class-Specific Endpoint Descriptor
	db	7						;; bLength
	db	25H						;; bDescriptorType : CS_ENDPOINT
	db	01H						;; bDescriptorSubType
	db	00H						;; bmAttributes
	db	00H						;; bLockDelayUnits
	db	00H,00H					;; wLockDelay

;; *** INTERFACE 1 ***

HighSpeedConfigDscrEnd:   

StringDscr:

StringDscr0:   
      db   StringDscr0End-StringDscr0      ;; String descriptor length
      db   DSCR_STRING
      db   09H,04H
StringDscr0End:

StringDscr1:   
      db   StringDscr1End-StringDscr1      ;; String descriptor length
      db   DSCR_STRING
      db   'b',00
      db   'e',00
      db   'a',00
      db   'n',00
StringDscr1End:

StringDscr2:   
      db   StringDscr2End-StringDscr2      ;; Descriptor length
      db   DSCR_STRING
      db   'M',00
      db   'A',00
      db   'D',00
      db   'I',00
StringDscr2End:

UserDscr:      
      dw   0000H
      end
      
