C371346_375F2440A66FD1C882296D07948AE54C.pdf - 第18页

CM 108AH Highly Integrated USB Audio I/O Controller www .cmedia.com.tw Copyright© C-Media Electro nics Inc. R ev . 2.1 ︱ P age 18/27 7.3.3 Windows Softw are A rchitecture for HI D Note: Please con tact our sales f or a C…

100%1 / 27
CM108AH
Highly Integrated USB Audio I/O Controller
www.cmedia.com.tw
Copyright© C-Media Electronics Inc. Rev. 2.1 Page 17/27
7.3.2 HID Descriptors
HID Interface Descriptor
Offset
Field
Size
Value (Hex)
Description
0
bLength
1
09
Size of this descriptor: 9 bytes
1
bDescriptorType
1
04
Interface descriptor type
2
bInterfaceNumber
1
03
Interface number: 3
3
bAlternateSetting
1
00
Alternate: 0
4
bNumEndpoints
1
01
Number of endpoints used by this interface: 1
5
bInterfaceClass
1
03
Interface class: HID
6
bInterfaceSubClass
1
00
Subclass: no
7
bInterfaceProtocol
1
00
Must be set to 0
8
iInterface
1
00
String descriptor index that describes this interface
HID Descriptor
Offset
Field
Size
Value (Hex)
Description
0
bLength
1
09
Total: 9 bytes
1
bDescriptorType
1
21
HID descriptor type
2
bcdHID
2
0100
HID class version 1.0
4
bCountryCode
1
00
5
bNumDescriptors
1
01
6
bDescriptorType
1
22
Report descriptor
7
wDescriptorLength
2
0030
Total size of the optional descriptor: 48 bytes
Interrupt IN Endpoint Descriptor
Offset
Field
Size
Value (Hex)
Description
0
bLength
1
07
Total: 7 bytes
1
bDescriptorType
1
05
Endpoint descriptor type
2
bEndpointAddress
1
83
In Endpoint Number = 3
3
bmAttributes
1
03
Interrupt endpoint type
4
wMaxPacketSize
2
0004
Maximum packet size: 4 bytes
6
bInterval
1
2
2ms
CM108AH
Highly Integrated USB Audio I/O Controller
www.cmedia.com.tw
Copyright© C-Media Electronics Inc. Rev. 2.1 Page 18/27
7.3.3 Windows Software Architecture for HID
Note: Please contact our sales for a C-Media SDK sample if needed
PCI enumerator
USB class driver (USBD.SYS)
USB hub driver (USBHUB.SYS)
USB
MiniDriver( HIDUSB.SYS)
HID class driver(HIDCLASS.SYS)
Gameport
MiniDriver(HIDGAME.SYS)
Gameport
Enumerator(GAMEUM.SYS)
Audio Driver
Keyboard-class driver
Mouse-class driver
Joy stick-class driver
C-Media SDK
Reports
(Device specification)
Winmm.dll
Direct input
HID.dll
Applications
User32.exe or User.exe
CM108AH
Highly Integrated USB Audio I/O Controller
www.cmedia.com.tw
Copyright© C-Media Electronics Inc. Rev. 2.1 Page 19/27
7.4 Internal Registers
All of CM108AH’s internal registers can be accessed via generic HID functional calls without the need to
develop a kernel mode driver. In total, 4 bytes of data can be read or written from the HID. The input report is
for read and the output report is for write. These internal registers of are used to control GPIO pin, S/PDIF
output and EEPROM data access.
HID_IR0 (HID input report byte 0)
Offset: 0x00
Bits
Read/Write
Description
Default
7-6
R
00: HID_IR1 is used as GPI,
10: values written to HID_IR0-3 are also mapped to
EPROM_DATA0-1 and EEPROM_CTRL
Others: reserved
0x0
5-4
R
Reserved
0x0
3
R
0: no activity on record/mute button
1: record/mute button pressed then released
0x0
2
R
0: no activity on playback/mute button
1: playback/mute button pressed then released
0x0
1
R
0: volume-down button released
1: volume-down button pressed
0x0
0
R
0: volume-up button released
1: volume-up button pressed
0x0
HID_IR1 (HID input report byte 1)
Offset: 0x01
Bits
Read/Write
Description
Default
7-0
R
When HID_IR0[7:6] == 2’b00: HID_IR1[3:0] is the input from
GPIO4 ~ GPIO1 in input mode
When HID_OR0[7] == 1’b1: mapped from EEPROM_DATA0
0x00
HID_IR2 (HID input report byte 2)
Offset: 0x02
Bits
Read/Write
Description
Default
7-0
R
When HID_OR0[7] == 1’b1: mapped from EEPROM_DATA1
0x00