aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/LowLevel/Host.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-16 04:20:21 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-16 04:20:21 +0000
commitb5ca3990c2ec9dc240fb334002ed2f7c82eea853 (patch)
tree73449296c9effce9ba73cf744734e258edfbdfea /LUFA/Drivers/USB/LowLevel/Host.c
parentab76c52e1414c55a2f594999ca2a04918bbc7143 (diff)
downloadlufa-b5ca3990c2ec9dc240fb334002ed2f7c82eea853.tar.gz
lufa-b5ca3990c2ec9dc240fb334002ed2f7c82eea853.tar.bz2
lufa-b5ca3990c2ec9dc240fb334002ed2f7c82eea853.zip
Added new USB_Host_SetDeviceConfiguration() convenience function. Change over Low Level host demos to use the new routine.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel/Host.c')
-rw-r--r--LUFA/Drivers/USB/LowLevel/Host.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Host.c b/LUFA/Drivers/USB/LowLevel/Host.c
index 5f3eeb8e8..c059b43ac 100644
--- a/LUFA/Drivers/USB/LowLevel/Host.c
+++ b/LUFA/Drivers/USB/LowLevel/Host.c
@@ -285,4 +285,21 @@ static void USB_Host_ResetDevice(void)
USB_INT_Enable(USB_INT_DDISCI);
}
+
+uint8_t USB_Host_SetDeviceConfiguration(uint8_t ConfigNumber)
+{
+ USB_ControlRequest = (USB_Request_Header_t)
+ {
+ .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
+ .bRequest = REQ_SetConfiguration,
+ .wValue = ConfigNumber,
+ .wIndex = 0,
+ .wLength = 0,
+ };
+
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);
+
+ return USB_Host_SendControlRequest(NULL);
+}
+
#endif