Added new USB_Host_SetDeviceConfiguration() convenience function. Change over Low...
[pub/lufa.git] / LUFA / Drivers / USB / LowLevel / Host.c
index 5f3eeb8..c059b43 100644 (file)
@@ -285,4 +285,21 @@ static void USB_Host_ResetDevice(void)
 \r
        USB_INT_Enable(USB_INT_DDISCI);\r
 }\r
+\r
+uint8_t USB_Host_SetDeviceConfiguration(uint8_t ConfigNumber)\r
+{\r
+       USB_ControlRequest = (USB_Request_Header_t)\r
+               {\r
+                       .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),\r
+                       .bRequest      = REQ_SetConfiguration,\r
+                       .wValue        = ConfigNumber,\r
+                       .wIndex        = 0,\r
+                       .wLength       = 0,\r
+               };\r
+\r
+       Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
+       \r
+       return USB_Host_SendControlRequest(NULL);\r
+}\r
+\r
 #endif\r