A SERVICE OF

logo

Cypress CY3640 USB Starter Kit
User’s Guide
Cypress Semiconductor Ver 0.993
Page 27
jmp USBEventEP0End
USBEventEP0SetupGetDescriptorConfig:
; Configuration Descriptor?
cmp a,USBDescriptorTypeConfig
jnz USBEventEP0SetupGetDescriptorString ; No
; Remember this
inc [gbUSBValidRqsts]
;*********************************************
; Get Configuration Descriptor Event
;*********************************************
; Descriptor pointer
mov a,(USBConfigurationDescription -USBSendROMBufferBase)
mov [gbUSBSendBuffer],a
; Descriptor size
mov a,09h ;[USBConfigurationDescription]
add a,09h ;[USBInterfaceDescription]
add a,07h ;[USBEndPointDescriptionInt]
mov [gbUSBSendBytes],a
; Check request size field
call USBSendDescriptorCheckLength
; Send buffer
call USBSendROMBuffer
jmp USBEventEP0End
USBEventEP0SetupGetDescriptorString:
; Get String Descriptor?
cmp a,USBDescriptorTypeString
jnz USBEventEP0SetupGetDescriptorEnd ; No
;*********************************************
; Get String Descriptor Event
;*********************************************
; Get string descriptor index
mov a,[USBRqstWordValueLo]
USBEventEP0SetupGetDescriptorString0:
cmp a,0h
jnz USBEventEP0SetupGetDescriptorString1 ; No
;*********************************************
; Get String Language(s) Descriptor Event
;*********************************************
; Descriptor pointer
mov a,(USBStringLanguageDescription -USBSendROMBufferBase)
mov [gbUSBSendBuffer],a
; Descriptor size
mov a,4h ;[USBStringLanguageDescription]
mov [gbUSBSendBytes],a
; Check request size field
call USBSendDescriptorCheckLength
; Send buffer
call USBSendROMBuffer
jmp USBEventEP0End
USBEventEP0SetupGetDescriptorString1:
cmp a,1
jnz USBEventEP0SetupGetDescriptorString2 ; No
;*********************************************
; Get String 1 Descriptor Event
;*********************************************