Added new HID_Host_SetIdlePeriod() function to the HID Host Class driver.
authorDean Camera <dean@fourwalledcubicle.com>
Mon, 4 Jul 2011 09:18:50 +0000 (09:18 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Mon, 4 Jul 2011 09:18:50 +0000 (09:18 +0000)
LUFA/Drivers/USB/Class/Host/HID.c
LUFA/Drivers/USB/Class/Host/HID.h
LUFA/ManPages/ChangeLog.txt

index aab35b1..683458d 100644 (file)
@@ -357,6 +357,22 @@ uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInf
        return HOST_SENDCONTROL_Successful;
 }
 
        return HOST_SENDCONTROL_Successful;
 }
 
+uint8_t HID_Host_SetIdlePeriod(const uint16_t MS)
+{
+       USB_ControlRequest = (USB_Request_Header_t)
+               {
+                       .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
+                       .bRequest      = HID_REQ_SetIdle,
+                       .wValue        = ((MS << 6) & 0xFF00),
+                       .wIndex        = HIDInterfaceInfo->State.InterfaceNumber,
+                       .wLength       = 0,
+               };
+
+       Pipe_SelectPipe(PIPE_CONTROLPIPE);
+
+       return USB_Host_SendControlRequest(HIDReportData);
+}
+
 #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
 uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)
 {
 #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
 uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)
 {
index 878a099..1c6c7d2 100644 (file)
                         */
                        uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
 
                         */
                        uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) 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.
+                        *
+                        *  \param[in] MS  Idle period as a multiple of four milliseconds, zero to disable hardware repeats
+                        *
+                        *  \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
+                        */
+                       uint8_t HID_Host_SetIdlePeriod(const uint16_t MS);
+
                        #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
                        /** 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.
                        #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
                        /** 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.
index 619c677..9b47311 100644 (file)
@@ -22,6 +22,7 @@
   *   - Added new SPI_GetCurrentMode() function to the SPI peripheral driver
   *   - Added board hardware driver support for the EVK1100 board
   *   - Added board hardware driver support for the EVK1104 board
   *   - Added new SPI_GetCurrentMode() function to the SPI peripheral driver
   *   - Added board hardware driver support for the EVK1100 board
   *   - Added board hardware driver support for the EVK1104 board
+  *   - Added new HID_Host_SetIdlePeriod() function to the HID Host Class driver
   *  - Library Applications:
   *   - Added RNDIS device mode to the Webserver project
   *   - Added new incomplete AndroidAccessoryHost Host LowLevel demo
   *  - Library Applications:
   *   - Added RNDIS device mode to the Webserver project
   *   - Added new incomplete AndroidAccessoryHost Host LowLevel demo