- No category
advertisement
UM1021 USB device library
HID class implementation
●
●
●
●
●
This module manages the MSC class V1.11 following the “Device Class Definition for
Human Interface Devices (HID) Version 1.11 June 27, 2001". This driver implements the following aspects of the specification:
The boot interface subclass
The mouse protocol
Usage page: generic desktop
Usage: joystick
Collection: application
HID user interface
The USBD_HID_SendReport can be used by the application to send HID reports, the HID driver, in this release, handles only IN traffic. An example of use of this function is shown below: static uint8_t HID_Buffer [4];
USBD_HID_SendReport (&USB_OTG_FS_dev,
USBD_HID_GetPos(),
4); static uint8_t *USBD_HID_GetPos (void)
{
HID_Buffer[0] = 0;
HID_Buffer[1] = GetXPos();;
HID_Buffer[2] = GetXPos();
HID_Buffer[3] = 0; return HID_Buffer;
}
HID core files
Table 10.
usbd_hid_core.c,h files
Functions Description
static uint8_t USBD_HID_Init
(void *pdev, uint8_t cfgidx) static uint8_t USBD_HID_DeInit
(void *pdev, uint8_t cfgidx)
Initializes the HID interface and open the used endpoints.
Un-Initializes the HID layer and close the used endpoints.
static uint8_t USBD_HID_Setup (void
*pdev, USB_SETUP_REQ *req)
Handles the HID specific requests.
uint8_t USBD_HID_SendReport
(USB_OTG_CORE_HANDLE *pdev, uint8_t
*report, uint16_t len)
Sends HID reports.
Doc ID 18153 Rev 3 39/107
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
advertisement
Table of contents
- 8 Reference information
- 8 Glossary
- 9 USB host and device library overview
- 9 Main features
- 10 USB host and device library folder structure
- 11 USB OTG core
- 11 USB OTG full speed core
- 11 OTG_FS interface main features
- 11 USB OTG high speed core
- 13 USB OTG low level driver
- 13 USB OTG low level driver architecture
- 13 USB OTG low level driver files
- 14 USB OTG low level driver configuration
- 15 USB OTG driver programming manual
- 15 Low level driver structures
- 15 Programming considerations when using internal DMA
- 17 Selecting USB physical interface
- 17 Programming device drivers
- 20 Programming host drivers
- 23 USB device library
- 23 USB device library overview
- 24 USB device library files
- 24 USB device library description
- 24 USB device library flow
- 27 USB device library process
- 28 USB device data flow
- 29 USB device library configuration
- 29 USB data transfer handling
- 30 Using the multi-packet feature
- 30 USB control functions
- 30 FIFO size customization
- 32 USB device library functions
- 35 USB device class interface
- 36 USB device user interface
- 38 USB device classes
- 39 HID class
- 40 Mass storage class
- 45 Device firmware upgrade (DFU) class
- 52 Audio class
- 56 Communication device class (CDC)
- 61 Adding a custom class
- 62 Application layer description
- 63 Starting the USB device library
- 64 USB device examples
- 64 USB mass storage device example
- 65 USB human interface device example
- 67 Dual core USB device example
- 68 USB device firmware upgrade example
- 70 USB virtual com port (VCP) device example
- 73 USB audio device example
- 74 Known limitations
- 75 USB host library
- 75 Overview
- 76 USB host library files
- 77 USB host library description
- 77 Host core state machine
- 78 Device enumeration
- 79 Control transfer state machine
- 79 USB I/O request module
- 79 Host channel control module
- 79 USB host library configuration
- 79 USB host library functions
- 81 USB host class interface
- 81 USB host classes
- 81 Mass storage class
- 85 HID class
- 88 USB host user interface
- 88 Library user API
- 88 User callback functions
- 88 Class callback functions
- 92 Application layer description
- 93 Starting the USB host library
- 94 USB host examples
- 95 USB mass storage host example
- 98 USB HID Host example
- 99 USB dual core host example
- 100 USB manual dual role device example
- 102 Frequently-asked questions
- 105 Troubleshooting
- 106 Revision history