Hardware Reference
In-Depth Information
DeviceDescriptor
; Length
DB
.18
;packet length (lower byte)
DB
0
;packet length (higher byte)
; USB-part:
DB .18 ;bLength size of descriptor
DB 0x01 ;bDescriptorType $01 is Device Descriptor
DB 0x00 ;bcdUSB USB version (lower byte)
DB 0x02 ;bcdUSB USB version (higher byte) USB 2.0
DB 0x00 ;bDeviceClass
DB 0x00 ;bDeviceSubClass
DB 0x00 ;bDeviceProtocol
DB .64 ;bMaxPacketSize0
DB 0xAD ;idVendor (lower byte) place holder*
DB 0x0 A ;idVendor (higher byte) place holder*
DB 0x01 ;idProduct (lower byte) place holder*
DB 0x01 ;idProduct (higher byte)place holder*
DB 0x01 ;bcdDevice (lower byte) place holder*
DB 0x00 ;bcdDevice (higher byte)place holder*
DB 0x01 ;iManufacturer string index
DB 0x02 ;iProduct string index
DB 0x03 ;iSerialNumber string index
DB 0x01 ;bNumConfigurations
;* final values are filled in from EEPROM-locations
Alle Daten, die bei Get Descriptor Requests übertragen werden müssen, werden
grundsätzlich mit dem folgenden Unterprogramm in den Control-In Endpoint
geschrieben. Ausnahme sind die Get String Descriptor Requests, mit denen Strings
gelesen werden, deren Inhalt vom Anwender verändert werden können. Das sind
Herstellername, Typenbezeichnung und Seriennummer des Geräts.
;******************************************************************************
; Load a descriptor into the control IN endpoint
;******************************************************************************
IN_Descriptor
; The descriptor's content is loaded to the control IN file register space
; Descriptor is accessed via Table-Pointer
; the first byte of the descriptor is the descriptor's packet length
; load FSR0 with Control IN base address
; check UOWN-bit
movlw 0x04
movwf
FSR0L
movlw 0x04
movwf FSR0H
movff INDF0,WREG
btfsc WREG,7 ;UOWN-bit of BD0STAT
bra IN_Descriptor ;wait until SIE has released the control IN endpoint
tblrd *+
movff TABLAT,DescriptorPointer ;packet length (lower byte)
Search WWH ::




Custom Search