![]() |
LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
|
Data Structures | |
struct | USB_ClassInfo_HID_Host_t |
HID Class Host Mode Configuration and State Structure. More... | |
Macros | |
#define | HID_ERROR_LOGICAL 0x80 |
Enumerations | |
enum | HID_Host_EnumerationFailure_ErrorCodes_t { HID_ENUMERROR_NoError = 0, HID_ENUMERROR_InvalidConfigDescriptor = 1, HID_ENUMERROR_NoCompatibleInterfaceFound = 2, HID_ENUMERROR_PipeConfigurationFailed = 3 } |
Functions | |
uint8_t | HID_Host_ConfigurePipes (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo, uint16_t ConfigDescriptorSize, void *DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3) |
Host interface configuration routine, to configure a given HID host interface instance using the Configuration Descriptor read from an attached USB device. This function automatically updates the given HID Host instance's state values and configures the pipes required to communicate with the interface if it is found within the device. This should be called once after the stack has enumerated the attached device, while the host state machine is in the Addressed state. | |
uint8_t | HID_Host_ReceiveReport (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo, void *Buffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) |
Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe. | |
uint8_t | HID_Host_ReceiveReportByID (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo, const uint8_t ReportID, void *Buffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3) |
Receives a HID IN report from the attached device, by the report ID. | |
uint8_t | HID_Host_SendReportByID (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo, const uint8_t ReportID, const uint8_t ReportType, void *Buffer, const uint16_t ReportSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4) |
Sends an OUT or FEATURE report to the currently attached HID device, using the device's OUT pipe if available, or the device's Control pipe if not. | |
bool | HID_Host_IsReportReceived (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) |
Determines if a HID IN report has been received from the attached device on the data IN pipe. | |
uint8_t | HID_Host_SetBootProtocol (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) |
Switches the attached HID device's reporting protocol over to the Boot Report protocol mode, on supported devices. | |
uint8_t | HID_Host_SetIdlePeriod (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo, const uint16_t MS) ATTR_NON_NULL_PTR_ARG(1) |
Sets the idle period for the attached HID device to the specified interval. The HID idle period determines the rate at which the device should send a report, when no state changes have ocurred; i.e. on HID keyboards, this sets the hardware key repeat interval. | |
uint8_t | HID_Host_SetReportProtocol (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) |
Switches the attached HID device's reporting protocol over to the standard Report protocol mode. This also retrieves and parses the device's HID report descriptor, so that the size of each report can be determined in advance. | |
static void | HID_Host_USBTask (USB_ClassInfo_HID_Host_t *const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) |
General management task for a given Human Interface Class host class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask(). | |
The following files must be built with any user project that uses this module:
Host Mode USB Class driver framework interface, for the HID USB Class driver.
#define HID_ERROR_LOGICAL 0x80 |
Error code for some HID Host functions, indicating a logical (and not hardware) error.
Definition at line 66 of file HIDClassHost.h.
Enum for the possible error codes returned by the HID_Host_ConfigurePipes() function.
Definition at line 132 of file HIDClassHost.h.
uint8_t HID_Host_ConfigurePipes | ( | USB_ClassInfo_HID_Host_t *const | HIDInterfaceInfo, |
uint16_t | ConfigDescriptorSize, | ||
void * | DeviceConfigDescriptor | ||
) |
Host interface configuration routine, to configure a given HID host interface instance using the Configuration Descriptor read from an attached USB device. This function automatically updates the given HID Host instance's state values and configures the pipes required to communicate with the interface if it is found within the device. This should be called once after the stack has enumerated the attached device, while the host state machine is in the Addressed state.
HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
ConfigDescriptorSize | : Length of the attached device's Configuration Descriptor. |
DeviceConfigDescriptor | : Pointer to a buffer containing the attached device's Configuration Descriptor. |
Definition at line 43 of file HIDClassHost.c.
bool HID_Host_IsReportReceived | ( | USB_ClassInfo_HID_Host_t *const | HIDInterfaceInfo | ) |
Determines if a HID IN report has been received from the attached device on the data IN pipe.
HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
true
if a report has been received, false
otherwise. Definition at line 322 of file HIDClassHost.c.
uint8_t HID_Host_ReceiveReport | ( | USB_ClassInfo_HID_Host_t *const | HIDInterfaceInfo, |
void * | Buffer | ||
) |
Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe.
HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
Buffer | : Buffer to store the received report into. |
Definition at line 227 of file HIDClassHost.c.
uint8_t HID_Host_ReceiveReportByID | ( | USB_ClassInfo_HID_Host_t *const | HIDInterfaceInfo, |
const uint8_t | ReportID, | ||
void * | Buffer | ||
) |
Receives a HID IN report from the attached device, by the report ID.
HID_HOST_BOOT_PROTOCOL_ONLY
compile time token is defined, this method is unavailable.HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
ReportID | : Report ID of the received report if ControlRequest is false, set by the to the Report ID to fetch. |
Buffer | Buffer to store the received report into. |
Definition at line 207 of file HIDClassHost.c.
uint8_t HID_Host_SendReportByID | ( | USB_ClassInfo_HID_Host_t *const | HIDInterfaceInfo, |
const uint8_t | ReportID, | ||
const uint8_t | ReportType, | ||
void * | Buffer, | ||
const uint16_t | ReportSize | ||
) |
Sends an OUT or FEATURE report to the currently attached HID device, using the device's OUT pipe if available, or the device's Control pipe if not.
HID_HOST_BOOT_PROTOCOL_ONLY
compile time token is defined, the ReportID parameter is removed from the parameter list of this function.HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
ReportID | : Report ID of the report to send to the device, or 0 if the device does not use report IDs. |
ReportType | : Type of report to issue to the device, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature. |
Buffer | : Buffer containing the report to send to the attached device. |
ReportSize | : Report size in bytes to send to the attached device. |
Definition at line 269 of file HIDClassHost.c.
uint8_t HID_Host_SetBootProtocol | ( | USB_ClassInfo_HID_Host_t *const | HIDInterfaceInfo | ) |
Switches the attached HID device's reporting protocol over to the Boot Report protocol mode, on supported devices.
HID_HOST_BOOT_PROTOCOL_ONLY
compile time token is defined, this method must still be called to explicitly place the attached device into boot protocol mode before use.HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
Definition at line 340 of file HIDClassHost.c.
uint8_t HID_Host_SetIdlePeriod | ( | USB_ClassInfo_HID_Host_t *const | HIDInterfaceInfo, |
const uint16_t | MS | ||
) |
Sets the idle period for the attached HID device to the specified interval. The HID idle period determines the rate at which the device should send a report, when no state changes have ocurred; i.e. on HID keyboards, this sets the hardware key repeat interval.
HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
MS | : Idle period as a multiple of four milliseconds, zero to disable hardware repeats |
Definition at line 368 of file HIDClassHost.c.
uint8_t HID_Host_SetReportProtocol | ( | USB_ClassInfo_HID_Host_t *const | HIDInterfaceInfo | ) |
Switches the attached HID device's reporting protocol over to the standard Report protocol mode. This also retrieves and parses the device's HID report descriptor, so that the size of each report can be determined in advance.
HID_HOST_BOOT_PROTOCOL_ONLY
compile time token is defined, this method is unavailable.HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
Definition at line 387 of file HIDClassHost.c.
|
inlinestatic |
General management task for a given Human Interface Class host class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask().
HIDInterfaceInfo | : Pointer to a structure containing a HID Class host configuration and state. |
Definition at line 291 of file HIDClassHost.h.