Added new USB_Host_SetDeviceConfiguration() convenience function. Change over Low Level host demos to use the new routine.

This commit is contained in:
Dean Camera 2009-06-16 04:20:21 +00:00
parent ab76c52e14
commit b5ca3990c2
12 changed files with 173 additions and 244 deletions

View file

@ -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