diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c index 6695efa23a337c30e02d785c8559c9593e371e66..76fb638ac395e44723de6d7c13136878062b736b 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c @@ -48,7 +48,10 @@ USB_ClassInfo_HID_Host_t Joystick_HID_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index b483defa7cb73344cacc1f98cd0eb97e6c8a1eec..1b5f8c725fea8bf4e5e457b94523133b1dedab38 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c @@ -45,7 +45,10 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, .HIDInterfaceProtocol = HID_BOOT_KEYBOARD_PROTOCOL, }, diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index bccfb8ca9ab09c5db13d7990d8b8b3449d8db5ba..971dcf227c1c2a9cf3036a611b374caae21fd9d5 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -48,7 +48,10 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c index f575d8ecfe52e3bb9be3b3f88262e4328c85acbd..9a59be082bf5da34011b1adb36f00791ec4084bb 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c @@ -45,7 +45,10 @@ USB_ClassInfo_MIDI_Host_t Keyboard_MIDI_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, }, }; diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c index 1bb0a8454703291984940a0db262bc26dfe595b0..7489ad10acb7caf048f20d9e1e12a3ead0d32bb5 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c @@ -45,7 +45,10 @@ USB_ClassInfo_MS_Host_t FlashDisk_MS_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, }, }; diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c index fbf35c0d678bede1bcf72fe98525a0969d8a4472..aa04c2e28a3068d2a989536ed0995672b109d691 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c @@ -45,7 +45,10 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, .HIDInterfaceProtocol = HID_BOOT_MOUSE_PROTOCOL, }, diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index 80ddc5527f9bdc568089e4ebfde6021069f9ee5d..022a102d3d1a391be0469f6522a5998138ab3b88 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c @@ -48,7 +48,10 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c index f854e1bf7d0924f25703bfcb8e88723c45bf1776..f94bf632a409a9891814e2d4f1e09b07e9c583bd 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c @@ -45,7 +45,10 @@ USB_ClassInfo_PRNT_Host_t Printer_PRNT_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, }, }; diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c index d8146af29ad4cee46f631e269e4793bc0f1fac3d..2959af59d7f8a98cfa339f2b6c6c39a6e167106b 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c @@ -45,8 +45,13 @@ USB_ClassInfo_SI_Host_t DigitalCamera_SI_Interface = .Config = { .DataINPipeNumber = 1, + .DataINPipeDoubleBank = false, + .DataOUTPipeNumber = 2, + .DataOUTPipeDoubleBank = false, + .EventsPipeNumber = 3, + .EventsPipeDoubleBank = false, }, }; diff --git a/LUFA/Drivers/USB/Class/Device/Audio.c b/LUFA/Drivers/USB/Class/Device/Audio.c index 337437c9469eeed2ecaaca49927e6e249bbd5b6f..abc754606725fabf9cdeaf69af9dc70f2b4a228a 100644 --- a/LUFA/Drivers/USB/Class/Device/Audio.c +++ b/LUFA/Drivers/USB/Class/Device/Audio.c @@ -48,7 +48,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi { Endpoint_ClearSETUP(); - AudioInterfaceInfo->State.InterfaceEnabled = (USB_ControlRequest.wValue != 0); + AudioInterfaceInfo->State.InterfaceEnabled = ((USB_ControlRequest.wValue & 0xFF) != 0); Endpoint_ClearStatusStage(); } diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index aac0931b1c07caea001ce057f54f9d36e5971567..db2f721836ef67faff5c39b5a1c9826394d71018 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -35,7 +35,7 @@ #include "CDC.h" uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* ConfigDescriptorData) + void* ConfigDescriptorData) { uint8_t FoundEndpoints = 0; diff --git a/LUFA/Drivers/USB/Class/Host/CDC.h b/LUFA/Drivers/USB/Class/Host/CDC.h index 4132d882c566b1e7a8f7aff63f0f321d51927b71..6b3a320f0fcc9c3e18039a6c1777ff5d6042f32a 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.h +++ b/LUFA/Drivers/USB/Class/Host/CDC.h @@ -64,8 +64,13 @@ const struct { uint8_t DataINPipeNumber; /**< Pipe number of the CDC interface's IN data pipe */ + bool DataINPipeDoubleBank; /** Indicates if the CDC interface's IN data pipe should use double banking */ + uint8_t DataOUTPipeNumber; /**< Pipe number of the CDC interface's OUT data pipe */ + bool DataOUTPipeDoubleBank; /** Indicates if the CDC interface's OUT data pipe should use double banking */ + uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used */ + bool NotificationPipeDoubleBank; /** Indicates if the CDC interface's notification pipe should use double banking */ } Config; /**< Config data for the USB class interface within the device. All elements in this section * <b>must</b> be set or the interface will fail to enumerate and operate correctly. */ @@ -139,7 +144,7 @@ * \return A value from the \ref CDCHost_EnumerationFailure_ErrorCodes_t enum */ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); + void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); /** Sets the line encoding for the attached device's virtual serial port. This should be called when the LineEncoding * values of the interface have been changed to push the new settings to the USB device. diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index 7d6a6dcb23facb35b9c315a3ea4aea3376dfe4b3..7d9b3b5596dc0968d740c787e6d950d24ab134bf 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -35,7 +35,7 @@ #include "HID.h" uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* ConfigDescriptorData) + void* ConfigDescriptorData) { uint8_t FoundEndpoints = 0; @@ -84,7 +84,8 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN) { Pipe_ConfigurePipe(HIDInterfaceInfo->Config.DataINPipeNumber, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); + EndpointData->EndpointAddress, EndpointData->EndpointSize, + HIDInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); HIDInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize; FoundEndpoints |= HID_FOUND_DATAPIPE_IN; @@ -92,7 +93,8 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo else { Pipe_ConfigurePipe(HIDInterfaceInfo->Config.DataOUTPipeNumber, EP_TYPE_INTERRUPT, PIPE_TOKEN_OUT, - EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); + EndpointData->EndpointAddress, EndpointData->EndpointSize, + HIDInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); HIDInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize; HIDInterfaceInfo->State.DeviceUsesOUTPipe = true; diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h index a852f10d9e90fef5aa15630ad418231253d7b120..89cb3d8603ebfc3973931a20cfa41cff4fab89cb 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.h +++ b/LUFA/Drivers/USB/Class/Host/HID.h @@ -70,7 +70,10 @@ const struct { uint8_t DataINPipeNumber; /**< Pipe number of the HID interface's IN data pipe */ + bool DataINPipeDoubleBank; /** Indicates if the HID interface's IN data pipe should use double banking */ + uint8_t DataOUTPipeNumber; /**< Pipe number of the HID interface's OUT data pipe */ + bool DataOUTPipeDoubleBank; /** Indicates if the HID interface's OUT data pipe should use double banking */ uint8_t HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific * boot subclass protocol is required, either \ref HID_BOOT_MOUSE_PROTOCOL, @@ -151,7 +154,7 @@ * \return A value from the \ref HIDHost_EnumerationFailure_ErrorCodes_t enum */ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); + void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); /** Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe. diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.c b/LUFA/Drivers/USB/Class/Host/MIDI.c index 69118cd5b522ded9bb1849fdba548bb773308938..5d3b148a06df3a8a4061f3bbaf12fd291cf66c5c 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDI.c +++ b/LUFA/Drivers/USB/Class/Host/MIDI.c @@ -35,7 +35,7 @@ #include "MIDI.h" uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* ConfigDescriptorData) + void* ConfigDescriptorData) { uint8_t FoundEndpoints = 0; @@ -63,7 +63,8 @@ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceI if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN) { Pipe_ConfigurePipe(MIDIInterfaceInfo->Config.DataINPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_IN, - EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); + EndpointData->EndpointAddress, EndpointData->EndpointSize, + MIDIInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); MIDIInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize; FoundEndpoints |= MIDI_FOUND_DATAPIPE_IN; @@ -71,7 +72,8 @@ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceI else { Pipe_ConfigurePipe(MIDIInterfaceInfo->Config.DataOUTPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_OUT, - EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE); + EndpointData->EndpointAddress, EndpointData->EndpointSize, + MIDIInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); MIDIInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize; FoundEndpoints |= MIDI_FOUND_DATAPIPE_OUT; diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.h b/LUFA/Drivers/USB/Class/Host/MIDI.h index 35671f90243967340c05d260e798ba09c2e4b262..cc294a42e0f2325972db3da90832bb235857741c 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDI.h +++ b/LUFA/Drivers/USB/Class/Host/MIDI.h @@ -64,7 +64,10 @@ const struct { uint8_t DataINPipeNumber; /**< Pipe number of the MIDI interface's streaming IN data pipe */ + bool DataINPipeDoubleBank; /** Indicates if the MIDI interface's IN data pipe should use double banking */ + uint8_t DataOUTPipeNumber; /**< Pipe number of the MIDI interface's streaming OUT data pipe */ + bool DataOUTPipeDoubleBank; /** Indicates if the MIDI interface's OUT data pipe should use double banking */ } Config; /**< Config data for the USB class interface within the device. All elements in this section * <b>must</b> be set or the interface will fail to enumerate and operate correctly. */ @@ -114,7 +117,7 @@ * \return A value from the \ref MIDIHost_EnumerationFailure_ErrorCodes_t enum */ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); + void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); /** Sends a MIDI event packet to the device. If no device is connected, the event packet is discarded. * diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c index 32518626d0ebb59fb93ac126dcb3cc42a5238926..d1622c17d75a10427e558409b71e2975111baa6d 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c @@ -35,7 +35,7 @@ #include "MassStorage.h" uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) + void* DeviceConfigDescriptor) { uint8_t FoundEndpoints = 0; @@ -66,7 +66,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, u { Pipe_ConfigurePipe(MSInterfaceInfo->Config.DataINPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, - PIPE_BANK_DOUBLE); + MSInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); MSInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize; FoundEndpoints |= MS_FOUND_DATAPIPE_IN; @@ -75,7 +75,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, u { Pipe_ConfigurePipe(MSInterfaceInfo->Config.DataOUTPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_OUT, EndpointData->EndpointAddress, EndpointData->EndpointSize, - PIPE_BANK_DOUBLE); + MSInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); MSInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize; FoundEndpoints |= MS_FOUND_DATAPIPE_OUT; diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h index a651a88f8bbac5aeca7ee3b6d1400e6b00d9faf0..4cd37bdf347a058eb132cd4ed9a89a0941e4e0f9 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h @@ -67,8 +67,11 @@ { const struct { - uint8_t DataINPipeNumber; /**< Pipe number of the MS interface's IN data pipe */ - uint8_t DataOUTPipeNumber; /**< Pipe number of the MS interface's OUT data pipe */ + uint8_t DataINPipeNumber; /**< Pipe number of the Mass Storage interface's IN data pipe */ + bool DataINPipeDoubleBank; /** Indicates if the Mass Storage interface's IN data pipe should use double banking */ + + uint8_t DataOUTPipeNumber; /**< Pipe number of the Mass Storage interface's OUT data pipe */ + bool DataOUTPipeDoubleBank; /** Indicates if the Mass Storage interface's OUT data pipe should use double banking */ } Config; /**< Config data for the USB class interface within the device. All elements in this section * <b>must</b> be set or the interface will fail to enumerate and operate correctly. */ @@ -80,8 +83,8 @@ */ uint8_t InterfaceNumber; /**< Interface index of the Mass Storage interface within the attached device */ - uint16_t DataINPipeSize; /**< Size in bytes of the MS interface's IN data pipe */ - uint16_t DataOUTPipeSize; /**< Size in bytes of the MS interface's OUT data pipe */ + uint16_t DataINPipeSize; /**< Size in bytes of the Mass Storage interface's IN data pipe */ + uint16_t DataOUTPipeSize; /**< Size in bytes of the Mass Storage interface's OUT data pipe */ uint32_t TransactionTag; /**< Current transaction tag for data synchronising of packets */ } State; /**< State data for the USB class interface within the device. All elements in this section @@ -194,7 +197,7 @@ * \return A value from the \ref MSHost_EnumerationFailure_ErrorCodes_t enum */ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); + void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); /** Sends a MASS STORAGE RESET control request to the attached device, resetting the Mass Storage Interface * and readying it for the next Mass Storage command. diff --git a/LUFA/Drivers/USB/Class/Host/Printer.c b/LUFA/Drivers/USB/Class/Host/Printer.c index bc8fba85f8be9fb8248d4b925f51407de67a96f1..192e17f86c086f4d3e465e57db2b30ec18dff0d0 100644 --- a/LUFA/Drivers/USB/Class/Host/Printer.c +++ b/LUFA/Drivers/USB/Class/Host/Printer.c @@ -35,7 +35,7 @@ #include "Printer.h" uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) + void* DeviceConfigDescriptor) { uint8_t FoundEndpoints = 0; @@ -69,7 +69,7 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI { Pipe_ConfigurePipe(PRNTInterfaceInfo->Config.DataINPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, - PIPE_BANK_DOUBLE); + PRNTInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); PRNTInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize; FoundEndpoints |= PRNT_FOUND_DATAPIPE_IN; @@ -78,7 +78,7 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI { Pipe_ConfigurePipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_OUT, EndpointData->EndpointAddress, EndpointData->EndpointSize, - PIPE_BANK_DOUBLE); + PRNTInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); PRNTInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize; FoundEndpoints |= PRNT_FOUND_DATAPIPE_OUT; diff --git a/LUFA/Drivers/USB/Class/Host/Printer.h b/LUFA/Drivers/USB/Class/Host/Printer.h index d61eb4a71408c200982f474885e01b5548b22dd1..34f8e4e88ec53406d9bbe992cd0205139d746769 100644 --- a/LUFA/Drivers/USB/Class/Host/Printer.h +++ b/LUFA/Drivers/USB/Class/Host/Printer.h @@ -66,7 +66,10 @@ const struct { uint8_t DataINPipeNumber; /**< Pipe number of the Printer interface's IN data pipe */ + bool DataINPipeDoubleBank; /** Indicates if the Printer interface's IN data pipe should use double banking */ + uint8_t DataOUTPipeNumber; /**< Pipe number of the Printer interface's OUT data pipe */ + bool DataOUTPipeDoubleBank; /** Indicates if the Printer interface's OUT data pipe should use double banking */ } Config; /**< Config data for the USB class interface within the device. All elements in this section * <b>must</b> be set or the interface will fail to enumerate and operate correctly. */ @@ -119,7 +122,7 @@ * \return A value from the \ref PRNTHost_EnumerationFailure_ErrorCodes_t enum */ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); + void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); /** Configures the printer to enable Bidirectional mode, if it is not already in this mode. This should be called * once the connected device's configuration has been set, to ensure the printer is ready to accept commands. diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.c b/LUFA/Drivers/USB/Class/Host/StillImage.c index f98f508b23b01b9359fe762476447aa2080d898c..e809c92dd7c966b1a06e41c0ab4812afa0016992 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.c +++ b/LUFA/Drivers/USB/Class/Host/StillImage.c @@ -35,7 +35,7 @@ #include "StillImage.h" uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) + void* DeviceConfigDescriptor) { uint8_t FoundEndpoints = 0; @@ -66,7 +66,7 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, u { Pipe_ConfigurePipe(SIInterfaceInfo->Config.EventsPipeNumber, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, - PIPE_BANK_DOUBLE); + SIInterfaceInfo->Config.EventsPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); SIInterfaceInfo->State.EventsPipeSize = EndpointData->EndpointSize; Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS); @@ -80,7 +80,7 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, u { Pipe_ConfigurePipe(SIInterfaceInfo->Config.DataINPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_IN, EndpointData->EndpointAddress, EndpointData->EndpointSize, - PIPE_BANK_DOUBLE); + SIInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); SIInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize; FoundEndpoints |= SI_FOUND_DATAPIPE_IN; @@ -89,7 +89,7 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, u { Pipe_ConfigurePipe(SIInterfaceInfo->Config.DataOUTPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_OUT, EndpointData->EndpointAddress, EndpointData->EndpointSize, - PIPE_BANK_DOUBLE); + SIInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE); SIInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize; FoundEndpoints |= SI_FOUND_DATAPIPE_OUT; diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h index 4f7f7fad86e32f2ceab1afda8a497c68ffd1fbc6..0493470d91e3a9556204300218e09462e5446a09 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.h +++ b/LUFA/Drivers/USB/Class/Host/StillImage.h @@ -64,8 +64,13 @@ const struct { uint8_t DataINPipeNumber; /**< Pipe number of the Still Image interface's IN data pipe */ + bool DataINPipeDoubleBank; /** Indicates if the Still Image interface's IN data pipe should use double banking */ + uint8_t DataOUTPipeNumber; /**< Pipe number of the Still Image interface's OUT data pipe */ + bool DataOUTPipeDoubleBank; /** Indicates if the Still Image interface's OUT data pipe should use double banking */ + uint8_t EventsPipeNumber; /**< Pipe number of the Still Image interface's IN events endpoint, if used */ + bool EventsPipeDoubleBank; /** Indicates if the Still Image interface's events data pipe should use double banking */ } Config; /**< Config data for the USB class interface within the device. All elements in this section * <b>must</b> be set or the interface will fail to enumerate and operate correctly. */ @@ -125,7 +130,7 @@ * \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum */ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint16_t ConfigDescriptorSize, - uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); + void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); /** Opens a new PIMA session with the attached device. This should be used before any session-orientated PIMA commands * are issued to the device. Only one session can be open at the one time. diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c index 6b20f464265a5e5cf45cc85d64ec4917fe299927..5857fba1943facad7d8bc4768b956428db8fc834 100644 --- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c +++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c @@ -69,7 +69,7 @@ uint8_t USB_GetDeviceConfigDescriptor(uint8_t ConfigNumber, uint16_t* const Conf #endif void USB_GetNextDescriptorOfType(uint16_t* const BytesRem, - uint8_t** const CurrConfigLoc, + void** const CurrConfigLoc, const uint8_t Type) { while (*BytesRem) @@ -82,7 +82,7 @@ void USB_GetNextDescriptorOfType(uint16_t* const BytesRem, } void USB_GetNextDescriptorOfTypeBefore(uint16_t* const BytesRem, - uint8_t** const CurrConfigLoc, + void** const CurrConfigLoc, const uint8_t Type, const uint8_t BeforeType) { @@ -103,7 +103,7 @@ void USB_GetNextDescriptorOfTypeBefore(uint16_t* const BytesRem, } void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem, - uint8_t** const CurrConfigLoc, + void** const CurrConfigLoc, const uint8_t Type, const uint8_t AfterType) { @@ -113,7 +113,7 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem, USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type); } -uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine) +uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, void** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine) { uint8_t ErrorCode; diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h index 9af0f6052455408631c8a18f21a397f8149c3bdc..6d57d2e780183b24cef294dcc308299abab039b7 100644 --- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h +++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h @@ -152,7 +152,7 @@ * } * \endcode */ - uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine); + uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, void** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine); /* Enums: */ /** Enum for the possible return codes of the \ref USB_GetDeviceConfigDescriptor() function. */ @@ -213,7 +213,7 @@ * \param[in] Type Descriptor type value to search for */ void USB_GetNextDescriptorOfType(uint16_t* const BytesRem, - uint8_t** const CurrConfigLoc, + void** const CurrConfigLoc, const uint8_t Type) ATTR_NON_NULL_PTR_ARG(1, 2); @@ -228,7 +228,7 @@ * \param[in] BeforeType Descriptor type value which must not be reached before the given Type descriptor */ void USB_GetNextDescriptorOfTypeBefore(uint16_t* const BytesRem, - uint8_t** const CurrConfigLoc, + void** const CurrConfigLoc, const uint8_t Type, const uint8_t BeforeType) ATTR_NON_NULL_PTR_ARG(1, 2); @@ -243,7 +243,7 @@ * \param[in] AfterType Descriptor type value which must be reached before the given Type descriptor */ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem, - uint8_t** const CurrConfigLoc, + void** const CurrConfigLoc, const uint8_t Type, const uint8_t AfterType) ATTR_NON_NULL_PTR_ARG(1, 2); @@ -256,10 +256,10 @@ * \param[in,out] CurrConfigLoc Pointer to the current descriptor inside the configuration descriptor */ static inline void USB_GetNextDescriptor(uint16_t* const BytesRem, - uint8_t** const CurrConfigLoc) + void** const CurrConfigLoc) ATTR_NON_NULL_PTR_ARG(1, 2); static inline void USB_GetNextDescriptor(uint16_t* const BytesRem, - uint8_t** const CurrConfigLoc) + void** const CurrConfigLoc) { uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size; diff --git a/LUFA/Drivers/USB/LowLevel/DevChapter9.c b/LUFA/Drivers/USB/LowLevel/DevChapter9.c index 89c4e2998cefccac9285981f8dc846f9670f99ab..bb6104fec0a3b6a4b9a33fa123b7de056ab1134c 100644 --- a/LUFA/Drivers/USB/LowLevel/DevChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/DevChapter9.c @@ -228,7 +228,7 @@ static void USB_Device_GetInternalSerialDescriptor(void) SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor); SignatureDescriptor.Header.Type = DTYPE_String; - uint8_t SigReadAddress = 0x0E; + uint8_t SigReadAddress = 0x0E; for (uint8_t SerialCharNum = 0; SerialCharNum < 20; SerialCharNum++) { @@ -314,7 +314,7 @@ static void USB_Device_GetStatus(void) break; #if !defined(CONTROL_ONLY_DEVICE) case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT): - Endpoint_SelectEndpoint((uint8_t)USB_ControlRequest.wIndex); + Endpoint_SelectEndpoint(USB_ControlRequest.wIndex & 0xFF); CurrentStatus = Endpoint_IsStalled();