Implementing SET_REPORT/ GET_REPORT in USB full speed and low speed HID devices | Cypress Semiconductor
Support & Community
Implementing SET_REPORT/ GET_REPORT in USB full speed and low speed HID devices
How to transfer data to and from device using SET_REPORT/GET_REPORT HID class-specific requests?
Implementaion is as follows:
The RAM location for feature report data is USBFS_INTERFACE_0_FEATURE_RPT_DATA.
Transfers using feature report can be implemented by directly accessing this buffer.
This buffer is declared in the ‘USBFS_descr.asm’ file associated with the USBFS user module as follows:
BLK 8 ;
Proceed by exporting this RAM buffer for use in your ‘main.c’ file. This can be done with the line of code:
You can assign values to these locations as:
Each location is capable of handling a WORD sized data.
GET_REPORT request reads data from these locations to the HOST. Similarly, SET_REPORT request writes data from HOST to these locations.
The ‘main.c’ firmware is as follows:
#include<m8c.h> // part specific constants and macros
#include"PSoCAPI.h" // PSoC API definitions for all User Modules
The HID report descriptor used in the project is as follows:
Usage Page 06 FF FF
Usage 09 01
Collection (Application 01)
Report ID 85 01
Usage 09 02
Logical Minimum 15 00
Logical Maximum 25 FF
Report Size 75 08
Report Count 95 08
Input (Data, Variable, Absolute 02)
Usage 09 03
Report ID 85 02
Report Count 95 01
Logical Maximum 25 10
Feature (Data, Variable, Absolute 02)
End Collection C0
Note that irrespective of the report descriptor configuration, all HID class devices are supposed to respond to the HID class requests like SET_REPORT and GET_REPORT.
To test this firmware, please follow the instructions given in the attached word document