⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb_descr.asm

📁 Cypress 的VOIP DEMO 研究VOIP终端的朋友可以研究研究
💻 ASM
📖 第 1 页 / 共 3 页
字号:
  DB    01h  ;Audio                                    ; bInterfaceClass
  DB   	02h  ; AudioStreaming                                        ; bInterfaceSubClass
  DB    0                                        ; bInterfaceProtocol
  DB    STR_HASH_4                               ; iInterface
  
;----------------------------------------------------------------------
; Microphone Interface Descriptor (USB_D0_C1_I1) (AudioStreaming - Active)
;----------------------------------------------------------------------
  DB    9                                        ; Interface Descriptor Length (9)
  DB    4                                        ; bDescriptorType: INTERFACE
  DB    1                                        ; bInterfaceNumber (zero based)
  DB    1                                        ; bAlternateSetting
  DB    1                                        ; bNumEndpoints
  DB    01h  ;Audio                              ; bInterfaceClass
  DB   	02h  ; AudioStreaming					; bInterfaceSubClass
  DB    0                                        ; bInterfaceProtocol
  DB    STR_HASH_4                               ; iInterface

;-----------------------------------------------
; Class-specific AudioStreaming interface (general)
  DB	7
  DB	24h
  DB	1 ; General
  DB	2		; Terminal ID
  DB	1 		; - Interface delay  
  DWL	0001h 	; PCM format
  
;-----------------------------------------------
; Class-specific AudioStreaming interface (format type one)
  DB	0bh
  DB	24h
  DB	2	; Format type
  DB	1	; Format type I
  DB	1	; One channel
  DB	2	; Two bytes per subframe
  DB	16	; Bits per sample
  DB	1	; One frequency supports
  DB	40h
  DB	1fh
  DB	00h ; Three bytes making up 8000Hz		
  
;  DB e0h
; DB 2eh
; DB 0h ; Three bytes making up 12000Hz
 
  
;----------------------------------------------------------------------
; Endpoint Descriptor (USB_D0_C1_I1_E0)
;----------------------------------------------------------------------
  DB    9                                        ; Endpoint Descriptor Length (7)
  DB    5                                        ; bDescriptorType: ENDPOINT
  DB    81h ; EP1 in
  DB    1	; Isoc, not shared
  DWL   16 	; Bytes per packet					; wMaxPacketSize
  DB	1	; bInterval
  DB	0
  DB	0
;------------------------------------
; CS Endpoint descr
  DB	7
  DB	25h
  DB	1
  DB	0
  DB	0
  DWL	00

;----------------------------------------------------------------------
; Headphone Interface Descriptor (USB_D0_C1_I1) (AudioStreaming - Idle)
;----------------------------------------------------------------------
  DB    9                                        ; Interface Descriptor Length (9)
  DB    4                                        ; bDescriptorType: INTERFACE
  DB    2                                        ; bInterfaceNumber (zero based)
  DB    0                                        ; bAlternateSetting
  DB    0                                        ; bNumEndpoints
  DB    01h  ;Audio                               ; bInterfaceClass
  DB   	02h  ; AudioStreaming                     ; bInterfaceSubClass
  DB    0                                        ; bInterfaceProtocol
  DB    STR_HASH_5                               ; iInterface
  
;----------------------------------------------------------------------
; Headphone Interface Descriptor (USB_D0_C1_I1) (AudioStreaming - Active)
;----------------------------------------------------------------------
  DB    9                                        ; Interface Descriptor Length (9)
  DB    4                                        ; bDescriptorType: INTERFACE
  DB    2                                        ; bInterfaceNumber (zero based)
  DB    1                                        ; bAlternateSetting
  DB    1                                        ; bNumEndpoints
  DB    01h  ;Audio                              ; bInterfaceClass
  DB   	02h  ; AudioStreaming					; bInterfaceSubClass
  DB    0                                        ; bInterfaceProtocol
  DB    STR_HASH_5		                              ; iInterface

;-----------------------------------------------
; Class-specific AudioStreaming interface (general)
  DB	7
  DB	24h
  DB	1		; General
  DB	3		; Terminal ID (USB output)
  DB	1 		; - Interface delay  
  DWL	0001h 	; PCM format
  
;-----------------------------------------------
; Class-specific AudioStreaming interface (format type one)
  DB	0bh
  DB	24h
  DB	2	; Format type
  DB	1	; Format type I
  DB	1	; One channel
  DB	2	; One byte per subframe
  DB	16	; Bits per sample
  DB	1	; One frequency supports
  DB	40h
  DB	1fh
  DB	00h ; Three bytes making up 8000Hz		
  
;  DB e0h
; DB 2eh
; DB 0h ; Three bytes making up 12000Hz
 
;----------------------------------------------------------------------
; Endpoint Descriptor (USB_D0_C1_I2_E0)
;----------------------------------------------------------------------
  DB    9                                        ; Endpoint Descriptor Length (7)
  DB    5                                        ; bDescriptorType: ENDPOINT
  DB    02h ; EP2 out
  DB    1	; Isoc, not shared
  DWL   16 	; Bytes per packet					; wMaxPacketSize
  DB	1	; bInterval
  DB	0
  DB	0
;------------------------------------
; CS Endpoint descr
  DB	7		; LEngth
  DB	25h		; CS Endpoint
  DB	1		; GENERAL
  DB	0		; Attrib
  DB	0		; bLockDelayUnits
  DWL	00		; wLockDelay
IF HID_INT
;----------------------------------------------------------------------
; Diagnostics Interface Descriptor 
;----------------------------------------------------------------------
  DB    9                                        ; Interface Descriptor Length (9)
  DB    4                                        ; bDescriptorType: INTERFACE
  DB    3                                        ; bInterfaceNumber (zero based)
  DB    0                                        ; bAlternateSetting
  DB    1                                        ; bNumEndpoints
  DB    ffh  ;User defined                       ; bInterfaceClass
  DB   	0h  									 ; bInterfaceSubClass
  DB    0                                        ; bInterfaceProtocol
  DB    STR_HASH_3		                         ; iInterface



;----------------------------------------------------------------------
; Endpoint Descriptor (diagnostics)
;----------------------------------------------------------------------
  DB    7                                        ; Endpoint Descriptor Length (7)
  DB    5                                        ; bDescriptorType: ENDPOINT
  DB    83h ; EP3 in
  DB    2	; Interrupt
  DWL   16 	; Bytes per packet					; wMaxPacketSize
  DB	10	; bInterval
ENDIF  
;----------------------------------------------------------------------
USB_D0_C1_DESCR_END:
USB_D0_C1_DESCR_SIZE:	EQU	(USB_D0_C1_DESCR_END - USB_D0_C1_DESCR_START)
.ENDLITERAL
;----------------------------------------------------------------------
; USB String Descriptors
;
; This section contains the USB String Descriptors generated
; by the USB User Module Descriptor Generator
;
; Note:  The string labels are internally generated by the
; descriptor generator
;
; Descriptors that reference string descriptors, use a hashed
; symbol that is set in an EQU directive with each string
; descriptor.
;----------------------------------------------------------------------
STR_HASH_0:  EQU    0                            ; String Hash for the null string
AREA  UserModules     (ROM,REL,CON)
EXPORT USB_StringTable
.LITERAL
USB_StringTable:                                 
  TD_START_TABLE 3                               ; Number of USB Strings
  TD_ENTRY       USB_DS_ROM, LANGID_DESCR_SIZE, LANGID_DESCR_START, NULL_PTR
  TD_ENTRY       USB_DS_ROM, STRING_2_DESCR_SIZE, STRING_2_DESCR_START, NULL_PTR
  TD_ENTRY       USB_DS_ROM, STRING_3_DESCR_SIZE, STRING_3_DESCR_START, NULL_PTR
;----------------------------------------------------------------------
; LANGID Descriptor
;----------------------------------------------------------------------
LANGID_DESCR_START:                              
  DB    ((1 * 2) + 2)                            ; bLength (N+2)
  DB    3                                        ; bDescriptorType (STRING)
  DWL   1033                                     ;
LANGID_DESCR_END:                                
LANGID_DESCR_SIZE:  EQU    (LANGID_DESCR_END - LANGID_DESCR_START)
;----------------------------------------------------------------------
; String Desciptor
;----------------------------------------------------------------------
STR_HASH_2:  EQU    1                            ; String Hash
STRING_2_DESCR_START:                            
  DB    STRING_2_DESCR_SIZE                      ; bLength
  DB    3                                        ; bDescriptorType (STRING)
  DSU   "Cypress Semiconductor"                  ;
STRING_2_DESCR_END:                              
STRING_2_DESCR_SIZE:  EQU    (STRING_2_DESCR_END - STRING_2_DESCR_START)
;----------------------------------------------------------------------
; String Desciptor
;----------------------------------------------------------------------
STR_HASH_3:  EQU    2                            ; String Hash
STRING_3_DESCR_START:                            
  DB    STRING_3_DESCR_SIZE                      ; bLength
  DB    3                                        ; bDescriptorType (STRING)
  DSU   "Wireless Audio Example"                 ;
STRING_3_DESCR_END:                              
STRING_3_DESCR_SIZE:  EQU    (STRING_3_DESCR_END - STRING_3_DESCR_START)

;----------------------------------------------------------------------
; String Desciptor
;----------------------------------------------------------------------
STR_HASH_4:  EQU    3                            ; String Hash
STRING_4_DESCR_START:                            
  DB    STRING_4_DESCR_SIZE                      ; bLength
  DB    3                                        ; bDescriptorType (STRING)
  DSU   "Wireless Headset Microphone"                 ;
STRING_4_DESCR_END:                              
STRING_4_DESCR_SIZE:  EQU    (STRING_4_DESCR_END - STRING_4_DESCR_START)

;----------------------------------------------------------------------
; String Desciptor
;----------------------------------------------------------------------
STR_HASH_5:  EQU    4                            ; String Hash
STRING_5_DESCR_START:                            
  DB    STRING_5_DESCR_SIZE                      ; bLength
  DB    3                                        ; bDescriptorType (STRING)
  DSU   "Wireless Headset Earpiece"                 ;
STRING_5_DESCR_END:                              
STRING_5_DESCR_SIZE:  EQU    (STRING_5_DESCR_END - STRING_5_DESCR_START)





.ENDLITERAL


   
   ;---------------------------------------------------
   ; Insert your custom code above this banner
   ;---------------------------------------------------
   ;@PSoC_UserCode_END@ (Do not change this line.)
; End of File USB_descr.asm

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -