UM1021 - STMicroelectronics

Add to my manuals
107 Pages

advertisement

UM1021 - STMicroelectronics | Manualzz

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

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Download PDF

advertisement

Table of contents