Added new USB_Host_SetDeviceConfiguration() convenience function. Change over Low Level host demos to use the new routine.
This commit is contained in:
parent
ab76c52e14
commit
b5ca3990c2
12 changed files with 173 additions and 244 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue