aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-04-14 14:41:17 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-04-14 14:41:17 +0000
commit47f6a35013b2c6a370e5dce29aa6da3a96844695 (patch)
tree3f5842347a696c92beb74bc255c9489e6c38f49d
parente8570c4a37e41117e3fd1e989e0b41f1e9608f3c (diff)
downloadlufa-47f6a35013b2c6a370e5dce29aa6da3a96844695.tar.gz
lufa-47f6a35013b2c6a370e5dce29aa6da3a96844695.tar.bz2
lufa-47f6a35013b2c6a370e5dce29aa6da3a96844695.zip
Reintegrate the FullEPAddresses development branch into trunk.
-rw-r--r--Bootloaders/CDC/BootloaderCDC.c23
-rw-r--r--Bootloaders/CDC/Descriptors.c6
-rw-r--r--Bootloaders/CDC/Descriptors.h12
-rw-r--r--Bootloaders/HID/BootloaderHID.c4
-rw-r--r--Bootloaders/HID/Descriptors.c2
-rw-r--r--Bootloaders/HID/Descriptors.h4
-rw-r--r--BuildTests/ModuleTest/makefile6
-rw-r--r--Demos/Device/ClassDriver/AudioInput/AudioInput.c11
-rw-r--r--Demos/Device/ClassDriver/AudioInput/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/AudioInput/Descriptors.h11
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/AudioOutput.c11
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/Descriptors.h11
-rw-r--r--Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c12
-rw-r--r--Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h24
-rw-r--r--Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c63
-rw-r--r--Demos/Device/ClassDriver/GenericHID/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/GenericHID/Descriptors.h4
-rw-r--r--Demos/Device/ClassDriver/GenericHID/GenericHID.c11
-rw-r--r--Demos/Device/ClassDriver/Joystick/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/Joystick/Descriptors.h4
-rw-r--r--Demos/Device/ClassDriver/Joystick/Joystick.c11
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Descriptors.h4
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Keyboard.c11
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c4
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h8
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c21
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h4
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c11
-rw-r--r--Demos/Device/ClassDriver/MIDI/Descriptors.c4
-rw-r--r--Demos/Device/ClassDriver/MIDI/Descriptors.h8
-rw-r--r--Demos/Device/ClassDriver/MIDI/MIDI.c20
-rw-r--r--Demos/Device/ClassDriver/MassStorage/Descriptors.c4
-rw-r--r--Demos/Device/ClassDriver/MassStorage/Descriptors.h8
-rw-r--r--Demos/Device/ClassDriver/MassStorage/MassStorage.c21
-rw-r--r--Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c6
-rw-r--r--Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h12
-rw-r--r--Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c32
-rw-r--r--Demos/Device/ClassDriver/Mouse/Descriptors.c2
-rw-r--r--Demos/Device/ClassDriver/Mouse/Descriptors.h14
-rw-r--r--Demos/Device/ClassDriver/Mouse/Mouse.c11
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c6
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h12
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c31
-rw-r--r--Demos/Device/ClassDriver/VirtualSerial/Descriptors.c6
-rw-r--r--Demos/Device/ClassDriver/VirtualSerial/Descriptors.h12
-rw-r--r--Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c32
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c10
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h20
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c51
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c8
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h16
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c41
-rw-r--r--Demos/Device/Incomplete/Sideshow/Descriptors.c4
-rw-r--r--Demos/Device/Incomplete/Sideshow/Descriptors.h4
-rw-r--r--Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c32
-rw-r--r--Demos/Device/Incomplete/Sideshow/Sideshow.c8
-rw-r--r--Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c6
-rw-r--r--Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h16
-rw-r--r--Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c13
-rw-r--r--Demos/Device/LowLevel/AudioInput/AudioInput.c9
-rw-r--r--Demos/Device/LowLevel/AudioInput/Descriptors.c2
-rw-r--r--Demos/Device/LowLevel/AudioInput/Descriptors.h11
-rw-r--r--Demos/Device/LowLevel/AudioOutput/AudioOutput.c9
-rw-r--r--Demos/Device/LowLevel/AudioOutput/Descriptors.c2
-rw-r--r--Demos/Device/LowLevel/AudioOutput/Descriptors.h11
-rw-r--r--Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c12
-rw-r--r--Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h24
-rw-r--r--Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c26
-rw-r--r--Demos/Device/LowLevel/GenericHID/Descriptors.c4
-rw-r--r--Demos/Device/LowLevel/GenericHID/Descriptors.h8
-rw-r--r--Demos/Device/LowLevel/GenericHID/GenericHID.c10
-rw-r--r--Demos/Device/LowLevel/Joystick/Descriptors.c2
-rw-r--r--Demos/Device/LowLevel/Joystick/Descriptors.h4
-rw-r--r--Demos/Device/LowLevel/Joystick/Joystick.c5
-rw-r--r--Demos/Device/LowLevel/Keyboard/Descriptors.c4
-rw-r--r--Demos/Device/LowLevel/Keyboard/Descriptors.h8
-rw-r--r--Demos/Device/LowLevel/Keyboard/Keyboard.c10
-rw-r--r--Demos/Device/LowLevel/KeyboardMouse/Descriptors.c6
-rw-r--r--Demos/Device/LowLevel/KeyboardMouse/Descriptors.h12
-rw-r--r--Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c15
-rw-r--r--Demos/Device/LowLevel/MIDI/Descriptors.c4
-rw-r--r--Demos/Device/LowLevel/MIDI/Descriptors.h8
-rw-r--r--Demos/Device/LowLevel/MIDI/MIDI.c10
-rw-r--r--Demos/Device/LowLevel/MassStorage/Descriptors.c4
-rw-r--r--Demos/Device/LowLevel/MassStorage/Descriptors.h8
-rw-r--r--Demos/Device/LowLevel/MassStorage/MassStorage.c24
-rw-r--r--Demos/Device/LowLevel/Mouse/Descriptors.c2
-rw-r--r--Demos/Device/LowLevel/Mouse/Descriptors.h14
-rw-r--r--Demos/Device/LowLevel/Mouse/Mouse.c5
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/Descriptors.c6
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/Descriptors.h12
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c15
-rw-r--r--Demos/Device/LowLevel/VirtualSerial/Descriptors.c6
-rw-r--r--Demos/Device/LowLevel/VirtualSerial/Descriptors.h12
-rw-r--r--Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c13
-rw-r--r--Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c2
-rw-r--r--Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h4
-rw-r--r--Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c11
-rw-r--r--Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c13
-rw-r--r--Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c16
-rw-r--r--Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c7
-rw-r--r--Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c7
-rw-r--r--Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c17
-rw-r--r--Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c16
-rw-r--r--Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c17
-rw-r--r--Demos/Host/ClassDriver/MIDIHost/MIDIHost.c15
-rw-r--r--Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c15
-rw-r--r--Demos/Host/ClassDriver/MouseHost/MouseHost.c16
-rw-r--r--Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c17
-rw-r--r--Demos/Host/ClassDriver/PrinterHost/PrinterHost.c15
-rw-r--r--Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c26
-rw-r--r--Demos/Host/ClassDriver/StillImageHost/StillImageHost.c23
-rw-r--r--Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c23
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c9
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h6
-rw-r--r--Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c6
-rw-r--r--Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h7
-rw-r--r--Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c3
-rw-r--r--Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h4
-rw-r--r--Demos/Host/LowLevel/AudioInputHost/Doxygen.conf2
-rw-r--r--Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c3
-rw-r--r--Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h4
-rw-r--r--Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf2
-rw-r--r--Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c6
-rw-r--r--Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h8
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c3
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h4
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf2
-rw-r--r--Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c3
-rw-r--r--Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h4
-rw-r--r--Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c3
-rw-r--r--Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h4
-rw-r--r--Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf2
-rw-r--r--Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c6
-rw-r--r--Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h8
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c6
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h8
-rw-r--r--Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c3
-rw-r--r--Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h4
-rw-r--r--Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c3
-rw-r--r--Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h4
-rw-r--r--Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf2
-rw-r--r--Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c6
-rw-r--r--Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h8
-rw-r--r--Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c9
-rw-r--r--Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h12
-rw-r--r--Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c9
-rw-r--r--Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h12
-rw-r--r--Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c9
-rw-r--r--Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h12
-rw-r--r--LUFA/Common/ArchitectureSpecific.h55
-rw-r--r--LUFA/DoxygenPages/ChangeLog.txt12
-rw-r--r--LUFA/DoxygenPages/DeviceSupport.txt30
-rw-r--r--LUFA/DoxygenPages/FutureChanges.txt1
-rw-r--r--LUFA/DoxygenPages/LUFAPoweredProjects.txt1
-rw-r--r--LUFA/DoxygenPages/MigrationInformation.txt19
-rw-r--r--LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h13
-rw-r--r--LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h21
-rw-r--r--LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h9
-rw-r--r--LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h11
-rw-r--r--LUFA/Drivers/USB/Class/Device/AudioClassDevice.c57
-rw-r--r--LUFA/Drivers/USB/Class/Device/AudioClassDevice.h25
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDCClassDevice.c61
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDCClassDevice.h18
-rw-r--r--LUFA/Drivers/USB/Class/Device/HIDClassDevice.c14
-rw-r--r--LUFA/Drivers/USB/Class/Device/HIDClassDevice.h4
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c46
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h9
-rw-r--r--LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c62
-rw-r--r--LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h9
-rw-r--r--LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c59
-rw-r--r--LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h14
-rw-r--r--LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c64
-rw-r--r--LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h10
-rw-r--r--LUFA/Drivers/USB/Class/Host/AudioClassHost.c58
-rw-r--r--LUFA/Drivers/USB/Class/Host/AudioClassHost.h17
-rw-r--r--LUFA/Drivers/USB/Class/Host/CDCClassHost.c90
-rw-r--r--LUFA/Drivers/USB/Class/Host/CDCClassHost.h15
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDClassHost.c68
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDClassHost.h10
-rw-r--r--LUFA/Drivers/USB/Class/Host/MIDIClassHost.c58
-rw-r--r--LUFA/Drivers/USB/Class/Host/MIDIClassHost.h10
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c74
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h10
-rw-r--r--LUFA/Drivers/USB/Class/Host/PrinterClassHost.c64
-rw-r--r--LUFA/Drivers/USB/Class/Host/PrinterClassHost.h10
-rw-r--r--LUFA/Drivers/USB/Class/Host/RNDISClassHost.c80
-rw-r--r--LUFA/Drivers/USB/Class/Host/RNDISClassHost.h15
-rw-r--r--LUFA/Drivers/USB/Class/Host/StillImageClassHost.c92
-rw-r--r--LUFA/Drivers/USB/Class/Host/StillImageClassHost.h15
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c15
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h175
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c8
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c34
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h116
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c3
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c3
-rw-r--r--LUFA/Drivers/USB/Core/Endpoint.h12
-rw-r--r--LUFA/Drivers/USB/Core/Pipe.h18
-rw-r--r--LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c17
-rw-r--r--LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h205
-rw-r--r--LUFA/Drivers/USB/Core/UC3/Host_UC3.c8
-rw-r--r--LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c34
-rw-r--r--LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h124
-rw-r--r--LUFA/Drivers/USB/Core/UC3/USBController_UC3.c3
-rw-r--r--LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c3
-rw-r--r--LUFA/Drivers/USB/Core/USBController.h18
-rw-r--r--LUFA/Drivers/USB/Core/USBMode.h17
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h2
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c30
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h182
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c13
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h2
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c3
-rw-r--r--LUFA/Drivers/USB/USB.h26
-rw-r--r--LUFA/Platform/XMEGA/ClockManagement.h36
-rw-r--r--Projects/AVRISP-MKII/AVRISP-MKII.c8
-rw-r--r--Projects/AVRISP-MKII/Descriptors.c4
-rw-r--r--Projects/AVRISP-MKII/Descriptors.h17
-rw-r--r--Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c18
-rw-r--r--Projects/AVRISP-MKII/Lib/V2Protocol.c12
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c16
-rw-r--r--Projects/Benito/Benito.c32
-rw-r--r--Projects/Benito/Descriptors.c6
-rw-r--r--Projects/Benito/Descriptors.h12
-rw-r--r--Projects/HIDReportViewer/HIDReportViewer.c17
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/Descriptors.c4
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/Descriptors.h20
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/DiskDevice.c21
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/DiskHost.c15
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c2
-rw-r--r--Projects/LEDNotifier/Descriptors.c6
-rw-r--r--Projects/LEDNotifier/Descriptors.h12
-rw-r--r--Projects/LEDNotifier/LEDNotifier.c32
-rw-r--r--Projects/MIDIToneGenerator/Descriptors.c4
-rw-r--r--Projects/MIDIToneGenerator/Descriptors.h8
-rw-r--r--Projects/MIDIToneGenerator/MIDIToneGenerator.c20
-rw-r--r--Projects/Magstripe/Descriptors.c2
-rw-r--r--Projects/Magstripe/Descriptors.h4
-rw-r--r--Projects/Magstripe/Magstripe.c11
-rw-r--r--Projects/MediaController/Descriptors.c2
-rw-r--r--Projects/MediaController/Descriptors.h8
-rw-r--r--Projects/MediaController/MediaController.c11
-rw-r--r--Projects/MissileLauncher/ConfigDescriptor.c6
-rw-r--r--Projects/MissileLauncher/ConfigDescriptor.h8
-rw-r--r--Projects/RelayBoard/Doxygen.conf2
-rw-r--r--Projects/TempDataLogger/Descriptors.c6
-rw-r--r--Projects/TempDataLogger/Descriptors.h12
-rw-r--r--Projects/TempDataLogger/TempDataLogger.c32
-rw-r--r--Projects/USBtoSerial/Descriptors.c6
-rw-r--r--Projects/USBtoSerial/Descriptors.h12
-rw-r--r--Projects/USBtoSerial/USBtoSerial.c30
-rw-r--r--Projects/Webserver/Descriptors.c10
-rw-r--r--Projects/Webserver/Descriptors.h20
-rw-r--r--Projects/Webserver/USBDeviceMode.c54
-rw-r--r--Projects/Webserver/USBHostMode.c26
-rw-r--r--Projects/XPLAINBridge/AVRISPDescriptors.c4
-rw-r--r--Projects/XPLAINBridge/AVRISPDescriptors.h17
-rw-r--r--Projects/XPLAINBridge/Doxygen.conf2
-rw-r--r--Projects/XPLAINBridge/USARTDescriptors.c6
-rw-r--r--Projects/XPLAINBridge/USARTDescriptors.h12
-rw-r--r--Projects/XPLAINBridge/XPLAINBridge.c38
265 files changed, 2128 insertions, 2494 deletions
diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c
index e9ea8ae35..a7fc883cf 100644
--- a/Bootloaders/CDC/BootloaderCDC.c
+++ b/Bootloaders/CDC/BootloaderCDC.c
@@ -122,17 +122,12 @@ ISR(TIMER1_OVF_vect, ISR_BLOCK)
void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Setup CDC Notification, Rx and Tx Endpoints */
- Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
- ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
- ENDPOINT_BANK_SINGLE);
+ Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT,
+ CDC_NOTIFICATION_EPSIZE, 1);
- Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
- ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
- ENDPOINT_BANK_SINGLE);
+ Endpoint_ConfigureEndpoint(CDC_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
- Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
- ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
- ENDPOINT_BANK_SINGLE);
+ Endpoint_ConfigureEndpoint(CDC_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
}
/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
@@ -303,7 +298,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
static uint8_t FetchNextCommandByte(void)
{
/* Select the OUT endpoint so that the next data byte can be read */
- Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_RX_EPADDR);
/* If OUT endpoint empty, clear it and wait for the next packet from the host */
while (!(Endpoint_IsReadWriteAllowed()))
@@ -329,7 +324,7 @@ static uint8_t FetchNextCommandByte(void)
static void WriteNextResponseByte(const uint8_t Response)
{
/* Select the IN endpoint so that the next data byte can be written */
- Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_TX_EPADDR);
/* If IN endpoint full, clear it and wait until ready for the next packet to the host */
if (!(Endpoint_IsReadWriteAllowed()))
@@ -353,7 +348,7 @@ static void WriteNextResponseByte(const uint8_t Response)
static void CDC_Task(void)
{
/* Select the OUT endpoint */
- Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_RX_EPADDR);
/* Check if endpoint has a command in it sent from the host */
if (!(Endpoint_IsOUTReceived()))
@@ -549,7 +544,7 @@ static void CDC_Task(void)
}
/* Select the IN endpoint */
- Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_TX_EPADDR);
/* Remember if the endpoint is completely full before clearing it */
bool IsEndpointFull = !(Endpoint_IsReadWriteAllowed());
@@ -577,7 +572,7 @@ static void CDC_Task(void)
}
/* Select the OUT endpoint */
- Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_RX_EPADDR);
/* Acknowledge the command from the host */
Endpoint_ClearOUT();
diff --git a/Bootloaders/CDC/Descriptors.c b/Bootloaders/CDC/Descriptors.c
index 4bf3eced5..4b769c223 100644
--- a/Bootloaders/CDC/Descriptors.c
+++ b/Bootloaders/CDC/Descriptors.c
@@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -167,7 +167,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Bootloaders/CDC/Descriptors.h b/Bootloaders/CDC/Descriptors.h
index e5ef64102..0010fc69b 100644
--- a/Bootloaders/CDC/Descriptors.h
+++ b/Bootloaders/CDC/Descriptors.h
@@ -92,14 +92,14 @@
#error The selected AVR part is not currently supported by this bootloader.
#endif
- /** Endpoint number for the CDC control interface event notification endpoint. */
- #define CDC_NOTIFICATION_EPNUM 2
+ /** Endpoint address for the CDC control interface event notification endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number for the CDC data interface TX (data IN) endpoint. */
- #define CDC_TX_EPNUM 3
+ /** Endpoint address for the CDC data interface TX (data IN) endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number for the CDC data interface RX (data OUT) endpoint. */
- #define CDC_RX_EPNUM 4
+ /** Endpoint address for the CDC data interface RX (data OUT) endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size of the CDC data interface TX and RX data endpoint banks, in bytes. */
#define CDC_TXRX_EPSIZE 16
diff --git a/Bootloaders/HID/BootloaderHID.c b/Bootloaders/HID/BootloaderHID.c
index 928000f8b..d8f0186af 100644
--- a/Bootloaders/HID/BootloaderHID.c
+++ b/Bootloaders/HID/BootloaderHID.c
@@ -85,9 +85,7 @@ static void SetupHardware(void)
void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Setup HID Report Endpoint */
- Endpoint_ConfigureEndpoint(HID_IN_EPNUM, EP_TYPE_INTERRUPT,
- ENDPOINT_DIR_IN, HID_IN_EPSIZE,
- ENDPOINT_BANK_SINGLE);
+ Endpoint_ConfigureEndpoint(HID_IN_EPADDR, EP_TYPE_INTERRUPT, HID_IN_EPSIZE, 1);
}
/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
diff --git a/Bootloaders/HID/Descriptors.c b/Bootloaders/HID/Descriptors.c
index 5d4271e0c..a53101555 100644
--- a/Bootloaders/HID/Descriptors.c
+++ b/Bootloaders/HID/Descriptors.c
@@ -137,7 +137,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | HID_IN_EPNUM),
+ .EndpointAddress = HID_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_IN_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Bootloaders/HID/Descriptors.h b/Bootloaders/HID/Descriptors.h
index 41c4ee402..ad216038a 100644
--- a/Bootloaders/HID/Descriptors.h
+++ b/Bootloaders/HID/Descriptors.h
@@ -55,8 +55,8 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the HID data IN endpoint. */
- #define HID_IN_EPNUM 1
+ /** Endpoint address of the HID data IN endpoint. */
+ #define HID_IN_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the HID reporting IN endpoint. */
#define HID_IN_EPSIZE 64
diff --git a/BuildTests/ModuleTest/makefile b/BuildTests/ModuleTest/makefile
index 974a3ddbb..c0d3ec040 100644
--- a/BuildTests/ModuleTest/makefile
+++ b/BuildTests/ModuleTest/makefile
@@ -15,7 +15,7 @@
# List of device families per architecture, one device per architecture sub-family
AVR8_FAMILIES = at90usb1287 at90usb1286 atmega16u4 atmega16u2 at90usb162
-XMEGA_FAMILIES = atxmega128a1u atxmega128a3u atxmega256a3bu atxmega128a4u atxmega128b1 atxmega128b3
+XMEGA_FAMILIES = atxmega128a1u atxmega128a3u atxmega256a3bu atxmega128a4u atxmega128b1 atxmega128b3 atxmega128c3 atxmega32c4
UC3_FAMILIES = uc3a0256 uc3a1256 uc3a3256 uc3a4256 uc3b0256 uc3b1256
# List of all device families, with a family postfix
@@ -24,6 +24,10 @@ DEVICE_FAMILIES = $(AVR8_FAMILIES:%=%.avr8) $(XMEGA_FAMILIES:%=%.xmega) $(UC3_FA
all: begin $(DEVICE_FAMILIES) clean end
+arch_avr8: begin $(AVR8_FAMILIES:%=%.avr8) end
+arch_xmega: begin $(XMEGA_FAMILIES:%=%.xmega) end
+arch_uc3: begin $(UC3_FAMILIES:%=%.uc3) end
+
begin:
@echo Executing build test "ModuleTest".
@echo
diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c
index 382446a80..867a09eef 100644
--- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c
+++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c
@@ -46,9 +46,12 @@ USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface =
{
.ControlInterfaceNumber = 0,
.StreamingInterfaceNumber = 1,
-
- .DataINEndpointNumber = AUDIO_STREAM_EPNUM,
- .DataINEndpointSize = AUDIO_STREAM_EPSIZE,
+ .DataINEndpoint =
+ {
+ .Address = AUDIO_STREAM_EPADDR,
+ .Size = AUDIO_STREAM_EPSIZE,
+ .Banks = 2,
+ },
},
};
@@ -197,7 +200,7 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t*
uint8_t* Data)
{
/* Check the requested endpoint to see if a supported endpoint is being manipulated */
- if (EndpointAddress == (ENDPOINT_DIR_IN | Microphone_Audio_Interface.Config.DataINEndpointNumber))
+ if (EndpointAddress == Microphone_Audio_Interface.Config.DataINEndpoint.Address)
{
/* Check the requested control to see if a supported control is being manipulated */
if (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)
diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.c b/Demos/Device/ClassDriver/AudioInput/Descriptors.c
index 6b7593f52..8557e18e5 100644
--- a/Demos/Device/ClassDriver/AudioInput/Descriptors.c
+++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.c
@@ -220,7 +220,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM),
+ .EndpointAddress = AUDIO_STREAM_EPADDR,
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AUDIO_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.h b/Demos/Device/ClassDriver/AudioInput/Descriptors.h
index ac0a536de..359a28730 100644
--- a/Demos/Device/ClassDriver/AudioInput/Descriptors.h
+++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.h
@@ -42,14 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the Audio isochronous streaming data endpoint. */
- #define AUDIO_STREAM_EPNUM 1
+ /** Endpoint address of the Audio isochronous streaming data IN endpoint. */
+ #define AUDIO_STREAM_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires
- * at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller
- * USB AVR models will result in unavoidable distorted output.
- */
- #define AUDIO_STREAM_EPSIZE ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)
+ /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. */
+ #define AUDIO_STREAM_EPSIZE 256
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
index 78d81f57a..82f664a9b 100644
--- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
+++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
@@ -46,9 +46,12 @@ USB_ClassInfo_Audio_Device_t Speaker_Audio_Interface =
{
.ControlInterfaceNumber = 0,
.StreamingInterfaceNumber = 1,
-
- .DataOUTEndpointNumber = AUDIO_STREAM_EPNUM,
- .DataOUTEndpointSize = AUDIO_STREAM_EPSIZE,
+ .DataOUTEndpoint =
+ {
+ .Address = AUDIO_STREAM_EPADDR,
+ .Size = AUDIO_STREAM_EPSIZE,
+ .Banks = 2,
+ },
},
};
@@ -234,7 +237,7 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t*
uint8_t* Data)
{
/* Check the requested endpoint to see if a supported endpoint is being manipulated */
- if (EndpointAddress == (ENDPOINT_DIR_OUT | Speaker_Audio_Interface.Config.DataOUTEndpointNumber))
+ if (EndpointAddress == Speaker_Audio_Interface.Config.DataOUTEndpoint.Address)
{
/* Check the requested control to see if a supported control is being manipulated */
if (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)
diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c
index 06cc5caf5..0df27453e 100644
--- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c
+++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c
@@ -220,7 +220,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | AUDIO_STREAM_EPNUM),
+ .EndpointAddress = AUDIO_STREAM_EPADDR,
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AUDIO_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h
index ac0a536de..d5c8a2b84 100644
--- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h
+++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h
@@ -42,14 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the Audio isochronous streaming data endpoint. */
- #define AUDIO_STREAM_EPNUM 1
+ /** Endpoint address of the Audio isochronous streaming data OUT endpoint. */
+ #define AUDIO_STREAM_EPADDR (ENDPOINT_DIR_OUT | 1)
- /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires
- * at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller
- * USB AVR models will result in unavoidable distorted output.
- */
- #define AUDIO_STREAM_EPSIZE ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)
+ /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. */
+ #define AUDIO_STREAM_EPSIZE 256
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c
index 5df6808c6..7542ab9af 100644
--- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c
+++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC1_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC1_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC1_RX_EPNUM),
+ .EndpointAddress = CDC1_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -193,7 +193,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC1_TX_EPNUM),
+ .EndpointAddress = CDC1_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -258,7 +258,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC2_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC2_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -284,7 +284,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC2_RX_EPNUM),
+ .EndpointAddress = CDC2_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -294,7 +294,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC2_TX_EPNUM),
+ .EndpointAddress = CDC2_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h
index 01d10f29b..dc3aa0b86 100644
--- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h
+++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h
@@ -42,23 +42,23 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the first CDC interface's device-to-host data IN endpoint. */
- #define CDC1_TX_EPNUM 1
+ /** Endpoint address of the first CDC interface's device-to-host data IN endpoint. */
+ #define CDC1_TX_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the first CDC interface's host-to-device data OUT endpoint. */
- #define CDC1_RX_EPNUM 2
+ /** Endpoint address of the first CDC interface's host-to-device data OUT endpoint. */
+ #define CDC1_RX_EPADDR (ENDPOINT_DIR_OUT | 2)
- /** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */
- #define CDC1_NOTIFICATION_EPNUM 3
+ /** Endpoint address of the first CDC interface's device-to-host notification IN endpoint. */
+ #define CDC1_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the second CDC interface's device-to-host data IN endpoint. */
- #define CDC2_TX_EPNUM 4
+ /** Endpoint address of the second CDC interface's device-to-host data IN endpoint. */
+ #define CDC2_TX_EPADDR (ENDPOINT_DIR_IN | 4)
- /** Endpoint number of the second CDC interface's host-to-device data OUT endpoint. */
- #define CDC2_RX_EPNUM 5
+ /** Endpoint address of the second CDC interface's host-to-device data OUT endpoint. */
+ #define CDC2_RX_EPADDR (ENDPOINT_DIR_OUT | 5)
- /** Endpoint number of the second CDC interface's device-to-host notification IN endpoint. */
- #define CDC2_NOTIFICATION_EPNUM 6
+ /** Endpoint address of the second CDC interface's device-to-host notification IN endpoint. */
+ #define CDC2_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 6)
/** Size in bytes of the CDC device-to-host notification IN endpoints. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
index 8f1eb96cf..a07967c05 100644
--- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
+++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
@@ -45,19 +45,25 @@ USB_ClassInfo_CDC_Device_t VirtualSerial1_CDC_Interface =
{
.Config =
{
- .ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC1_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC1_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
- .NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
+ .ControlInterfaceNumber = 0,
+ .DataINEndpoint =
+ {
+ .Address = CDC1_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC1_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC1_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
},
};
@@ -70,19 +76,26 @@ USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =
{
.Config =
{
- .ControlInterfaceNumber = 2,
-
- .DataINEndpointNumber = CDC2_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC2_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
+ .ControlInterfaceNumber = 2,
+ .DataINEndpoint =
+ {
+ .Address = CDC2_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC2_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC2_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
- .NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
},
};
diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.c b/Demos/Device/ClassDriver/GenericHID/Descriptors.c
index ee1ba49c8..f8bb128f9 100644
--- a/Demos/Device/ClassDriver/GenericHID/Descriptors.c
+++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.c
@@ -135,7 +135,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | GENERIC_IN_EPNUM),
+ .EndpointAddress = GENERIC_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = GENERIC_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.h b/Demos/Device/ClassDriver/GenericHID/Descriptors.h
index ddeef240c..0b9ec8f71 100644
--- a/Demos/Device/ClassDriver/GenericHID/Descriptors.h
+++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.h
@@ -57,8 +57,8 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Generic HID reporting IN endpoint. */
- #define GENERIC_IN_EPNUM 1
+ /** Endpoint address of the Generic HID reporting IN endpoint. */
+ #define GENERIC_IN_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the Generic HID reporting endpoint. */
#define GENERIC_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c
index 36eb8f7fe..aa365bde2 100644
--- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c
+++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c
@@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = GENERIC_IN_EPNUM,
- .ReportINEndpointSize = GENERIC_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = GENERIC_IN_EPADDR,
+ .Size = GENERIC_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevHIDReportBuffer),
},
diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c
index da6fc3d09..d0a469f6b 100644
--- a/Demos/Device/ClassDriver/Joystick/Descriptors.c
+++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c
@@ -135,7 +135,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | JOYSTICK_EPNUM),
+ .EndpointAddress = JOYSTICK_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = JOYSTICK_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.h b/Demos/Device/ClassDriver/Joystick/Descriptors.h
index f0ad9c2f1..d2e294316 100644
--- a/Demos/Device/ClassDriver/Joystick/Descriptors.h
+++ b/Demos/Device/ClassDriver/Joystick/Descriptors.h
@@ -57,8 +57,8 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Joystick HID reporting IN endpoint. */
- #define JOYSTICK_EPNUM 1
+ /** Endpoint address of the Joystick HID reporting IN endpoint. */
+ #define JOYSTICK_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the Joystick HID reporting IN endpoint. */
#define JOYSTICK_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c
index 3c1913f8f..4f361daf0 100644
--- a/Demos/Device/ClassDriver/Joystick/Joystick.c
+++ b/Demos/Device/ClassDriver/Joystick/Joystick.c
@@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Joystick_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = JOYSTICK_EPNUM,
- .ReportINEndpointSize = JOYSTICK_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = JOYSTICK_EPADDR,
+ .Size = JOYSTICK_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevJoystickHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevJoystickHIDReportBuffer),
},
diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.c b/Demos/Device/ClassDriver/Keyboard/Descriptors.c
index cb7852667..84ec47a98 100644
--- a/Demos/Device/ClassDriver/Keyboard/Descriptors.c
+++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.c
@@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_EPNUM),
+ .EndpointAddress = KEYBOARD_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.h b/Demos/Device/ClassDriver/Keyboard/Descriptors.h
index 370489514..f032b728e 100644
--- a/Demos/Device/ClassDriver/Keyboard/Descriptors.h
+++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.h
@@ -57,8 +57,8 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Keyboard HID reporting IN endpoint. */
- #define KEYBOARD_EPNUM 1
+ /** Endpoint address of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the Keyboard HID reporting IN endpoint. */
#define KEYBOARD_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
index 15a7f1760..24bf8d5fa 100644
--- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c
+++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
@@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = KEYBOARD_EPNUM,
- .ReportINEndpointSize = KEYBOARD_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = KEYBOARD_EPADDR,
+ .Size = KEYBOARD_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevKeyboardHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer),
},
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c
index d6471d6e7..207e7829b 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c
+++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c
@@ -147,7 +147,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM),
+ .EndpointAddress = KEYBOARD_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x01
@@ -184,7 +184,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_IN_EPNUM),
+ .EndpointAddress = MOUSE_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h
index fe41f923e..e35e266c0 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h
+++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h
@@ -62,11 +62,11 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Keyboard HID reporting IN endpoint. */
- #define KEYBOARD_IN_EPNUM 1
+ /** Endpoint address of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_IN_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the Mouse HID reporting IN endpoint. */
- #define MOUSE_IN_EPNUM 3
+ /** Endpoint address of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
/** Size in bytes of each of the HID reporting IN endpoints. */
#define HID_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
index cb2eebf81..7b5caa405 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
+++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
@@ -52,11 +52,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = KEYBOARD_IN_EPNUM,
- .ReportINEndpointSize = HID_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = KEYBOARD_IN_EPADDR,
+ .Size = HID_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevKeyboardHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer),
},
@@ -72,10 +73,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
.Config =
{
.InterfaceNumber = 1,
-
- .ReportINEndpointNumber = MOUSE_IN_EPNUM,
- .ReportINEndpointSize = HID_EPSIZE,
-
+ .ReportINEndpoint =
+ {
+ .Address = MOUSE_IN_EPADDR,
+ .Size = HID_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevMouseHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer),
},
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c
index f08cdc717..fc2eafccd 100644
--- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c
+++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c
@@ -194,7 +194,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | HID_IN_EPNUM),
+ .EndpointAddress = HID_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h
index f579edfb8..5632aa849 100644
--- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h
+++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h
@@ -57,8 +57,8 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the HID reporting IN endpoint. */
- #define HID_IN_EPNUM 1
+ /** Endpoint address of the HID reporting IN endpoint. */
+ #define HID_IN_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of each of the HID reporting IN endpoint. */
#define HID_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c
index 7197959bb..c0526abfd 100644
--- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c
+++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c
@@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Device_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = HID_IN_EPNUM,
- .ReportINEndpointSize = HID_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = HID_IN_EPADDR,
+ .Size = HID_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevHIDReportBuffer),
},
diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.c b/Demos/Device/ClassDriver/MIDI/Descriptors.c
index 9ad0e86a5..84898acf6 100644
--- a/Demos/Device/ClassDriver/MIDI/Descriptors.c
+++ b/Demos/Device/ClassDriver/MIDI/Descriptors.c
@@ -199,7 +199,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
+ .EndpointAddress = MIDI_STREAM_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MIDI_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
@@ -224,7 +224,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM),
+ .EndpointAddress = MIDI_STREAM_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MIDI_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.h b/Demos/Device/ClassDriver/MIDI/Descriptors.h
index c5dc2e217..83844449d 100644
--- a/Demos/Device/ClassDriver/MIDI/Descriptors.h
+++ b/Demos/Device/ClassDriver/MIDI/Descriptors.h
@@ -42,11 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
- #define MIDI_STREAM_IN_EPNUM 2
+ /** Endpoint address of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
+ #define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
- #define MIDI_STREAM_OUT_EPNUM 1
+ /** Endpoint address of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
+ #define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | 1)
/** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */
#define MIDI_STREAM_EPSIZE 64
diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.c b/Demos/Device/ClassDriver/MIDI/MIDI.c
index 317c37db0..a55c6a70e 100644
--- a/Demos/Device/ClassDriver/MIDI/MIDI.c
+++ b/Demos/Device/ClassDriver/MIDI/MIDI.c
@@ -45,14 +45,18 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
.Config =
{
.StreamingInterfaceNumber = 1,
-
- .DataINEndpointNumber = MIDI_STREAM_IN_EPNUM,
- .DataINEndpointSize = MIDI_STREAM_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = MIDI_STREAM_OUT_EPNUM,
- .DataOUTEndpointSize = MIDI_STREAM_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
+ .DataINEndpoint =
+ {
+ .Address = MIDI_STREAM_IN_EPADDR,
+ .Size = MIDI_STREAM_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MIDI_STREAM_OUT_EPADDR,
+ .Size = MIDI_STREAM_EPSIZE,
+ .Banks = 1,
+ },
},
};
diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.c b/Demos/Device/ClassDriver/MassStorage/Descriptors.c
index fb829423a..0ab09b6a5 100644
--- a/Demos/Device/ClassDriver/MassStorage/Descriptors.c
+++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.c
@@ -118,7 +118,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ .EndpointAddress = MASS_STORAGE_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -128,7 +128,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ .EndpointAddress = MASS_STORAGE_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.h b/Demos/Device/ClassDriver/MassStorage/Descriptors.h
index 813f99520..84879e822 100644
--- a/Demos/Device/ClassDriver/MassStorage/Descriptors.h
+++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.h
@@ -42,11 +42,11 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
- #define MASS_STORAGE_IN_EPNUM 3
+ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */
+ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
- #define MASS_STORAGE_OUT_EPNUM 4
+ /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */
+ #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the Mass Storage data endpoints. */
#define MASS_STORAGE_IO_EPSIZE 64
diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.c b/Demos/Device/ClassDriver/MassStorage/MassStorage.c
index 6a720f983..0ba06a5d0 100644
--- a/Demos/Device/ClassDriver/MassStorage/MassStorage.c
+++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.c
@@ -45,15 +45,18 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
- .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
- .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
+ .DataINEndpoint =
+ {
+ .Address = MASS_STORAGE_IN_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MASS_STORAGE_OUT_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
.TotalLUNs = TOTAL_LUNS,
},
};
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
index 27909034c..e7c9486b8 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
@@ -133,7 +133,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ .EndpointAddress = MASS_STORAGE_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -143,7 +143,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ .EndpointAddress = MASS_STORAGE_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -180,7 +180,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_EPNUM),
+ .EndpointAddress = KEYBOARD_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
index 86f6cc4c4..fb1a3794f 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
@@ -43,17 +43,17 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the Keyboard HID reporting IN endpoint. */
- #define KEYBOARD_EPNUM 1
+ /** Endpoint address of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the Keyboard HID reporting IN endpoint. */
#define KEYBOARD_EPSIZE 8
- /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
- #define MASS_STORAGE_IN_EPNUM 3
+ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */
+ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
- #define MASS_STORAGE_OUT_EPNUM 4
+ /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */
+ #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the Mass Storage data endpoints. */
#define MASS_STORAGE_IO_EPSIZE 64
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
index bfdf09ceb..7e12a5d6e 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
@@ -46,15 +46,18 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
- .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
- .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
+ .DataINEndpoint =
+ {
+ .Address = MASS_STORAGE_IN_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MASS_STORAGE_OUT_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
.TotalLUNs = TOTAL_LUNS,
},
};
@@ -71,11 +74,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
.Config =
{
.InterfaceNumber = 1,
-
- .ReportINEndpointNumber = KEYBOARD_EPNUM,
- .ReportINEndpointSize = KEYBOARD_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = KEYBOARD_EPADDR,
+ .Size = KEYBOARD_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevKeyboardHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer),
},
diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.c b/Demos/Device/ClassDriver/Mouse/Descriptors.c
index 1a7af876c..93bd02d61 100644
--- a/Demos/Device/ClassDriver/Mouse/Descriptors.c
+++ b/Demos/Device/ClassDriver/Mouse/Descriptors.c
@@ -136,7 +136,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM),
+ .EndpointAddress = MOUSE_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MOUSE_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.h b/Demos/Device/ClassDriver/Mouse/Descriptors.h
index da78dd0ff..abcd938a8 100644
--- a/Demos/Device/ClassDriver/Mouse/Descriptors.h
+++ b/Demos/Device/ClassDriver/Mouse/Descriptors.h
@@ -41,6 +41,13 @@
#include <avr/pgmspace.h>
+ /* Macros: */
+ /** Endpoint address of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPADDR (ENDPOINT_DIR_IN | 1)
+
+ /** Size in bytes of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPSIZE 8
+
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
* application code, as the configuration descriptor contains several sub-descriptors which
@@ -56,13 +63,6 @@
USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t;
- /* Macros: */
- /** Endpoint number of the Mouse HID reporting IN endpoint. */
- #define MOUSE_EPNUM 1
-
- /** Size in bytes of the Mouse HID reporting IN endpoint. */
- #define MOUSE_EPSIZE 8
-
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c
index 04d4268f0..00cadb41c 100644
--- a/Demos/Device/ClassDriver/Mouse/Mouse.c
+++ b/Demos/Device/ClassDriver/Mouse/Mouse.c
@@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = MOUSE_EPNUM,
- .ReportINEndpointSize = MOUSE_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = MOUSE_EPADDR,
+ .Size = MOUSE_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevMouseHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer),
},
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c
index 41bc4b59e..86cc420c7 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c
+++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c
@@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -167,7 +167,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h
index 7c40d87a1..6301b83aa 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h
+++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h
@@ -42,14 +42,14 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 3
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 1
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 2
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 2)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
index 2a8ba9735..37fb817de 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
+++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
@@ -45,19 +45,24 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface =
.Config =
{
.ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
-
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
.AdapterVendorDescription = "LUFA RNDIS Demo Adapter",
.AdapterMACAddress = {ADAPTER_MAC_ADDRESS},
},
diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c
index f4e9fb324..0858bc47c 100644
--- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c
+++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c
@@ -143,7 +143,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -169,7 +169,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -179,7 +179,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h
index fb69344cb..af9183ed2 100644
--- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h
+++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h
@@ -42,14 +42,14 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 3
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 4
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c
index c3e16edb0..8b11c298c 100644
--- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c
+++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c
@@ -44,19 +44,25 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{
.Config =
{
- .ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
+ .ControlInterfaceNumber = 0,
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
},
};
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c
index 299ddbdca..a3738651e 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -193,7 +193,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -219,7 +219,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ .EndpointAddress = MASS_STORAGE_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -229,7 +229,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ .EndpointAddress = MASS_STORAGE_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h
index b4b5ef67a..544a2b5c0 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h
@@ -42,14 +42,14 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 1
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 2
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 3
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 3)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
@@ -57,11 +57,11 @@
/** Size in bytes of the CDC data IN and OUT endpoints. */
#define CDC_TXRX_EPSIZE 16
- /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
- #define MASS_STORAGE_IN_EPNUM 4
+ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */
+ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 4)
- /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
- #define MASS_STORAGE_OUT_EPNUM 5
+ /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */
+ #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 5)
/** Size in bytes of the Mass Storage data endpoints. */
#define MASS_STORAGE_IO_EPSIZE 64
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c
index d8ffea873..14d6abdd9 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c
@@ -45,18 +45,24 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
.Config =
{
.ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
},
};
@@ -69,15 +75,18 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
.Config =
{
.InterfaceNumber = 2,
-
- .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
- .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
- .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
+ .DataINEndpoint =
+ {
+ .Address = MASS_STORAGE_IN_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MASS_STORAGE_OUT_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
.TotalLUNs = TOTAL_LUNS,
},
};
diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c
index af674563f..0a40b4fa8 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c
+++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c
@@ -176,7 +176,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -202,7 +202,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -212,7 +212,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -249,7 +249,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM),
+ .EndpointAddress = MOUSE_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MOUSE_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h
index 2509314b2..06cfd459b 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h
+++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h
@@ -42,14 +42,14 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 3
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 4
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
@@ -57,8 +57,8 @@
/** Size in bytes of the CDC data IN and OUT endpoints. */
#define CDC_TXRX_EPSIZE 16
- /** Endpoint number of the Mouse HID reporting IN endpoint. */
- #define MOUSE_EPNUM 1
+ /** Endpoint address of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the Mouse HID reporting IN endpoint. */
#define MOUSE_EPSIZE 8
diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
index f2d67542d..dbbc8e7b4 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
+++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
@@ -45,18 +45,24 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
.Config =
{
.ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
},
};
@@ -72,11 +78,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
.Config =
{
.InterfaceNumber = 2,
-
- .ReportINEndpointNumber = MOUSE_EPNUM,
- .ReportINEndpointSize = MOUSE_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = MOUSE_EPADDR,
+ .Size = MOUSE_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevMouseHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer),
},
diff --git a/Demos/Device/Incomplete/Sideshow/Descriptors.c b/Demos/Device/Incomplete/Sideshow/Descriptors.c
index 533c92121..cc1a094c8 100644
--- a/Demos/Device/Incomplete/Sideshow/Descriptors.c
+++ b/Demos/Device/Incomplete/Sideshow/Descriptors.c
@@ -89,7 +89,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
- EndpointAddress: (ENDPOINT_DIR_IN | SIDESHOW_IN_EPNUM),
+ EndpointAddress: SIDESHOW_IN_EPADDR,
Attributes: EP_TYPE_BULK,
EndpointSize: SIDESHOW_IO_EPSIZE,
PollingIntervalMS: 0x00
@@ -99,7 +99,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
- EndpointAddress: (ENDPOINT_DIR_OUT | SIDESHOW_OUT_EPNUM),
+ EndpointAddress: SIDESHOW_OUT_EPADDR,
Attributes: EP_TYPE_BULK,
EndpointSize: SIDESHOW_IO_EPSIZE,
PollingIntervalMS: 0x00
diff --git a/Demos/Device/Incomplete/Sideshow/Descriptors.h b/Demos/Device/Incomplete/Sideshow/Descriptors.h
index 6c9c6e3d7..1725a7951 100644
--- a/Demos/Device/Incomplete/Sideshow/Descriptors.h
+++ b/Demos/Device/Incomplete/Sideshow/Descriptors.h
@@ -39,8 +39,8 @@
#include "Sideshow.h"
/* Macros: */
- #define SIDESHOW_IN_EPNUM 3
- #define SIDESHOW_OUT_EPNUM 4
+ #define SIDESHOW_IN_EPADDR 3
+ #define SIDESHOW_OUT_EPADDR 4
#define SIDESHOW_IO_EPSIZE 64
/* Type Defines: */
diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c
index 4634036e7..3e2392467 100644
--- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c
+++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c
@@ -47,7 +47,7 @@ void Sideshow_ProcessCommandPacket(void)
{
SideShow_PacketHeader_t PacketHeader;
- Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_OUT_EPADDR);
Endpoint_Read_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
PacketHeader.Type.TypeFields.Response = true;
@@ -110,7 +110,7 @@ void Sideshow_ProcessCommandPacket(void)
PacketHeader.Length = sizeof(SideShow_PacketHeader_t);
PacketHeader.Type.TypeFields.NAK = true;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
@@ -122,7 +122,7 @@ static void SideShow_Ping(SideShow_PacketHeader_t* const PacketHeader)
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -137,7 +137,7 @@ static void SideShow_Sync(SideShow_PacketHeader_t* const PacketHeader)
if (!(GUID_COMPARE(&ProtocolGUID, (uint32_t[])STANDARD_PROTOCOL_GUID)))
PacketHeader->Type.TypeFields.NAK = true;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_Stream_LE(&ProtocolGUID, sizeof(GUID_t), NULL);
Endpoint_ClearIN();
@@ -149,7 +149,7 @@ static void SideShow_GetCurrentUser(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + UserSID.LengthInBytes;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
SideShow_Write_Unicode_String(&UserSID);
Endpoint_ClearIN();
@@ -162,7 +162,7 @@ static void SideShow_SetCurrentUser(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -254,7 +254,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
Property.PropertyGUID.Chunks[2], Property.PropertyGUID.Chunks[3]);
}
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
if (!(PacketHeader->Type.TypeFields.NAK))
@@ -288,7 +288,7 @@ static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader,
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
sizeof(uint32_t) + ((Unicode_String_t*)UnicodeStruct)->LengthInBytes;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
SideShow_Write_Unicode_String(UnicodeStruct);
Endpoint_ClearIN();
@@ -309,7 +309,7 @@ static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* const PacketHe
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
sizeof(uint32_t) + (TotalApplications * sizeof(GUID_t));
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_32_LE(TotalApplications);
@@ -330,7 +330,7 @@ static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* const Packet
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + sizeof(GUID_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_32_LE(1);
Endpoint_Write_Stream_LE(&SupportedEndpointGUID, sizeof(GUID_t), NULL);
@@ -377,7 +377,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -398,7 +398,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* const PacketHead
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -410,7 +410,7 @@ static void SideShow_DeleteAllApplications(SideShow_PacketHeader_t* const Packet
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
InstalledApplications[App].InUse = false;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -440,7 +440,7 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -465,7 +465,7 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -488,7 +488,7 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* const PacketHeade
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.c b/Demos/Device/Incomplete/Sideshow/Sideshow.c
index 3bc58d376..41009f373 100644
--- a/Demos/Device/Incomplete/Sideshow/Sideshow.c
+++ b/Demos/Device/Incomplete/Sideshow/Sideshow.c
@@ -101,10 +101,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup Sideshow Data Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- SIDESHOW_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- SIDESHOW_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_IN_EPADDR, EP_TYPE_BULK, SIDESHOW_IO_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_OUT_EPADDR, EP_TYPE_BULK, SIDESHOW_IO_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -142,7 +140,7 @@ void SideShow_Task(void)
return;
/* Select the SideShow data out endpoint */
- Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_OUT_EPADDR);
/* Check to see if a new SideShow message has been received */
if (Endpoint_IsReadWriteAllowed())
diff --git a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c
index 14be2ec49..2a60a741c 100644
--- a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c
+++ b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c
@@ -119,7 +119,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | TMC_OUT_EPNUM),
+ .EndpointAddress = TMC_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = TMC_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -129,7 +129,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | TMC_IN_EPNUM),
+ .EndpointAddress = TMC_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = TMC_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -139,7 +139,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | TMC_NOTIFICATION_EPNUM),
+ .EndpointAddress = TMC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = TMC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
diff --git a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h
index 8876f732b..e45654a27 100644
--- a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h
+++ b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h
@@ -43,20 +43,20 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the TMC notification IN endpoint. */
- #define TMC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the TMC notification IN endpoint. */
+ #define TMC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the TMC device-to-host data IN endpoint. */
- #define TMC_IN_EPNUM 3
+ /** Endpoint address of the TMC device-to-host data IN endpoint. */
+ #define TMC_IN_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the TMC host-to-device data OUT endpoint. */
- #define TMC_OUT_EPNUM 4
+ /** Endpoint address of the TMC host-to-device data OUT endpoint. */
+ #define TMC_OUT_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the TMC data endpoints. */
- #define TMC_IO_EPSIZE 64
+ #define TMC_IO_EPSIZE 64
/** Size in bytes of the TMC notification endpoint. */
- #define TMC_NOTIFICATION_EPSIZE 8
+ #define TMC_NOTIFICATION_EPSIZE 8
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
diff --git a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
index c77b01e1a..5102f101c 100644
--- a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
+++ b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
@@ -129,12 +129,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup TMC In, Out and Notification Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- TMC_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- TMC_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- TMC_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, TMC_IO_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_IN_EPADDR, EP_TYPE_BULK, TMC_IO_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_OUT_EPADDR, EP_TYPE_BULK, TMC_IO_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -418,7 +415,7 @@ bool ReadTMCHeader(TMC_MessageHeader_t* const MessageHeader)
uint8_t ErrorCode;
/* Select the Data Out endpoint */
- Endpoint_SelectEndpoint(TMC_OUT_EPNUM);
+ Endpoint_SelectEndpoint(TMC_OUT_EPADDR);
/* Abort if no command has been sent from the host */
if (!(Endpoint_IsOUTReceived()))
@@ -450,7 +447,7 @@ bool WriteTMCHeader(TMC_MessageHeader_t* const MessageHeader)
MessageHeader->InverseTag = ~CurrentTransferTag;
/* Select the Data In endpoint */
- Endpoint_SelectEndpoint(TMC_IN_EPNUM);
+ Endpoint_SelectEndpoint(TMC_IN_EPADDR);
/* Send the command header to the host */
BytesTransferred = 0;
diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c
index 60eeaf64c..eb9c4b57c 100644
--- a/Demos/Device/LowLevel/AudioInput/AudioInput.c
+++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c
@@ -118,8 +118,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup Audio Stream Endpoint */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS, ENDPOINT_DIR_IN,
- AUDIO_STREAM_EPSIZE, ENDPOINT_BANK_DOUBLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPADDR, EP_TYPE_ISOCHRONOUS, AUDIO_STREAM_EPSIZE, 2);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -165,7 +164,7 @@ void EVENT_USB_Device_ControlRequest(void)
uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
/* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */
- if ((EndpointAddress == (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
+ if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
{
uint8_t SampleRate[3];
@@ -190,7 +189,7 @@ void EVENT_USB_Device_ControlRequest(void)
uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
/* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */
- if ((EndpointAddress == (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
+ if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
{
uint8_t SampleRate[3];
@@ -215,7 +214,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
/* Select the audio stream endpoint */
- Endpoint_SelectEndpoint(AUDIO_STREAM_EPNUM);
+ Endpoint_SelectEndpoint(AUDIO_STREAM_EPADDR);
/* Check if the current endpoint can be written to and that the audio interface is enabled */
if (Endpoint_IsINReady() && StreamingAudioInterfaceSelected)
diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.c b/Demos/Device/LowLevel/AudioInput/Descriptors.c
index 0b1652246..ee37affd2 100644
--- a/Demos/Device/LowLevel/AudioInput/Descriptors.c
+++ b/Demos/Device/LowLevel/AudioInput/Descriptors.c
@@ -220,7 +220,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM),
+ .EndpointAddress = AUDIO_STREAM_EPADDR,
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AUDIO_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.h b/Demos/Device/LowLevel/AudioInput/Descriptors.h
index ac0a536de..4680294c9 100644
--- a/Demos/Device/LowLevel/AudioInput/Descriptors.h
+++ b/Demos/Device/LowLevel/AudioInput/Descriptors.h
@@ -42,14 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the Audio isochronous streaming data endpoint. */
- #define AUDIO_STREAM_EPNUM 1
+ /** Endpoint address of the Audio isochronous streaming data IN endpoint. */
+ #define AUDIO_STREAM_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires
- * at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller
- * USB AVR models will result in unavoidable distorted output.
- */
- #define AUDIO_STREAM_EPSIZE ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)
+ /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. */
+ #define AUDIO_STREAM_EPSIZE 256
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c
index 813108a71..ebf4ad51d 100644
--- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c
+++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c
@@ -144,8 +144,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup Audio Stream Endpoint */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS, ENDPOINT_DIR_OUT,
- AUDIO_STREAM_EPSIZE, ENDPOINT_BANK_DOUBLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPADDR, EP_TYPE_ISOCHRONOUS, AUDIO_STREAM_EPSIZE, 2);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -191,7 +190,7 @@ void EVENT_USB_Device_ControlRequest(void)
uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
/* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */
- if ((EndpointAddress == (ENDPOINT_DIR_OUT | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
+ if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
{
uint8_t SampleRate[3];
@@ -216,7 +215,7 @@ void EVENT_USB_Device_ControlRequest(void)
uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8);
/* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */
- if ((EndpointAddress == (ENDPOINT_DIR_OUT | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
+ if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq))
{
uint8_t SampleRate[3];
@@ -241,7 +240,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
/* Select the audio stream endpoint */
- Endpoint_SelectEndpoint(AUDIO_STREAM_EPNUM);
+ Endpoint_SelectEndpoint(AUDIO_STREAM_EPADDR);
/* Check if the current endpoint can be read from (contains a packet) and the host is sending data */
if (Endpoint_IsOUTReceived() && StreamingAudioInterfaceSelected)
diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.c b/Demos/Device/LowLevel/AudioOutput/Descriptors.c
index 7f12fc72c..12a5a1562 100644
--- a/Demos/Device/LowLevel/AudioOutput/Descriptors.c
+++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.c
@@ -220,7 +220,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | AUDIO_STREAM_EPNUM),
+ .EndpointAddress = AUDIO_STREAM_EPADDR,
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AUDIO_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.h b/Demos/Device/LowLevel/AudioOutput/Descriptors.h
index ac0a536de..e0c756744 100644
--- a/Demos/Device/LowLevel/AudioOutput/Descriptors.h
+++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.h
@@ -42,14 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the Audio isochronous streaming data endpoint. */
- #define AUDIO_STREAM_EPNUM 1
+ /** Endpoint address of the Audio isochronous streaming data OUT endpoint. */
+ #define AUDIO_STREAM_EPADDR (ENDPOINT_DIR_OUT | 1)
- /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires
- * at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller
- * USB AVR models will result in unavoidable distorted output.
- */
- #define AUDIO_STREAM_EPSIZE ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)
+ /** Endpoint size in bytes of the Audio isochronous streaming data endpoint. */
+ #define AUDIO_STREAM_EPSIZE 256
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c
index 5df6808c6..7542ab9af 100644
--- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c
+++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC1_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC1_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC1_RX_EPNUM),
+ .EndpointAddress = CDC1_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -193,7 +193,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC1_TX_EPNUM),
+ .EndpointAddress = CDC1_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -258,7 +258,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC2_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC2_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -284,7 +284,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC2_RX_EPNUM),
+ .EndpointAddress = CDC2_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -294,7 +294,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC2_TX_EPNUM),
+ .EndpointAddress = CDC2_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h
index 0a172d83d..fee2c8552 100644
--- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h
+++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h
@@ -42,23 +42,23 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the first CDC interface's device-to-host data IN endpoint. */
- #define CDC1_TX_EPNUM 1
+ /** Endpoint address of the first CDC interface's device-to-host data IN endpoint. */
+ #define CDC1_TX_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the first CDC interface's host-to-device data OUT endpoint. */
- #define CDC1_RX_EPNUM 2
+ /** Endpoint address of the first CDC interface's host-to-device data OUT endpoint. */
+ #define CDC1_RX_EPADDR (ENDPOINT_DIR_OUT | 2)
- /** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */
- #define CDC1_NOTIFICATION_EPNUM 3
+ /** Endpoint address of the first CDC interface's device-to-host notification IN endpoint. */
+ #define CDC1_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the second CDC interface's device-to-host data IN endpoint. */
- #define CDC2_TX_EPNUM 4
+ /** Endpoint address of the second CDC interface's device-to-host data IN endpoint. */
+ #define CDC2_TX_EPADDR (ENDPOINT_DIR_IN | 4)
- /** Endpoint number of the second CDC interface's host-to-device data OUT endpoint. */
- #define CDC2_RX_EPNUM 5
+ /** Endpoint address of the second CDC interface's host-to-device data OUT endpoint. */
+ #define CDC2_RX_EPADDR (ENDPOINT_DIR_OUT | 5)
- /** Endpoint number of the second CDC interface's device-to-host notification IN endpoint. */
- #define CDC2_NOTIFICATION_EPNUM 6
+ /** Endpoint address of the second CDC interface's device-to-host notification IN endpoint. */
+ #define CDC2_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 6)
/** Size in bytes of the CDC device-to-host notification IN endpoints. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
index 9208b2c44..2db6f4e23 100644
--- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
+++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
@@ -123,20 +123,14 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup first CDC Interface's Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1);
/* Setup second CDC Interface's Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1);
/* Reset line encoding baud rates so that the host knows to send new values */
LineEncoding1.BaudRateBPS = 0;
@@ -224,7 +218,7 @@ void CDC1_Task(void)
ActionSent = true;
/* Select the Serial Tx Endpoint */
- Endpoint_SelectEndpoint(CDC1_TX_EPNUM);
+ Endpoint_SelectEndpoint(CDC1_TX_EPADDR);
/* Write the String to the Endpoint */
Endpoint_Write_Stream_LE(ReportString, strlen(ReportString), NULL);
@@ -240,7 +234,7 @@ void CDC1_Task(void)
}
/* Select the Serial Rx Endpoint */
- Endpoint_SelectEndpoint(CDC1_RX_EPNUM);
+ Endpoint_SelectEndpoint(CDC1_RX_EPADDR);
/* Throw away any received data from the host */
if (Endpoint_IsOUTReceived())
@@ -257,7 +251,7 @@ void CDC2_Task(void)
return;
/* Select the Serial Rx Endpoint */
- Endpoint_SelectEndpoint(CDC2_RX_EPNUM);
+ Endpoint_SelectEndpoint(CDC2_RX_EPADDR);
/* Check to see if any data has been received */
if (Endpoint_IsOUTReceived())
@@ -275,7 +269,7 @@ void CDC2_Task(void)
Endpoint_ClearOUT();
/* Select the Serial Tx Endpoint */
- Endpoint_SelectEndpoint(CDC2_TX_EPNUM);
+ Endpoint_SelectEndpoint(CDC2_TX_EPADDR);
/* Write the received data to the endpoint */
Endpoint_Write_Stream_LE(&Buffer, DataLength, NULL);
diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.c b/Demos/Device/LowLevel/GenericHID/Descriptors.c
index 2dcdcf030..1d8765b54 100644
--- a/Demos/Device/LowLevel/GenericHID/Descriptors.c
+++ b/Demos/Device/LowLevel/GenericHID/Descriptors.c
@@ -143,7 +143,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | GENERIC_IN_EPNUM),
+ .EndpointAddress = GENERIC_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = GENERIC_EPSIZE,
.PollingIntervalMS = 0x01
@@ -153,7 +153,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | GENERIC_OUT_EPNUM),
+ .EndpointAddress = GENERIC_OUT_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = GENERIC_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.h b/Demos/Device/LowLevel/GenericHID/Descriptors.h
index 4647a05f0..e47220a1c 100644
--- a/Demos/Device/LowLevel/GenericHID/Descriptors.h
+++ b/Demos/Device/LowLevel/GenericHID/Descriptors.h
@@ -58,11 +58,11 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Generic HID reporting IN endpoint. */
- #define GENERIC_IN_EPNUM 1
+ /** Endpoint address of the Generic HID reporting IN endpoint. */
+ #define GENERIC_IN_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the Generic HID reporting OUT endpoint. */
- #define GENERIC_OUT_EPNUM 2
+ /** Endpoint address of the Generic HID reporting OUT endpoint. */
+ #define GENERIC_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
/** Size in bytes of the Generic HID reporting endpoint. */
#define GENERIC_EPSIZE 8
diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.c b/Demos/Device/LowLevel/GenericHID/GenericHID.c
index 4d61acfb6..c36c33f7e 100644
--- a/Demos/Device/LowLevel/GenericHID/GenericHID.c
+++ b/Demos/Device/LowLevel/GenericHID/GenericHID.c
@@ -95,10 +95,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup HID Report Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- GENERIC_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT,
- GENERIC_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_IN_EPADDR, EP_TYPE_INTERRUPT, GENERIC_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_OUT_EPADDR, EP_TYPE_INTERRUPT, GENERIC_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -200,7 +198,7 @@ void HID_Task(void)
if (USB_DeviceState != DEVICE_STATE_Configured)
return;
- Endpoint_SelectEndpoint(GENERIC_OUT_EPNUM);
+ Endpoint_SelectEndpoint(GENERIC_OUT_EPADDR);
/* Check to see if a packet has been sent from the host */
if (Endpoint_IsOUTReceived())
@@ -222,7 +220,7 @@ void HID_Task(void)
Endpoint_ClearOUT();
}
- Endpoint_SelectEndpoint(GENERIC_IN_EPNUM);
+ Endpoint_SelectEndpoint(GENERIC_IN_EPADDR);
/* Check to see if the host is ready to accept another packet */
if (Endpoint_IsINReady())
diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.c b/Demos/Device/LowLevel/Joystick/Descriptors.c
index 272595d99..74f388c65 100644
--- a/Demos/Device/LowLevel/Joystick/Descriptors.c
+++ b/Demos/Device/LowLevel/Joystick/Descriptors.c
@@ -155,7 +155,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | JOYSTICK_EPNUM),
+ .EndpointAddress = JOYSTICK_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = JOYSTICK_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.h b/Demos/Device/LowLevel/Joystick/Descriptors.h
index 93b315b4e..bc90fb7cc 100644
--- a/Demos/Device/LowLevel/Joystick/Descriptors.h
+++ b/Demos/Device/LowLevel/Joystick/Descriptors.h
@@ -57,8 +57,8 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Joystick HID reporting IN endpoint. */
- #define JOYSTICK_EPNUM 1
+ /** Endpoint address of the Joystick HID reporting IN endpoint. */
+ #define JOYSTICK_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the Joystick HID reporting IN endpoint. */
#define JOYSTICK_EPSIZE 8
diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c
index 9e84b61f9..cfdfaae2f 100644
--- a/Demos/Device/LowLevel/Joystick/Joystick.c
+++ b/Demos/Device/LowLevel/Joystick/Joystick.c
@@ -96,8 +96,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup HID Report Endpoint */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- JOYSTICK_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -183,7 +182,7 @@ void HID_Task(void)
return;
/* Select the Joystick Report Endpoint */
- Endpoint_SelectEndpoint(JOYSTICK_EPNUM);
+ Endpoint_SelectEndpoint(JOYSTICK_EPADDR);
/* Check to see if the host is ready for another packet */
if (Endpoint_IsINReady())
diff --git a/Demos/Device/LowLevel/Keyboard/Descriptors.c b/Demos/Device/LowLevel/Keyboard/Descriptors.c
index 46b9fdec5..2de04d348 100644
--- a/Demos/Device/LowLevel/Keyboard/Descriptors.c
+++ b/Demos/Device/LowLevel/Keyboard/Descriptors.c
@@ -160,7 +160,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM),
+ .EndpointAddress = KEYBOARD_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x01
@@ -170,7 +170,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | KEYBOARD_OUT_EPNUM),
+ .EndpointAddress = KEYBOARD_OUT_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/Keyboard/Descriptors.h b/Demos/Device/LowLevel/Keyboard/Descriptors.h
index 3c0ea1797..2e1fe3c81 100644
--- a/Demos/Device/LowLevel/Keyboard/Descriptors.h
+++ b/Demos/Device/LowLevel/Keyboard/Descriptors.h
@@ -59,11 +59,11 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Keyboard HID reporting IN endpoint. */
- #define KEYBOARD_IN_EPNUM 1
+ /** Endpoint address of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_IN_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the Keyboard HID reporting OUT endpoint. */
- #define KEYBOARD_OUT_EPNUM 2
+ /** Endpoint address of the Keyboard HID reporting OUT endpoint. */
+ #define KEYBOARD_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
/** Size in bytes of the Keyboard HID reporting IN and OUT endpoints. */
#define KEYBOARD_EPSIZE 8
diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.c b/Demos/Device/LowLevel/Keyboard/Keyboard.c
index 45bf010fc..3755d09de 100644
--- a/Demos/Device/LowLevel/Keyboard/Keyboard.c
+++ b/Demos/Device/LowLevel/Keyboard/Keyboard.c
@@ -117,10 +117,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup HID Report Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT,
- KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPADDR, EP_TYPE_INTERRUPT, KEYBOARD_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPADDR, EP_TYPE_INTERRUPT, KEYBOARD_EPSIZE, 1);
/* Turn on Start-of-Frame events for tracking HID report period expiry */
USB_Device_EnableSOFEvents();
@@ -315,7 +313,7 @@ void SendNextReport(void)
}
/* Select the Keyboard Report Endpoint */
- Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM);
+ Endpoint_SelectEndpoint(KEYBOARD_IN_EPADDR);
/* Check if Keyboard Endpoint Ready for Read/Write and if we should send a new report */
if (Endpoint_IsReadWriteAllowed() && SendReport)
@@ -335,7 +333,7 @@ void SendNextReport(void)
void ReceiveNextReport(void)
{
/* Select the Keyboard LED Report Endpoint */
- Endpoint_SelectEndpoint(KEYBOARD_OUT_EPNUM);
+ Endpoint_SelectEndpoint(KEYBOARD_OUT_EPADDR);
/* Check if Keyboard LED Endpoint contains a packet */
if (Endpoint_IsOUTReceived())
diff --git a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c
index 9d02fa45c..9d592f7d4 100644
--- a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c
+++ b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c
@@ -195,7 +195,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM),
+ .EndpointAddress = KEYBOARD_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x01
@@ -205,7 +205,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | KEYBOARD_OUT_EPNUM),
+ .EndpointAddress = KEYBOARD_OUT_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x01
@@ -242,7 +242,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_IN_EPNUM),
+ .EndpointAddress = MOUSE_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h
index 573cb65b6..178f5ed99 100644
--- a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h
+++ b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h
@@ -65,14 +65,14 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Keyboard HID reporting IN endpoint. */
- #define KEYBOARD_IN_EPNUM 1
+ /** Endpoint address of the Keyboard HID reporting IN endpoint. */
+ #define KEYBOARD_IN_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the Keyboard HID reporting OUT endpoint. */
- #define KEYBOARD_OUT_EPNUM 2
+ /** Endpoint address of the Keyboard HID reporting OUT endpoint. */
+ #define KEYBOARD_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
- /** Endpoint number of the Mouse HID reporting IN endpoint. */
- #define MOUSE_IN_EPNUM 3
+ /** Endpoint address of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
/** Size in bytes of each of the HID reporting IN and OUT endpoints. */
#define HID_EPSIZE 8
diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c
index 4de6f64c9..a916659ea 100644
--- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c
+++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c
@@ -104,14 +104,11 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup Keyboard HID Report Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- HID_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT,
- HID_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPADDR, EP_TYPE_INTERRUPT, HID_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPADDR, EP_TYPE_INTERRUPT, HID_EPSIZE, 1);
/* Setup Mouse HID Report Endpoint */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- HID_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_IN_EPADDR, EP_TYPE_INTERRUPT, HID_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -236,7 +233,7 @@ void Keyboard_HID_Task(void)
}
/* Select the Keyboard Report Endpoint */
- Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM);
+ Endpoint_SelectEndpoint(KEYBOARD_IN_EPADDR);
/* Check if Keyboard Endpoint Ready for Read/Write */
if (Endpoint_IsReadWriteAllowed())
@@ -252,7 +249,7 @@ void Keyboard_HID_Task(void)
}
/* Select the Keyboard LED Report Endpoint */
- Endpoint_SelectEndpoint(KEYBOARD_OUT_EPNUM);
+ Endpoint_SelectEndpoint(KEYBOARD_OUT_EPADDR);
/* Check if Keyboard LED Endpoint Ready for Read/Write */
if (Endpoint_IsReadWriteAllowed())
@@ -294,7 +291,7 @@ void Mouse_HID_Task(void)
}
/* Select the Mouse Report Endpoint */
- Endpoint_SelectEndpoint(MOUSE_IN_EPNUM);
+ Endpoint_SelectEndpoint(MOUSE_IN_EPADDR);
/* Check if Mouse Endpoint Ready for Read/Write */
if (Endpoint_IsReadWriteAllowed())
diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.c b/Demos/Device/LowLevel/MIDI/Descriptors.c
index 9ad0e86a5..84898acf6 100644
--- a/Demos/Device/LowLevel/MIDI/Descriptors.c
+++ b/Demos/Device/LowLevel/MIDI/Descriptors.c
@@ -199,7 +199,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
+ .EndpointAddress = MIDI_STREAM_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MIDI_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
@@ -224,7 +224,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM),
+ .EndpointAddress = MIDI_STREAM_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MIDI_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.h b/Demos/Device/LowLevel/MIDI/Descriptors.h
index 5415a31cd..7947a463c 100644
--- a/Demos/Device/LowLevel/MIDI/Descriptors.h
+++ b/Demos/Device/LowLevel/MIDI/Descriptors.h
@@ -42,11 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
- #define MIDI_STREAM_IN_EPNUM 1
+ /** Endpoint address of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
+ #define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
- #define MIDI_STREAM_OUT_EPNUM 2
+ /** Endpoint address of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
+ #define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
/** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */
#define MIDI_STREAM_EPSIZE 64
diff --git a/Demos/Device/LowLevel/MIDI/MIDI.c b/Demos/Device/LowLevel/MIDI/MIDI.c
index a29a8c86b..f8bc4e917 100644
--- a/Demos/Device/LowLevel/MIDI/MIDI.c
+++ b/Demos/Device/LowLevel/MIDI/MIDI.c
@@ -94,10 +94,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup MIDI Data Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -114,7 +112,7 @@ void MIDI_Task(void)
if (USB_DeviceState != DEVICE_STATE_Configured)
return;
- Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM);
+ Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPADDR);
if (Endpoint_IsINReady())
{
@@ -182,7 +180,7 @@ void MIDI_Task(void)
}
/* Select the MIDI OUT stream */
- Endpoint_SelectEndpoint(MIDI_STREAM_OUT_EPNUM);
+ Endpoint_SelectEndpoint(MIDI_STREAM_OUT_EPADDR);
/* Check if a MIDI command has been received */
if (Endpoint_IsOUTReceived())
diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.c b/Demos/Device/LowLevel/MassStorage/Descriptors.c
index fb829423a..0ab09b6a5 100644
--- a/Demos/Device/LowLevel/MassStorage/Descriptors.c
+++ b/Demos/Device/LowLevel/MassStorage/Descriptors.c
@@ -118,7 +118,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ .EndpointAddress = MASS_STORAGE_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -128,7 +128,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ .EndpointAddress = MASS_STORAGE_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.h b/Demos/Device/LowLevel/MassStorage/Descriptors.h
index 0e7a91ffd..34a85f6d1 100644
--- a/Demos/Device/LowLevel/MassStorage/Descriptors.h
+++ b/Demos/Device/LowLevel/MassStorage/Descriptors.h
@@ -42,11 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
- #define MASS_STORAGE_IN_EPNUM 3
+ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */
+ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
- #define MASS_STORAGE_OUT_EPNUM 4
+ /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */
+ #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the Mass Storage data endpoints. */
#define MASS_STORAGE_IO_EPSIZE 64
diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c
index 947636cf8..0e8e1083b 100644
--- a/Demos/Device/LowLevel/MassStorage/MassStorage.c
+++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c
@@ -118,10 +118,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup Mass Storage Data Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- MASS_STORAGE_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(MASS_STORAGE_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- MASS_STORAGE_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPADDR, EP_TYPE_BULK, MASS_STORAGE_IO_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(MASS_STORAGE_OUT_EPADDR, EP_TYPE_BULK, MASS_STORAGE_IO_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -180,7 +178,7 @@ void MassStorage_Task(void)
/* Check direction of command, select Data IN endpoint if data is from the device */
if (CommandBlock.Flags & MS_COMMAND_DIR_DATA_IN)
- Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPADDR);
/* Decode the received SCSI command, set returned status code */
CommandStatus.Status = SCSI_DecodeSCSICommand() ? MS_SCSI_COMMAND_Pass : MS_SCSI_COMMAND_Fail;
@@ -206,13 +204,13 @@ void MassStorage_Task(void)
if (IsMassStoreReset)
{
/* Reset the data endpoint banks */
- Endpoint_ResetEndpoint(MASS_STORAGE_OUT_EPNUM);
- Endpoint_ResetEndpoint(MASS_STORAGE_IN_EPNUM);
+ Endpoint_ResetEndpoint(MASS_STORAGE_OUT_EPADDR);
+ Endpoint_ResetEndpoint(MASS_STORAGE_IN_EPADDR);
- Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
+ Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPADDR);
Endpoint_ClearStall();
Endpoint_ResetDataToggle();
- Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPADDR);
Endpoint_ClearStall();
Endpoint_ResetDataToggle();
@@ -231,7 +229,7 @@ static bool ReadInCommandBlock(void)
uint16_t BytesTransferred;
/* Select the Data Out endpoint */
- Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
+ Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPADDR);
/* Abort if no command has been sent from the host */
if (!(Endpoint_IsOUTReceived()))
@@ -256,7 +254,7 @@ static bool ReadInCommandBlock(void)
{
/* Stall both data pipes until reset by host */
Endpoint_StallTransaction();
- Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPADDR);
Endpoint_StallTransaction();
return false;
@@ -286,7 +284,7 @@ static void ReturnCommandStatus(void)
uint16_t BytesTransferred;
/* Select the Data Out endpoint */
- Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
+ Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPADDR);
/* While data pipe is stalled, wait until the host issues a control request to clear the stall */
while (Endpoint_IsStalled())
@@ -297,7 +295,7 @@ static void ReturnCommandStatus(void)
}
/* Select the Data In endpoint */
- Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPADDR);
/* While data pipe is stalled, wait until the host issues a control request to clear the stall */
while (Endpoint_IsStalled())
diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.c b/Demos/Device/LowLevel/Mouse/Descriptors.c
index d42fb835c..bd0cb6165 100644
--- a/Demos/Device/LowLevel/Mouse/Descriptors.c
+++ b/Demos/Device/LowLevel/Mouse/Descriptors.c
@@ -155,7 +155,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM),
+ .EndpointAddress = MOUSE_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MOUSE_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.h b/Demos/Device/LowLevel/Mouse/Descriptors.h
index da78dd0ff..abcd938a8 100644
--- a/Demos/Device/LowLevel/Mouse/Descriptors.h
+++ b/Demos/Device/LowLevel/Mouse/Descriptors.h
@@ -41,6 +41,13 @@
#include <avr/pgmspace.h>
+ /* Macros: */
+ /** Endpoint address of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPADDR (ENDPOINT_DIR_IN | 1)
+
+ /** Size in bytes of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPSIZE 8
+
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
* application code, as the configuration descriptor contains several sub-descriptors which
@@ -56,13 +63,6 @@
USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t;
- /* Macros: */
- /** Endpoint number of the Mouse HID reporting IN endpoint. */
- #define MOUSE_EPNUM 1
-
- /** Size in bytes of the Mouse HID reporting IN endpoint. */
- #define MOUSE_EPSIZE 8
-
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c
index 98da9be92..e9f92e4a2 100644
--- a/Demos/Device/LowLevel/Mouse/Mouse.c
+++ b/Demos/Device/LowLevel/Mouse/Mouse.c
@@ -116,8 +116,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup HID Report Endpoint */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- MOUSE_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_EPADDR, EP_TYPE_INTERRUPT, MOUSE_EPSIZE, 1);
/* Turn on Start-of-Frame events for tracking HID report period expiry */
USB_Device_EnableSOFEvents();
@@ -271,7 +270,7 @@ void SendNextReport(void)
}
/* Select the Mouse Report Endpoint */
- Endpoint_SelectEndpoint(MOUSE_EPNUM);
+ Endpoint_SelectEndpoint(MOUSE_EPADDR);
/* Check if Mouse Endpoint Ready for Read/Write and if we should send a new report */
if (Endpoint_IsReadWriteAllowed() && SendReport)
diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c
index 41bc4b59e..86cc420c7 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c
+++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c
@@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -167,7 +167,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h
index 9ffa5262f..6337335ac 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h
+++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h
@@ -42,14 +42,14 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 1
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 2
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 2)
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 3
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3)
/** Size in bytes of the CDC data IN and OUT endpoints. */
#define CDC_TXRX_EPSIZE 64
diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
index a36ecf4bb..c041bb91a 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
+++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
@@ -104,12 +104,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup RNDIS Data Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -170,7 +167,7 @@ void EVENT_USB_Device_ControlRequest(void)
void RNDIS_Task(void)
{
/* Select the notification endpoint */
- Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
+ Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPADDR);
/* Check if a message response is ready for the host */
if (Endpoint_IsINReady() && ResponseReady)
@@ -201,7 +198,7 @@ void RNDIS_Task(void)
RNDIS_Packet_Message_t RNDISPacketHeader;
/* Select the data OUT endpoint */
- Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_RX_EPADDR);
/* Check if the data OUT endpoint contains data, and that the IN buffer is empty */
if (Endpoint_IsOUTReceived() && !(FrameIN.FrameLength))
@@ -227,7 +224,7 @@ void RNDIS_Task(void)
}
/* Select the data IN endpoint */
- Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_TX_EPADDR);
/* Check if the data IN endpoint is ready for more data, and that the IN buffer is full */
if (Endpoint_IsINReady() && FrameOUT.FrameLength)
diff --git a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c
index f4e9fb324..0858bc47c 100644
--- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c
+++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c
@@ -143,7 +143,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -169,7 +169,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -179,7 +179,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/Device/LowLevel/VirtualSerial/Descriptors.h b/Demos/Device/LowLevel/VirtualSerial/Descriptors.h
index 765345bc3..36ec8f9ff 100644
--- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.h
+++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.h
@@ -42,14 +42,14 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 3
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 4
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c
index 93fd4353e..7d185481d 100644
--- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c
+++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c
@@ -109,12 +109,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup CDC Data Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
/* Reset line encoding baud rate so that the host knows to send new values */
LineEncoding.BaudRateBPS = 0;
@@ -201,7 +198,7 @@ void CDC_Task(void)
ActionSent = true;
/* Select the Serial Tx Endpoint */
- Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_TX_EPADDR);
/* Write the String to the Endpoint */
Endpoint_Write_Stream_LE(ReportString, strlen(ReportString), NULL);
@@ -225,7 +222,7 @@ void CDC_Task(void)
}
/* Select the Serial Rx Endpoint */
- Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_RX_EPADDR);
/* Throw away any received data from the host */
if (Endpoint_IsOUTReceived())
diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c
index 2ee35de87..33a825d9a 100644
--- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c
+++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c
@@ -136,7 +136,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM),
+ .EndpointAddress = MOUSE_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MOUSE_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h
index da78dd0ff..14cb8e9a3 100644
--- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h
+++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h
@@ -57,8 +57,8 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Mouse HID reporting IN endpoint. */
- #define MOUSE_EPNUM 1
+ /** Endpoint address of the Mouse HID reporting IN endpoint. */
+ #define MOUSE_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the Mouse HID reporting IN endpoint. */
#define MOUSE_EPSIZE 8
diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c
index 16fc3fb2b..39a682a60 100644
--- a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c
+++ b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c
@@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Device_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = MOUSE_EPNUM,
- .ReportINEndpointSize = MOUSE_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = MOUSE_EPADDR,
+ .Size = MOUSE_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevMouseHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer),
},
diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c
index a71e85b5a..29def30d5 100644
--- a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c
+++ b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c
@@ -44,9 +44,16 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Host_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataOUTPipeNumber = 2,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.HIDInterfaceProtocol = HID_CSCP_MouseBootProtocol,
},
};
diff --git a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c
index d0737acd7..4c53cc221 100644
--- a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c
+++ b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c
@@ -44,12 +44,16 @@ USB_ClassInfo_AOA_Host_t AndroidDevice_AOA_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.PropertyStrings =
{
[AOA_STRING_Manufacturer] = "Dean Camera",
diff --git a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c
index 3e4a69a05..aa274932f 100644
--- a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c
+++ b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c
@@ -44,7 +44,10 @@ USB_ClassInfo_Audio_Host_t Microphone_Audio_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ },
},
};
@@ -179,7 +182,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
}
USB_Audio_SampleFreq_t SampleRate = AUDIO_SAMPLE_FREQ(48000);
- if (Audio_Host_GetSetEndpointProperty(&Microphone_Audio_Interface, Microphone_Audio_Interface.Config.DataINPipeNumber,
+ if (Audio_Host_GetSetEndpointProperty(&Microphone_Audio_Interface, Microphone_Audio_Interface.Config.DataINPipe.Address,
AUDIO_REQ_SetCurrent, AUDIO_EPCONTROL_SamplingFreq,
sizeof(SampleRate), &SampleRate) != HOST_SENDCONTROL_Successful)
{
diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c
index 783b0a5e5..833be1b2c 100644
--- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c
+++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c
@@ -44,7 +44,10 @@ USB_ClassInfo_Audio_Host_t Speaker_Audio_Interface =
{
.Config =
{
- .DataOUTPipeNumber = 1,
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ },
},
};
@@ -187,7 +190,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
}
USB_Audio_SampleFreq_t SampleRate = AUDIO_SAMPLE_FREQ(48000);
- if (Audio_Host_GetSetEndpointProperty(&Speaker_Audio_Interface, Speaker_Audio_Interface.Config.DataOUTPipeNumber,
+ if (Audio_Host_GetSetEndpointProperty(&Speaker_Audio_Interface, Speaker_Audio_Interface.Config.DataOUTPipe.Address,
AUDIO_REQ_SetCurrent, AUDIO_EPCONTROL_SamplingFreq,
sizeof(SampleRate), &SampleRate) != HOST_SENDCONTROL_Successful)
{
diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
index 5d912497d..18c02d769 100644
--- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
+++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
@@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Joystick_HID_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.HIDInterfaceProtocol = HID_CSCP_NonBootProtocol,
-
.HIDParserData = &HIDReportInfo
},
};
diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c
index f67cd1161..69499089b 100644
--- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c
+++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c
@@ -44,12 +44,16 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.HIDInterfaceProtocol = HID_CSCP_KeyboardBootProtocol,
},
};
diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
index 4247e9e56..6ef182000 100644
--- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
+++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
@@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.HIDInterfaceProtocol = HID_CSCP_NonBootProtocol,
-
.HIDParserData = &HIDReportInfo
},
};
diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c
index 8293fbd3b..129bd3d62 100644
--- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c
+++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c
@@ -44,11 +44,16 @@ USB_ClassInfo_MIDI_Host_t Keyboard_MIDI_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
},
};
diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c
index 10c7f7921..aacc07879 100644
--- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c
+++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c
@@ -44,11 +44,16 @@ USB_ClassInfo_MS_Host_t FlashDisk_MS_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
},
};
diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c
index 4272591d5..1290e4855 100644
--- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c
+++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c
@@ -44,12 +44,16 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.HIDInterfaceProtocol = HID_CSCP_MouseBootProtocol,
},
};
diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
index 857d49412..8004b5ca1 100644
--- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
+++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
@@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.HIDInterfaceProtocol = HID_CSCP_NonBootProtocol,
-
.HIDParserData = &HIDReportInfo
},
};
diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c
index 3df0eedf2..51157a315 100644
--- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c
+++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c
@@ -44,11 +44,16 @@ USB_ClassInfo_PRNT_Host_t Printer_PRNT_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
},
};
diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
index f03ee4967..d27aab143 100644
--- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
+++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
@@ -47,16 +47,22 @@ USB_ClassInfo_RNDIS_Host_t Ethernet_RNDIS_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
- .NotificationPipeNumber = 3,
- .NotificationPipeDoubleBank = false,
-
- .HostMaxPacketSize = sizeof(PacketBuffer),
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
+ .NotificationPipe =
+ {
+ .Address = (PIPE_DIR_IN | 3),
+ .Banks = 1,
+ },
+ .HostMaxPacketSize = sizeof(PacketBuffer),
},
};
diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
index eeac14d11..9a89452af 100644
--- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
+++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
@@ -44,14 +44,21 @@ USB_ClassInfo_SI_Host_t DigitalCamera_SI_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
- .EventsPipeNumber = 3,
- .EventsPipeDoubleBank = false,
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
+ .EventsPipe =
+ {
+ .Address = (PIPE_DIR_IN | 3),
+ .Banks = 1,
+ },
},
};
diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c
index 631925e45..bce7804b4 100644
--- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c
+++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c
@@ -44,14 +44,21 @@ USB_ClassInfo_CDC_Host_t VirtualSerial_CDC_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
- .NotificationPipeNumber = 3,
- .NotificationPipeDoubleBank = false,
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
+ .NotificationPipe =
+ {
+ .Address = (PIPE_DIR_IN | 3),
+ .Banks = 1,
+ },
},
};
diff --git a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c
index 7d1050601..fa19052a8 100644
--- a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c
+++ b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c
@@ -105,16 +105,13 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the Bluetooth data IN pipe */
- Pipe_ConfigurePipe(BLUETOOTH_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(BLUETOOTH_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the Bluetooth data OUT pipe */
- Pipe_ConfigurePipe(BLUETOOTH_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(BLUETOOTH_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Configure the Bluetooth events pipe */
- Pipe_ConfigurePipe(BLUETOOTH_EVENTS_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(BLUETOOTH_EVENTS_PIPE, EP_TYPE_INTERRUPT, EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(EventsEndpoint->PollingIntervalMS);
/* Valid data found, return success */
diff --git a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h
index 9c40fcdcb..c46add71a 100644
--- a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h
+++ b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h
@@ -40,9 +40,9 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- #define BLUETOOTH_DATA_IN_PIPE 1
- #define BLUETOOTH_DATA_OUT_PIPE 2
- #define BLUETOOTH_EVENTS_PIPE 3
+ #define BLUETOOTH_DATA_IN_PIPE (PIPE_DIR_IN | 1)
+ #define BLUETOOTH_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
+ #define BLUETOOTH_EVENTS_PIPE (PIPE_DIR_IN | 3)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c
index 1b8613b69..6db853267 100644
--- a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c
@@ -95,12 +95,10 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the Android Accessory data IN pipe */
- Pipe_ConfigurePipe(ANDROID_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(ANDROID_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the Android Accessory data OUT pipe */
- Pipe_ConfigurePipe(ANDROID_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(ANDROID_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Valid data found, return success */
return SuccessfulConfigRead;
diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h
index 05e1b91e1..53b7280b4 100644
--- a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h
@@ -40,8 +40,11 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- #define ANDROID_DATA_IN_PIPE 1
- #define ANDROID_DATA_OUT_PIPE 2
+ /** Pipe address of the Android Accessory data IN pipe. */
+ #define ANDROID_DATA_IN_PIPE (PIPE_DIR_IN | 1)
+
+ /** Pipe address of the Android Accessory data OUT pipe. */
+ #define ANDROID_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c
index b26dbb80e..9274e633d 100644
--- a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c
@@ -130,8 +130,7 @@ uint8_t ProcessConfigurationDescriptor(void)
StreamingEndpointAddress = DataINEndpoint->EndpointAddress;
/* Configure the Audio data IN pipe */
- Pipe_ConfigurePipe(AUDIO_DATA_IN_PIPE, EP_TYPE_ISOCHRONOUS, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_DOUBLE);
+ Pipe_ConfigurePipe(AUDIO_DATA_IN_PIPE, EP_TYPE_ISOCHRONOUS, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 2);
/* Valid data found, return success */
return SuccessfulConfigRead;
diff --git a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h
index a5f425900..84d27c7e6 100644
--- a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h
@@ -42,8 +42,8 @@
#include "AudioInputHost.h"
/* Macros: */
- /** Pipe number for the Audio data IN pipe. */
- #define AUDIO_DATA_IN_PIPE 1
+ /** Pipe address for the Audio data IN pipe. */
+ #define AUDIO_DATA_IN_PIPE (PIPE_DIR_IN | 1)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/AudioInputHost/Doxygen.conf b/Demos/Host/LowLevel/AudioInputHost/Doxygen.conf
index b98cf1f14..44513ef35 100644
--- a/Demos/Host/LowLevel/AudioInputHost/Doxygen.conf
+++ b/Demos/Host/LowLevel/AudioInputHost/Doxygen.conf
@@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = "LUFA Library - Audio Input Host"
+PROJECT_NAME = "LUFA Library - Audio Input Host Demo"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
diff --git a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c
index 99980fd3d..cc2506274 100644
--- a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c
@@ -130,8 +130,7 @@ uint8_t ProcessConfigurationDescriptor(void)
StreamingEndpointAddress = DataOUTEndpoint->EndpointAddress;
/* Configure the Audio data OUT pipe */
- Pipe_ConfigurePipe(AUDIO_DATA_OUT_PIPE, EP_TYPE_ISOCHRONOUS, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_DOUBLE);
+ Pipe_ConfigurePipe(AUDIO_DATA_OUT_PIPE, EP_TYPE_ISOCHRONOUS, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 2);
/* Valid data found, return success */
return SuccessfulConfigRead;
diff --git a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h
index dcf367e15..0c4f06766 100644
--- a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h
@@ -42,8 +42,8 @@
#include "AudioOutputHost.h"
/* Macros: */
- /** Pipe number for the Audio data OUT pipe. */
- #define AUDIO_DATA_OUT_PIPE 1
+ /** Pipe address for the Audio data OUT pipe. */
+ #define AUDIO_DATA_OUT_PIPE (PIPE_DIR_OUT | 1)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf b/Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf
index 55c9bb563..9cb0e55a2 100644
--- a/Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf
+++ b/Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf
@@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = "LUFA Library - Audio Output Host"
+PROJECT_NAME = "LUFA Library - Audio Output Host Demo"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
diff --git a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c
index 6df253cb5..9067450e2 100644
--- a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c
@@ -109,16 +109,14 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the HID data IN pipe */
- Pipe_ConfigurePipe(HID_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(HID_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS);
/* Check if the HID interface contained an optional OUT data endpoint */
if (DataOUTEndpoint)
{
/* Configure the HID data OUT pipe */
- Pipe_ConfigurePipe(HID_DATA_OUT_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(HID_DATA_OUT_PIPE, EP_TYPE_INTERRUPT, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
}
/* Valid data found, return success */
diff --git a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h
index 4614893d5..547f1545b 100644
--- a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h
@@ -42,11 +42,11 @@
#include "GenericHIDHost.h"
/* Macros: */
- /** Pipe number for the HID data IN pipe. */
- #define HID_DATA_IN_PIPE 1
+ /** Pipe address for the HID data IN pipe. */
+ #define HID_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number for the HID data OUT pipe. */
- #define HID_DATA_OUT_PIPE 2
+ /** Pipe address for the HID data OUT pipe. */
+ #define HID_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c
index 4f7a0d61b..be6eb09cd 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c
@@ -110,8 +110,7 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the HID data IN pipe */
- Pipe_ConfigurePipe(JOYSTICK_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(JOYSTICK_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS);
/* Get the HID report size from the HID report descriptor */
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h
index 69fdfedf2..fba5713b2 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h
@@ -42,8 +42,8 @@
#include "HIDReport.h"
/* Macros: */
- /** Pipe number for the joystick report data pipe. */
- #define JOYSTICK_DATA_IN_PIPE 1
+ /** Pipe address for the joystick report data pipe. */
+ #define JOYSTICK_DATA_IN_PIPE (PIPE_DIR_IN | 1)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf b/Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf
index 4366e6edd..65c60866b 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf
@@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = "LUFA Library - Joystick Host (Using HID Descriptor Parser)"
+PROJECT_NAME = "LUFA Library - Joystick Host Demo (Using HID Descriptor Parser)"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
diff --git a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c
index cfcee7b8b..73dc5dfe5 100644
--- a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c
@@ -98,8 +98,7 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the HID data IN pipe */
- Pipe_ConfigurePipe(KEYBOARD_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(KEYBOARD_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS);
/* Valid data found, return success */
diff --git a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h
index 5b44d3fd5..eb09f695f 100644
--- a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h
@@ -42,8 +42,8 @@
#include "KeyboardHost.h"
/* Macros: */
- /** Pipe number for the keyboard data IN pipe. */
- #define KEYBOARD_DATA_IN_PIPE 1
+ /** Pipe address for the keyboard data IN pipe. */
+ #define KEYBOARD_DATA_IN_PIPE (PIPE_DIR_IN | 1)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c
index 765b325f0..ddd43590b 100644
--- a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c
@@ -110,8 +110,7 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the HID data IN pipe */
- Pipe_ConfigurePipe(KEYBOARD_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(KEYBOARD_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS);
/* Get the HID report size from the HID report descriptor */
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h
index ffa2afd8e..c40211cb0 100644
--- a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h
@@ -42,8 +42,8 @@
#include "HIDReport.h"
/* Macros: */
- /** Pipe number for the keyboard report data pipe. */
- #define KEYBOARD_DATA_IN_PIPE 1
+ /** Pipe address for the keyboard report data IN pipe. */
+ #define KEYBOARD_DATA_IN_PIPE (PIPE_DIR_IN | 1)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf b/Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf
index 9f76d7efd..3e481571d 100644
--- a/Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf
+++ b/Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf
@@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = "LUFA Library - Keyboard Host (Using HID Descriptor Parser)"
+PROJECT_NAME = "LUFA Library - Keyboard Host Demo (Using HID Descriptor Parser)"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c
index 39e513cf6..70381ea56 100644
--- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c
@@ -105,12 +105,10 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the MIDI data IN pipe */
- Pipe_ConfigurePipe(MIDI_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(MIDI_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the MIDI data OUT pipe */
- Pipe_ConfigurePipe(MIDI_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(MIDI_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Valid data found, return success */
return SuccessfulConfigRead;
diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h
index d41513e4e..40d4dc9cc 100644
--- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h
@@ -42,11 +42,11 @@
#include "MIDIHost.h"
/* Macros: */
- /** Pipe number for the MIDI data IN pipe. */
- #define MIDI_DATA_IN_PIPE 1
+ /** Pipe address for the MIDI data IN pipe. */
+ #define MIDI_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number for the MIDI data OUT pipe. */
- #define MIDI_DATA_OUT_PIPE 2
+ /** Pipe address for the MIDI data OUT pipe. */
+ #define MIDI_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c
index 566cdb10c..0e967f972 100644
--- a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c
@@ -105,12 +105,10 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the Mass Storage data IN pipe */
- Pipe_ConfigurePipe(MASS_STORE_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(MASS_STORE_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the Mass Storage data OUT pipe */
- Pipe_ConfigurePipe(MASS_STORE_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(MASS_STORE_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Valid data found, return success */
return SuccessfulConfigRead;
diff --git a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h
index a40debd98..eb0746b04 100644
--- a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h
@@ -51,11 +51,11 @@
/** Interface Protocol value for the Bulk Only transport protocol. */
#define MASS_STORE_PROTOCOL 0x50
- /** Pipe number of the Mass Storage data IN pipe. */
- #define MASS_STORE_DATA_IN_PIPE 1
+ /** Pipe address of the Mass Storage data IN pipe. */
+ #define MASS_STORE_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number of the Mass Storage data OUT pipe. */
- #define MASS_STORE_DATA_OUT_PIPE 2
+ /** Pipe address of the Mass Storage data OUT pipe. */
+ #define MASS_STORE_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c
index c33e08769..4992e3a67 100644
--- a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c
@@ -98,8 +98,7 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the HID data IN pipe */
- Pipe_ConfigurePipe(MOUSE_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(MOUSE_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS);
/* Valid data found, return success */
diff --git a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h
index 9619c44ac..14051a6a9 100644
--- a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h
@@ -42,8 +42,8 @@
#include "MouseHost.h"
/* Macros: */
- /** Pipe number for the mouse data IN pipe. */
- #define MOUSE_DATA_IN_PIPE 1
+ /** Pipe address for the mouse data IN pipe. */
+ #define MOUSE_DATA_IN_PIPE (PIPE_DIR_IN | 1)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c
index c6647007c..7d63d2bdb 100644
--- a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c
@@ -110,8 +110,7 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the HID data IN pipe */
- Pipe_ConfigurePipe(MOUSE_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(MOUSE_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS);
/* Get the HID report size from the HID report descriptor */
diff --git a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h
index 799761bba..0a2582bfe 100644
--- a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h
@@ -42,8 +42,8 @@
#include "HIDReport.h"
/* Macros: */
- /** Pipe number for the mouse report data pipe. */
- #define MOUSE_DATA_IN_PIPE 1
+ /** Pipe address for the mouse report data IN pipe. */
+ #define MOUSE_DATA_IN_PIPE (ENDPOINT_DIR_IN | 1)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf b/Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf
index fcf83567f..b41e8d85a 100644
--- a/Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf
+++ b/Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf
@@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = "LUFA Library - Mouse Host (Using HID Descriptor Parser)"
+PROJECT_NAME = "LUFA Library - Mouse Host Demo (Using HID Descriptor Parser)"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
diff --git a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c
index f259c1fd8..922734f33 100644
--- a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c
@@ -108,12 +108,10 @@ uint8_t ProcessConfigurationDescriptor(void)
PrinterAltSetting = PrinterInterface->AlternateSetting;
/* Configure the Printer data IN pipe */
- Pipe_ConfigurePipe(PRINTER_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(PRINTER_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the Printer data OUT pipe */
- Pipe_ConfigurePipe(PRINTER_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(PRINTER_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Valid data found, return success */
return SuccessfulConfigRead;
diff --git a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h
index cc9e2cb44..d5a32cddf 100644
--- a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h
@@ -38,11 +38,11 @@
#include "Lib/PrinterCommands.h"
/* Macros: */
- /** Pipe number of the Printer data IN pipe. */
- #define PRINTER_DATA_IN_PIPE 1
+ /** Pipe address of the Printer data IN pipe. */
+ #define PRINTER_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number of the Printer data OUT pipe. */
- #define PRINTER_DATA_OUT_PIPE 2
+ /** Pipe address of the Printer data OUT pipe. */
+ #define PRINTER_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c
index 04930009e..df317ef62 100644
--- a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c
@@ -131,16 +131,13 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the RNDIS data IN pipe */
- Pipe_ConfigurePipe(RNDIS_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(RNDIS_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the RNDIS data OUT pipe */
- Pipe_ConfigurePipe(RNDIS_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(RNDIS_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Configure the RNDIS notification pipe */
- Pipe_ConfigurePipe(RNDIS_NOTIFICATION_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(RNDIS_NOTIFICATION_PIPE, EP_TYPE_INTERRUPT, NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(NotificationEndpoint->PollingIntervalMS);
/* Valid data found, return success */
diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h
index e9cf19f4c..19f26b408 100644
--- a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h
@@ -42,14 +42,14 @@
#include "RNDISEthernetHost.h"
/* Macros: */
- /** Pipe number for the RNDIS data IN pipe. */
- #define RNDIS_DATA_IN_PIPE 1
+ /** Pipe address for the RNDIS data IN pipe. */
+ #define RNDIS_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number for the RNDIS data OUT pipe. */
- #define RNDIS_DATA_OUT_PIPE 2
+ /** Pipe address for the RNDIS data OUT pipe. */
+ #define RNDIS_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
- /** Pipe number for the RNDIS notification pipe. */
- #define RNDIS_NOTIFICATION_PIPE 3
+ /** Pipe address for the RNDIS notification IN pipe. */
+ #define RNDIS_NOTIFICATION_PIPE (PIPE_DIR_IN | 3)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c
index 269dc3ba4..c5c78ce60 100644
--- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c
@@ -115,16 +115,13 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the Still Image data IN pipe */
- Pipe_ConfigurePipe(SIMAGE_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(SIMAGE_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the Still Image data OUT pipe */
- Pipe_ConfigurePipe(SIMAGE_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(SIMAGE_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Configure the Still Image events pipe */
- Pipe_ConfigurePipe(SIMAGE_EVENTS_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(SIMAGE_EVENTS_PIPE, EP_TYPE_INTERRUPT, EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(EventsEndpoint->PollingIntervalMS);
/* Valid data found, return success */
diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h
index 04b81a281..93dcfc644 100644
--- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h
@@ -42,14 +42,14 @@
#include "StillImageHost.h"
/* Macros: */
- /** Pipe number of the Still Image data IN pipe. */
- #define SIMAGE_DATA_IN_PIPE 1
+ /** Pipe address of the Still Image data IN pipe. */
+ #define SIMAGE_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number of the Still Image data OUT pipe. */
- #define SIMAGE_DATA_OUT_PIPE 2
+ /** Pipe address of the Still Image data OUT pipe. */
+ #define SIMAGE_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
- /** Pipe number of the Still Image events pipe. */
- #define SIMAGE_EVENTS_PIPE 3
+ /** Pipe address of the Still Image events IN pipe. */
+ #define SIMAGE_EVENTS_PIPE (PIPE_DIR_IN | 3)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c
index 4126d761d..552b02aff 100644
--- a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c
@@ -131,16 +131,13 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the CDC data IN pipe */
- Pipe_ConfigurePipe(CDC_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(CDC_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the CDC data OUT pipe */
- Pipe_ConfigurePipe(CDC_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(CDC_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Configure the CDC notification pipe */
- Pipe_ConfigurePipe(CDC_NOTIFICATION_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(CDC_NOTIFICATION_PIPE, EP_TYPE_INTERRUPT, NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(NotificationEndpoint->PollingIntervalMS);
/* Valid data found, return success */
diff --git a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h
index c5a60b48a..e9f12dcc4 100644
--- a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h
@@ -42,14 +42,14 @@
#include "VirtualSerialHost.h"
/* Macros: */
- /** Pipe number for the CDC data IN pipe. */
- #define CDC_DATA_IN_PIPE 1
+ /** Pipe address for the CDC data IN pipe. */
+ #define CDC_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number for the CDC data OUT pipe. */
- #define CDC_DATA_OUT_PIPE 2
+ /** Pipe address for the CDC data OUT pipe. */
+ #define CDC_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
- /** Pipe number for the CDC notification pipe. */
- #define CDC_NOTIFICATION_PIPE 3
+ /** Pipe address for the CDC notification IN pipe. */
+ #define CDC_NOTIFICATION_PIPE (PIPE_DIR_IN | 3)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/LUFA/Common/ArchitectureSpecific.h b/LUFA/Common/ArchitectureSpecific.h
index 3ba7a5c0a..f7dca6631 100644
--- a/LUFA/Common/ArchitectureSpecific.h
+++ b/LUFA/Common/ArchitectureSpecific.h
@@ -63,25 +63,27 @@
/* Public Interface - May be used in end-application: */
/* Macros: */
- #if (ARCH == ARCH_AVR8) || defined(__DOXYGEN__)
- /** Disables the AVR's JTAG bus in software, until a system reset. This will override the current JTAG
- * status as set by the JTAGEN fuse, disabling JTAG debugging and reverting the JTAG pins back to GPIO
- * mode.
- *
- * \note This macro is not available for all architectures.
- */
- #define JTAG_DISABLE() MACROS{ \
- __asm__ __volatile__ ( \
- "in __tmp_reg__,__SREG__" "\n\t" \
- "cli" "\n\t" \
- "out %1, %0" "\n\t" \
- "out __SREG__, __tmp_reg__" "\n\t" \
- "out %1, %0" "\n\t" \
- : \
- : "r" (1 << JTD), \
- "M" (_SFR_IO_ADDR(MCUCR)) \
- : "r0"); \
- }MACROE
+ #if (ARCH == ARCH_AVR8) || (ARCH == ARCH_XMEGA) || defined(__DOXYGEN__)
+ #if (ARCH == ARCH_AVR8) || defined(__DOXYGEN__)
+ /** Disables the AVR's JTAG bus in software, until a system reset. This will override the current JTAG
+ * status as set by the JTAGEN fuse, disabling JTAG debugging and reverting the JTAG pins back to GPIO
+ * mode.
+ *
+ * \note This macro is not available for all architectures.
+ */
+ #define JTAG_DISABLE() MACROS{ \
+ __asm__ __volatile__ ( \
+ "in __tmp_reg__,__SREG__" "\n\t" \
+ "cli" "\n\t" \
+ "out %1, %0" "\n\t" \
+ "out __SREG__, __tmp_reg__" "\n\t" \
+ "out %1, %0" "\n\t" \
+ : \
+ : "r" (1 << JTD), \
+ "M" (_SFR_IO_ADDR(MCUCR)) \
+ : "r0"); \
+ }MACROE
+ #endif
/** Defines a volatile \c NOP statement which cannot be optimized out by the compiler, and thus can always
* be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimizer
@@ -116,9 +118,10 @@
*
* \param[in] Condition Condition that will be evaluated,
*/
- #define STDOUT_ASSERT(Condition) MACROS{ if (!(x)) { printf_P(PSTR("%s: Function \"%s\", Line %d: " \
- "Assertion \"%s\" failed.\r\n"), \
- __FILE__, __func__, __LINE__, #Condition); } }MACROE
+ #define STDOUT_ASSERT(Condition) MACROS{ if (!(x)) { \
+ printf_P(PSTR("%s: Function \"%s\", Line %d: " \
+ "Assertion \"%s\" failed.\r\n"), \
+ __FILE__, __func__, __LINE__, #Condition); } }MACROE
#if !defined(pgm_read_ptr) || defined(__DOXYGEN__)
/** Reads a pointer out of PROGMEM space on the AVR8 architecture. This is currently a wrapper for the
@@ -135,6 +138,14 @@
*/
#define pgm_read_ptr(Address) (void*)pgm_read_word(Address)
#endif
+ #elif (ARCH == ARCH_UC3)
+ #define JTAG_DEBUG_POINT() __asm__ __volatile__ ("nop" ::)
+ #define JTAG_DEBUG_BREAK() __asm__ __volatile__ ("breakpoint" ::)
+ #define JTAG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE
+ #define STDOUT_ASSERT(Condition) MACROS{ if (!(x)) { \
+ printf("%s: Function \"%s\", Line %d: " \
+ "Assertion \"%s\" failed.\r\n"), \
+ __FILE__, __func__, __LINE__, #Condition); } }MACROE
#endif
/* Disable C linkage for C++ Compilers: */
diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt
index b35a39cb8..c0193f276 100644
--- a/LUFA/DoxygenPages/ChangeLog.txt
+++ b/LUFA/DoxygenPages/ChangeLog.txt
@@ -10,6 +10,8 @@
* <b>New:</b>
* - Core:
* - Added support for the BitWizard Multio and Big-Multio boards
+ * - Added new Endpoint_ConfigureEndpointTable() function
+ * - Added new Pipe_ConfigurePipeTable() function
* - Library Applications:
* - Modified the CDC Host demos to set a default CDC Line Encoding on enumerated devices
* - Added Dataflash operational checks and aborts to all projects using the Dataflash to ensure it is working correctly before use
@@ -20,6 +22,16 @@
* - Audio Device Class driver changed to also require the index of the Audio Control interface within the device, for SET/GET/CUR/MIN/MAX/RES property adjustments
* - Removed variable axis support from the HID_DESCRIPTOR_JOYSTICK() macro due to OS incompatibilities, replaced with fixed 3-axis joystick report structure
* - Removed the old pseudo-scheduler from the library as it was unused and deprecated since the 090810 release
+ * - Endpoint indexes are now specified as full endpoint addresses within the device in device mode, rather than a logical index
+ * - The Endpoint_ConfigureEndpoint() function no longer takes an endpoint direction as a parameter, as this is now deduced from the specified full endpoint
+ * address and type
+ * - The Endpoint_ConfigureEndpoint() function no longer takes a number of banks as a special mask; the number of banks is now specified as an integer parameter
+ * - Endpoints are now configured via instances of a new struct USB_Endpoint_Table_t in all device mode class drivers, rather than a list of endpoint parameters
+ * - Pipe indexes are now specified as full pipe addresses within the host in host mode, rather than a logical index
+ * - The Pipe_ConfigurePipe() function no longer takes an pipe token as a parameter, as this is now deduced from the specified full pipe address and type
+ * - The Pipe_ConfigurePipe() function no longer takes a number of banks as a special mask; the number of banks is now specified as an integer parameter
+ * - Pipes are now configured via instances of a new struct USB_Pipe_Table_t in all host mode class drivers, rather than a list of pipe parameters
+ * - Added support for various assert and debugging macros for the UC3 devices
* - Library Applications:
* - Raised the guard bits in the AVRISP-MKII clone project when in PDI and TPI to 32, to prevent communication errors on low quality connections to a target
* - Added additional bootloader API data to expose the bootloader start address and class to the DFU and CDC class bootloaders
diff --git a/LUFA/DoxygenPages/DeviceSupport.txt b/LUFA/DoxygenPages/DeviceSupport.txt
index c8083d275..214938fbb 100644
--- a/LUFA/DoxygenPages/DeviceSupport.txt
+++ b/LUFA/DoxygenPages/DeviceSupport.txt
@@ -377,6 +377,36 @@
* <td bgcolor="#00EE00">Yes</td>
* <td bgcolor="#EE0000">No</td>
* </tr>
+ * <tr>
+ * <td>ATXMEGA64C3</td>
+ * <td bgcolor="#00EE00">Yes</td>
+ * <td bgcolor="#EE0000">No</td>
+ * </tr>
+ * <tr>
+ * <td>ATXMEGA128C3</td>
+ * <td bgcolor="#00EE00">Yes</td>
+ * <td bgcolor="#EE0000">No</td>
+ * </tr>
+ * <tr>
+ * <td>ATXMEGA192C3</td>
+ * <td bgcolor="#00EE00">Yes</td>
+ * <td bgcolor="#EE0000">No</td>
+ * </tr>
+ * <tr>
+ * <td>ATXMEGA256C3</td>
+ * <td bgcolor="#00EE00">Yes</td>
+ * <td bgcolor="#EE0000">No</td>
+ * </tr>
+ * <tr>
+ * <td>ATXMEGA16C4</td>
+ * <td bgcolor="#00EE00">Yes</td>
+ * <td bgcolor="#EE0000">No</td>
+ * </tr>
+ * <tr>
+ * <td>ATXMEGA32C4</td>
+ * <td bgcolor="#00EE00">Yes</td>
+ * <td bgcolor="#EE0000">No</td>
+ * </tr>
* </table>
*
* \section Sec_XMEGASupport_Boards Supported Atmel Boards
diff --git a/LUFA/DoxygenPages/FutureChanges.txt b/LUFA/DoxygenPages/FutureChanges.txt
index b75e94d7a..3e7a217b9 100644
--- a/LUFA/DoxygenPages/FutureChanges.txt
+++ b/LUFA/DoxygenPages/FutureChanges.txt
@@ -22,7 +22,6 @@
* -# Pull out third party libraries into a separate folder and reference them as required
* -# Add a LUFA_YIELD macro for integration into a third-party RTOS
* -# Abstract out Mass Storage byte send/receive to prevent low level API use in projects
- * -# Consider switch from endpoint numbers to full endpoint addresses to ease future architecture expansion
* -# Fix HID report parser usage support for array types
* -# Make HOST_DEVICE_SETTLE_DELAY_MS a global variable that can be changed
* -# Add MANDATORY_EVENT_FUNCTIONS compile time option
diff --git a/LUFA/DoxygenPages/LUFAPoweredProjects.txt b/LUFA/DoxygenPages/LUFAPoweredProjects.txt
index ea0870515..5179850e1 100644
--- a/LUFA/DoxygenPages/LUFAPoweredProjects.txt
+++ b/LUFA/DoxygenPages/LUFAPoweredProjects.txt
@@ -36,6 +36,7 @@
* The following are known hobbyist projects using LUFA. Most are open source, and show off interesting ways that the LUFA library
* can be incorporated into many different applications.
*
+ * \li Accelerometer Game Joystick: http://www.crictor.co.il/he/episodes/joystick/
* \li Arcade Controller: http://fletchtronics.net/arcade-controller-made-petunia
* \li Arcade Joystick: http://jamie.lentin.co.uk/embedded/arcade-joystick/
* \li AttoBasic AVR BASIC interpreter: http://www.cappels.org/dproj/AttoBasic2_1/AttoBasic_2.1_with_USB_and_Arduino_support.html
diff --git a/LUFA/DoxygenPages/MigrationInformation.txt b/LUFA/DoxygenPages/MigrationInformation.txt
index 93082bb5c..fe0473284 100644
--- a/LUFA/DoxygenPages/MigrationInformation.txt
+++ b/LUFA/DoxygenPages/MigrationInformation.txt
@@ -17,10 +17,27 @@
* - The HID_DESCRIPTOR_JOYSTICK() macro no longer takes a variable number of axis as a parameter, due to OS incompatibilities; this macro now uses a fixed
* 3 axis of data. User applications should update their calls to this macro and their report structures to suit a fixed 3-axis joystick report. If a user
* application requires more than 3 axis' of data, a custom report descriptor will need to be constructed by hand.
+ * - The \ref Endpoint_ConfigureEndpoint() function no longer takes in masks for the banks and direction; the number of banks is now an integer argument, and
+ * the direction is obtained from the full endpoint address within the device. Applications calling Endpoint_ConfigureEndpoint() should update their API
+ * call to use a full endpoint address (including ENDPOINT_DIR_IN or ENDPOINT_DIR_OUT direction in the MSB of the endpoint address) and an integer number
+ * of banks.
+ * - All endpoint functions now operate on full endpoint addresses within the device, rather than a directionless endpoint index. Applications should update
+ * their API calls to use full endpoint addresses when required within the device.
+ * - All device mode class drivers have been updated to use a new unified endpoint description structure for all endpoints; existing applications will need
+ * to update their class driver struct instantiation to match the new scheme (see \ref USB_Endpoint_Table_t).
+ * - The \c ENDPOINT_BANKS_SUPPORTED() and \c ENDPOINT_MAX_ENDPOINT_SIZE() macros have been removed, as these do not function correctly with the new addressing
+ * scheme for the endpoint APIs. Please refer to the target device's datasheet for the maximum bank size of each endpoint.
*
* <b>Host Mode</b>
* - The Android Accessory Host class driver property strings are now a array of \c char* rather than a struct of named pointers. Existing applications
* should use C99 Designated Initializers with the property string indexes located in \ref AOA_Strings_t instead.
+ * - The \ref Pipe_ConfigurePipe() function no longer takes in masks for the banks and token; the number of banks is now an integer argument, and the token
+ * is now inferred from the full pipe address within the device, and the pipe type. Applications calling Pipe_ConfigurePipe() should update their API
+ * call to use a full pipe address (including PIPE_DIR_IN or PIPE_DIR_OUT direction in the MSB of the pipe address) and an integer number of banks.
+ * - All pipe functions now operate on full pipe addresses within the device, rather than a directionless pipe index. Applications should update their API
+ * calls to use full pipe addresses when required within the device.
+ * - All host mode class drivers have been updated to use a new unified pipe description structure for all pipes; existing applications will need to update
+ * their class driver struct instantiation to match the new scheme (see \ref USB_Pipe_Table_t).
*
* \section Sec_Migration120219 Migrating from 111009 to 120219
* <b>USB Core</b>
@@ -130,7 +147,7 @@
* eliminate any casting of descriptor pointers to a non \c const pointer.
* - The names of the class specific descriptor type defines in the USB Class drivers have changed - refer to the driver documentation
* for each class driver for the new class specific descriptor type names.
- * - The \c ENDPOINT_DOUBLEBANK_SUPPORTED() macro is has been renamed \ref ENDPOINT_BANKS_SUPPORTED() and now returns the total number of
+ * - The \c ENDPOINT_DOUBLEBANK_SUPPORTED() macro is has been renamed \c ENDPOINT_BANKS_SUPPORTED() and now returns the total number of
* banks supported by the given endpoint. Existing code should switch to the new naming scheme, and test that the return value of the
* macro is equal to or greater than 2 to regain the previous functionality.
* - The \c EVENT_USB_Device_UnhandledControlRequest() event is now named \ref EVENT_USB_Device_ControlRequest() and fires before (not after)
diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h
index abc8d85d1..df357611b 100644
--- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h
+++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h
@@ -71,10 +71,10 @@
#define DATAFLASH_TOTALCHIPS 1
/** Mask for no dataflash chip selected. */
- #define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK
+ #define DATAFLASH_NO_CHIP 0
/** Mask for the first dataflash chip selected. */
- #define DATAFLASH_CHIP1 0
+ #define DATAFLASH_CHIP1 (1 << 4)
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
@@ -88,8 +88,10 @@
*/
static inline void Dataflash_Init(void)
{
- DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
- DATAFLASH_CHIPCS_PORT.OUTSET = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
+
+ PORTCFG.MPCMASK = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.PIN0CTRL = PORT_INVEN_bm;
}
/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
@@ -143,7 +145,8 @@
static inline void Dataflash_SelectChip(const uint8_t ChipMask) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SelectChip(const uint8_t ChipMask)
{
- DATAFLASH_CHIPCS_PORT.OUT = ((DATAFLASH_CHIPCS_PORT.OUT & ~DATAFLASH_CHIPCS_MASK) | ChipMask);
+ DATAFLASH_CHIPCS_PORT.OUTCLR = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.OUTSET = ChipMask;
}
/** Deselects the current dataflash chip, so that no dataflash is selected. */
diff --git a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h
index f1e6da5f0..0b8a2617e 100644
--- a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h
+++ b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h
@@ -71,10 +71,10 @@
#define DATAFLASH_TOTALCHIPS 1
/** Mask for no dataflash chip selected. */
- #define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK
+ #define DATAFLASH_NO_CHIP 0
/** Mask for the first dataflash chip selected. */
- #define DATAFLASH_CHIP1 0
+ #define DATAFLASH_CHIP1 (1 << 2)
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
@@ -88,10 +88,12 @@
*/
static inline void Dataflash_Init(void)
{
- DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
- DATAFLASH_CHIPCS_PORT.OUTSET = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
- PORTE.REMAP |= PORT_USART0_bm;
+ PORTCFG.MPCMASK = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.PIN0CTRL = PORT_INVEN_bm;
+
+ PORTC.REMAP |= PORT_USART0_bm;
}
/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
@@ -103,7 +105,7 @@
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte)
{
- return SerialSPI_TransferByte(&USARTE0, Byte);
+ return SerialSPI_TransferByte(&USARTC0, Byte);
}
/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash.
@@ -113,7 +115,7 @@
static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SendByte(const uint8_t Byte)
{
- SerialSPI_SendByte(&USARTE0, Byte);
+ SerialSPI_SendByte(&USARTC0, Byte);
}
/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
@@ -123,7 +125,7 @@
static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Dataflash_ReceiveByte(void)
{
- return SerialSPI_ReceiveByte(&USARTE0);
+ return SerialSPI_ReceiveByte(&USARTC0);
}
/** Determines the currently selected dataflash chip.
@@ -145,7 +147,8 @@
static inline void Dataflash_SelectChip(const uint8_t ChipMask) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SelectChip(const uint8_t ChipMask)
{
- DATAFLASH_CHIPCS_PORT.OUT = ((DATAFLASH_CHIPCS_PORT.OUT & ~DATAFLASH_CHIPCS_MASK) | ChipMask);
+ DATAFLASH_CHIPCS_PORT.OUTCLR = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.OUTSET = (ChipMask & DATAFLASH_CHIPCS_MASK);
}
/** Deselects the current dataflash chip, so that no dataflash is selected. */
diff --git a/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h b/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h
index 0126630ac..562aaecfd 100644
--- a/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h
+++ b/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h
@@ -176,9 +176,7 @@
*/
static inline void SerialSPI_SendByte(const uint8_t DataByte)
{
- UDR1 = DataByte;
- while (!(UCSR1A & (1 << TXC1)));
- UCSR1A = (1 << TXC1);
+ SerialSPI_TransferByte(DataByte);
}
/** Sends a dummy byte through the USART SPI interface, blocking until the transfer is complete. The response
@@ -188,10 +186,7 @@
*/
static inline uint8_t SerialSPI_ReceiveByte(void)
{
- UDR1 = 0;
- while (!(UCSR1A & (1 << TXC1)));
- UCSR1A = (1 << TXC1);
- return UDR1;
+ return SerialSPI_TransferByte(0);
}
/* Disable C linkage for C++ Compilers: */
diff --git a/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h b/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h
index 6f8251f60..a0e9e3370 100644
--- a/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h
+++ b/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h
@@ -52,7 +52,7 @@
*
* \code
* // Initialize the Master SPI mode USART driver before first use, with 1Mbit baud
- * SerialSPI_Init(&USARTD0, (USART_SPI_SCK_LEAD_RISING | SPI_SAMPLE_LEADING | SPI_ORDER_MSB_FIRST), 1000000);
+ * SerialSPI_Init(&USARTD0, (USART_SPI_SCK_LEAD_RISING | USART_SPI_SAMPLE_LEADING | USART_SPI_ORDER_MSB_FIRST), 1000000);
*
* // Send several bytes, ignoring the returned data
* SerialSPI_SendByte(&USARTD0, 0x01);
@@ -177,9 +177,7 @@
static inline void SerialSPI_SendByte(USART_t* const USART,
const uint8_t DataByte)
{
- USART->DATA = DataByte;
- while (!(USART->STATUS & USART_TXCIF_bm));
- USART->STATUS = USART_TXCIF_bm;
+ SerialSPI_TransferByte(USART, DataByte);
}
/** Sends a dummy byte through the USART SPI interface, blocking until the transfer is complete. The response
@@ -191,10 +189,7 @@
*/
static inline uint8_t SerialSPI_ReceiveByte(USART_t* const USART)
{
- USART->DATA = 0;
- while (!(USART->STATUS & USART_TXCIF_bm));
- USART->STATUS = USART_TXCIF_bm;
- return USART->DATA;
+ return SerialSPI_TransferByte(USART, 0);
}
/* Disable C linkage for C++ Compilers: */
diff --git a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c
index 15fcd588d..ad79e9b2b 100644
--- a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c
+++ b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c
@@ -48,15 +48,16 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
if ((InterfaceIndex != AudioInterfaceInfo->Config.ControlInterfaceNumber) &&
(InterfaceIndex != AudioInterfaceInfo->Config.StreamingInterfaceNumber))
-
- return;
+ {
+ return;
+ }
}
else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT)
{
- uint8_t EndpointIndex = (USB_ControlRequest.wIndex & 0xFF);
+ uint8_t EndpointAddress = (USB_ControlRequest.wIndex & 0xFF);
- if ((EndpointIndex != (ENDPOINT_DIR_IN | AudioInterfaceInfo->Config.DataINEndpointNumber)) &&
- (EndpointIndex != (ENDPOINT_DIR_OUT | AudioInterfaceInfo->Config.DataOUTEndpointNumber)))
+ if ((EndpointAddress != AudioInterfaceInfo->Config.DataINEndpoint.Address) &&
+ (EndpointAddress != AudioInterfaceInfo->Config.DataOUTEndpoint.Address))
{
return;
}
@@ -88,7 +89,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
case AUDIO_REQ_SetMinimum:
case AUDIO_REQ_SetMaximum:
case AUDIO_REQ_SetResolution:
- if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT))
+ if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT)
{
uint8_t EndpointProperty = USB_ControlRequest.bRequest;
uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex;
@@ -108,7 +109,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
EndpointControl, &ValueLength, Value);
}
}
- else if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
+ else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_INTERFACE)
{
uint8_t Property = USB_ControlRequest.bRequest;
uint8_t Entity = (USB_ControlRequest.wIndex >> 8);
@@ -134,7 +135,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
case AUDIO_REQ_GetMinimum:
case AUDIO_REQ_GetMaximum:
case AUDIO_REQ_GetResolution:
- if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT))
+ if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT)
{
uint8_t EndpointProperty = USB_ControlRequest.bRequest;
uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex;
@@ -150,7 +151,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
Endpoint_ClearOUT();
}
}
- else if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
+ else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_INTERFACE)
{
uint8_t Property = USB_ControlRequest.bRequest;
uint8_t Entity = (USB_ControlRequest.wIndex >> 8);
@@ -174,39 +175,15 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi
bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
{
memset(&AudioInterfaceInfo->State, 0x00, sizeof(AudioInterfaceInfo->State));
+
+ AudioInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_ISOCHRONOUS;
+ AudioInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_ISOCHRONOUS;
- for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Direction;
- bool DoubleBanked;
+ if (!(Endpoint_ConfigureEndpointTable(&AudioInterfaceInfo->Config.DataINEndpoint, 1)))
+ return false;
- if (EndpointNum == AudioInterfaceInfo->Config.DataINEndpointNumber)
- {
- Size = AudioInterfaceInfo->Config.DataINEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_ISOCHRONOUS;
- DoubleBanked = true;
- }
- else if (EndpointNum == AudioInterfaceInfo->Config.DataOUTEndpointNumber)
- {
- Size = AudioInterfaceInfo->Config.DataOUTEndpointSize;
- Direction = ENDPOINT_DIR_OUT;
- Type = EP_TYPE_ISOCHRONOUS;
- DoubleBanked = true;
- }
- else
- {
- continue;
- }
-
- if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
- DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
- {
- return false;
- }
- }
+ if (!(Endpoint_ConfigureEndpointTable(&AudioInterfaceInfo->Config.DataOUTEndpoint, 1)))
+ return false;
return true;
}
diff --git a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h
index 239126607..a8bfc7833 100644
--- a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h
+++ b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h
@@ -86,19 +86,8 @@
* structure controls.
*/
- uint8_t DataINEndpointNumber; /**< Endpoint number of the incoming Audio Streaming data, if available
- * (zero if unused).
- */
- uint16_t DataINEndpointSize; /**< Size in bytes of the incoming Audio Streaming data endpoint, if available
- * (zero if unused).
- */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing Audio Streaming data, if available
- * (zero if unused).
- */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing Audio Streaming data endpoint, if available
- * (zero if unused).
- */
+ USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */
+ USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */
} 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.
*/
@@ -226,7 +215,7 @@
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))
return false;
- Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpoint.Address);
return Endpoint_IsOUTReceived();
}
@@ -247,7 +236,7 @@
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))
return false;
- Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataINEndpoint.Address);
return Endpoint_IsINReady();
}
@@ -341,7 +330,7 @@
{
Endpoint_Write_8(Sample);
- if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpointSize)
+ if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpoint.Size)
Endpoint_ClearIN();
}
@@ -360,7 +349,7 @@
{
Endpoint_Write_16_LE(Sample);
- if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpointSize)
+ if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpoint.Size)
Endpoint_ClearIN();
}
@@ -380,7 +369,7 @@
Endpoint_Write_16_LE(Sample);
Endpoint_Write_8(Sample >> 16);
- if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpointSize)
+ if (Endpoint_BytesInEndpoint() == AudioInterfaceInfo->Config.DataINEndpoint.Size)
Endpoint_ClearIN();
}
diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c
index 5b5343860..a16949cfd 100644
--- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c
+++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c
@@ -112,45 +112,18 @@ bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_Device_t* const CDCInterfac
{
memset(&CDCInterfaceInfo->State, 0x00, sizeof(CDCInterfaceInfo->State));
- for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Direction;
- bool DoubleBanked;
+ CDCInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK;
+ CDCInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK;
+ CDCInterfaceInfo->Config.NotificationEndpoint.Type = EP_TYPE_INTERRUPT;
- if (EndpointNum == CDCInterfaceInfo->Config.DataINEndpointNumber)
- {
- Size = CDCInterfaceInfo->Config.DataINEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = CDCInterfaceInfo->Config.DataINEndpointDoubleBank;
- }
- else if (EndpointNum == CDCInterfaceInfo->Config.DataOUTEndpointNumber)
- {
- Size = CDCInterfaceInfo->Config.DataOUTEndpointSize;
- Direction = ENDPOINT_DIR_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = CDCInterfaceInfo->Config.DataOUTEndpointDoubleBank;
- }
- else if (EndpointNum == CDCInterfaceInfo->Config.NotificationEndpointNumber)
- {
- Size = CDCInterfaceInfo->Config.NotificationEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_INTERRUPT;
- DoubleBanked = CDCInterfaceInfo->Config.NotificationEndpointDoubleBank;
- }
- else
- {
- continue;
- }
+ if (!(Endpoint_ConfigureEndpointTable(&CDCInterfaceInfo->Config.DataINEndpoint, 1)))
+ return false;
- if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
- DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
- {
- return false;
- }
- }
+ if (!(Endpoint_ConfigureEndpointTable(&CDCInterfaceInfo->Config.DataOUTEndpoint, 1)))
+ return false;
+
+ if (!(Endpoint_ConfigureEndpointTable(&CDCInterfaceInfo->Config.NotificationEndpoint, 1)))
+ return false;
return true;
}
@@ -171,7 +144,7 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return ENDPOINT_RWSTREAM_DeviceDisconnected;
- Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
return Endpoint_Write_Stream_LE(String, strlen(String), NULL);
}
@@ -182,7 +155,7 @@ uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return ENDPOINT_RWSTREAM_DeviceDisconnected;
- Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
return Endpoint_Write_Stream_LE(Buffer, Length, NULL);
}
@@ -192,7 +165,7 @@ uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return ENDPOINT_RWSTREAM_DeviceDisconnected;
- Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
if (!(Endpoint_IsReadWriteAllowed()))
{
@@ -215,7 +188,7 @@ uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
uint8_t ErrorCode;
- Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
if (!(Endpoint_BytesInEndpoint()))
return ENDPOINT_READYWAIT_NoError;
@@ -240,7 +213,7 @@ uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterface
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return 0;
- Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpoint.Address);
if (Endpoint_IsOUTReceived())
{
@@ -267,7 +240,7 @@ int16_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInf
int16_t ReceivedByte = -1;
- Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpoint.Address);
if (Endpoint_IsOUTReceived())
{
@@ -286,7 +259,7 @@ void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDC
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
return;
- Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.NotificationEndpointNumber);
+ Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.NotificationEndpoint.Address);
USB_Request_Header_t Notification = (USB_Request_Header_t)
{
diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h
index cc0dd1b15..508c234d7 100644
--- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h
+++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h
@@ -99,19 +99,11 @@
{
struct
{
- uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device. */
-
- uint8_t DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint. */
- uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint. */
- bool DataINEndpointDoubleBank; /**< Indicates if the CDC interface's IN data endpoint should use double banking. */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint. */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the CDC interface's OUT data endpoint. */
- bool DataOUTEndpointDoubleBank; /**< Indicates if the CDC interface's OUT data endpoint should use double banking. */
-
- uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used. */
- uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used. */
- bool NotificationEndpointDoubleBank; /**< Indicates if the CDC interface's notification endpoint should use double banking. */
+ uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device. */
+
+ USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */
+ USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */
+ USB_Endpoint_Table_t NotificationEndpoint; /**< Notification IN Endpoint configuration table. */
} 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.
*/
diff --git a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c
index 5c8d878e7..e4b565327 100644
--- a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c
+++ b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c
@@ -141,13 +141,11 @@ bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfac
HIDInterfaceInfo->State.UsingReportProtocol = true;
HIDInterfaceInfo->State.IdleCount = 500;
- if (!(Endpoint_ConfigureEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber, EP_TYPE_INTERRUPT,
- ENDPOINT_DIR_IN, HIDInterfaceInfo->Config.ReportINEndpointSize,
- HIDInterfaceInfo->Config.ReportINEndpointDoubleBank ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
- {
- return false;
- }
+ HIDInterfaceInfo->Config.ReportINEndpoint.Type = EP_TYPE_INTERRUPT;
+ if (!(Endpoint_ConfigureEndpointTable(&HIDInterfaceInfo->Config.ReportINEndpoint, 1)))
+ return false;
+
return true;
}
@@ -159,7 +157,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
if (HIDInterfaceInfo->State.PrevFrameNum == USB_Device_GetFrameNumber())
return;
- Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber);
+ Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpoint.Address);
if (Endpoint_IsReadWriteAllowed())
{
@@ -184,7 +182,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
{
HIDInterfaceInfo->State.IdleMSRemaining = HIDInterfaceInfo->State.IdleCount;
- Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber);
+ Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpoint.Address);
if (ReportID)
Endpoint_Write_8(ReportID);
diff --git a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h
index a6361c6b0..e358dec75 100644
--- a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h
+++ b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h
@@ -85,9 +85,7 @@
{
uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device. */
- uint8_t ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint. */
- uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint. */
- bool ReportINEndpointDoubleBank; /**< Indicates if the HID interface's IN report endpoint should use double banking. */
+ USB_Endpoint_Table_t ReportINEndpoint; /**< Data IN HID report endpoint configuration table. */
void* PrevReportINBuffer; /**< Pointer to a buffer where the previously created HID input report can be
* stored by the driver, for comparison purposes to detect report changes that
diff --git a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c
index 9f0506e56..c9553a413 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c
+++ b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c
@@ -41,38 +41,14 @@ bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInter
{
memset(&MIDIInterfaceInfo->State, 0x00, sizeof(MIDIInterfaceInfo->State));
- for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Direction;
- bool DoubleBanked;
-
- if (EndpointNum == MIDIInterfaceInfo->Config.DataINEndpointNumber)
- {
- Size = MIDIInterfaceInfo->Config.DataINEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = MIDIInterfaceInfo->Config.DataINEndpointDoubleBank;
- }
- else if (EndpointNum == MIDIInterfaceInfo->Config.DataOUTEndpointNumber)
- {
- Size = MIDIInterfaceInfo->Config.DataOUTEndpointSize;
- Direction = ENDPOINT_DIR_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = MIDIInterfaceInfo->Config.DataOUTEndpointDoubleBank;
- }
- else
- {
- continue;
- }
-
- if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
- DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
- {
- return false;
- }
- }
+ MIDIInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK;
+ MIDIInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK;
+
+ if (!(Endpoint_ConfigureEndpointTable(&MIDIInterfaceInfo->Config.DataINEndpoint, 1)))
+ return false;
+
+ if (!(Endpoint_ConfigureEndpointTable(&MIDIInterfaceInfo->Config.DataOUTEndpoint, 1)))
+ return false;
return true;
}
@@ -95,7 +71,7 @@ uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
uint8_t ErrorCode;
- Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);
if ((ErrorCode = Endpoint_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL)) != ENDPOINT_RWSTREAM_NoError)
return ErrorCode;
@@ -113,7 +89,7 @@ uint8_t MIDI_Device_Flush(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
uint8_t ErrorCode;
- Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address);
if (Endpoint_BytesInEndpoint())
{
@@ -132,7 +108,7 @@ bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter
if (USB_DeviceState != DEVICE_STATE_Configured)
return false;
- Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataOUTEndpoint.Address);
if (!(Endpoint_IsReadWriteAllowed()))
return false;
diff --git a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h
index 4fe49af1f..2703600ea 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h
+++ b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h
@@ -81,13 +81,8 @@
{
uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this structure controls. */
- uint8_t DataINEndpointNumber; /**< Endpoint number of the incoming MIDI IN data, if available (zero if unused). */
- uint16_t DataINEndpointSize; /**< Size in bytes of the incoming MIDI IN data endpoint, if available (zero if unused). */
- bool DataINEndpointDoubleBank; /**< Indicates if the MIDI interface's IN data endpoint should use double banking. */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing MIDI OUT data, if available (zero if unused). */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing MIDI OUT data endpoint, if available (zero if unused). */
- bool DataOUTEndpointDoubleBank; /**< Indicates if the MIDI interface's OUT data endpoint should use double banking. */
+ USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */
+ USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */
} 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.
*/
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c
index 6294a0a94..153ebbc89 100644
--- a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c
+++ b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c
@@ -75,38 +75,14 @@ bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
{
memset(&MSInterfaceInfo->State, 0x00, sizeof(MSInterfaceInfo->State));
- for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Direction;
- bool DoubleBanked;
+ MSInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK;
+ MSInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK;
- if (EndpointNum == MSInterfaceInfo->Config.DataINEndpointNumber)
- {
- Size = MSInterfaceInfo->Config.DataINEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = MSInterfaceInfo->Config.DataINEndpointDoubleBank;
- }
- else if (EndpointNum == MSInterfaceInfo->Config.DataOUTEndpointNumber)
- {
- Size = MSInterfaceInfo->Config.DataOUTEndpointSize;
- Direction = ENDPOINT_DIR_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = MSInterfaceInfo->Config.DataOUTEndpointDoubleBank;
- }
- else
- {
- continue;
- }
+ if (!(Endpoint_ConfigureEndpointTable(&MSInterfaceInfo->Config.DataINEndpoint, 1)))
+ return false;
- if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
- DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
- {
- return false;
- }
- }
+ if (!(Endpoint_ConfigureEndpointTable(&MSInterfaceInfo->Config.DataOUTEndpoint, 1)))
+ return false;
return true;
}
@@ -116,14 +92,14 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
if (USB_DeviceState != DEVICE_STATE_Configured)
return;
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address);
- if (Endpoint_IsReadWriteAllowed())
+ if (Endpoint_IsOUTReceived())
{
if (MS_Device_ReadInCommandBlock(MSInterfaceInfo))
{
if (MSInterfaceInfo->State.CommandBlock.Flags & MS_COMMAND_DIR_DATA_IN)
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address);
bool SCSICommandResult = CALLBACK_MS_Device_SCSICommandReceived(MSInterfaceInfo);
@@ -141,13 +117,13 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
if (MSInterfaceInfo->State.IsMassStoreReset)
{
- Endpoint_ResetEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);
- Endpoint_ResetEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_ResetEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address);
+ Endpoint_ResetEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address);
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address);
Endpoint_ClearStall();
Endpoint_ResetDataToggle();
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address);
Endpoint_ClearStall();
Endpoint_ResetDataToggle();
@@ -159,8 +135,8 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
{
uint16_t BytesProcessed;
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);
-
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address);
+
BytesProcessed = 0;
while (Endpoint_Read_Stream_LE(&MSInterfaceInfo->State.CommandBlock,
(sizeof(MS_CommandBlockWrapper_t) - 16), &BytesProcessed) ==
@@ -175,9 +151,9 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
(MSInterfaceInfo->State.CommandBlock.Flags & 0x1F) ||
(MSInterfaceInfo->State.CommandBlock.SCSICommandLength == 0) ||
(MSInterfaceInfo->State.CommandBlock.SCSICommandLength > 16))
- {
+ {
Endpoint_StallTransaction();
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address);
Endpoint_StallTransaction();
return false;
@@ -199,7 +175,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address);
while (Endpoint_IsStalled())
{
@@ -211,7 +187,7 @@ static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInt
return;
}
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address);
while (Endpoint_IsStalled())
{
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h
index c2d536ce2..6b490eca1 100644
--- a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h
+++ b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h
@@ -81,13 +81,8 @@
{
uint8_t InterfaceNumber; /**< Interface number of the Mass Storage interface within the device. */
- uint8_t DataINEndpointNumber; /**< Endpoint number of the Mass Storage interface's IN data endpoint. */
- uint16_t DataINEndpointSize; /**< Size in bytes of the Mass Storage interface's IN data endpoint. */
- bool DataINEndpointDoubleBank; /**< Indicates if the Mass Storage interface's IN data endpoint should use double banking. */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the Mass Storage interface's OUT data endpoint. */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the Mass Storage interface's OUT data endpoint. */
- bool DataOUTEndpointDoubleBank; /**< Indicates if the Mass Storage interface's OUT data endpoint should use double banking. */
+ USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */
+ USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */
uint8_t TotalLUNs; /**< Total number of logical drives in the Mass Storage interface. */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
diff --git a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c
index f78a5abf2..e5aa40cd0 100644
--- a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c
+++ b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c
@@ -115,45 +115,18 @@ bool RNDIS_Device_ConfigureEndpoints(USB_ClassInfo_RNDIS_Device_t* const RNDISIn
{
memset(&RNDISInterfaceInfo->State, 0x00, sizeof(RNDISInterfaceInfo->State));
- for (uint8_t EndpointNum = 1; EndpointNum < ENDPOINT_TOTAL_ENDPOINTS; EndpointNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Direction;
- bool DoubleBanked;
-
- if (EndpointNum == RNDISInterfaceInfo->Config.DataINEndpointNumber)
- {
- Size = RNDISInterfaceInfo->Config.DataINEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = RNDISInterfaceInfo->Config.DataINEndpointDoubleBank;
- }
- else if (EndpointNum == RNDISInterfaceInfo->Config.DataOUTEndpointNumber)
- {
- Size = RNDISInterfaceInfo->Config.DataOUTEndpointSize;
- Direction = ENDPOINT_DIR_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = RNDISInterfaceInfo->Config.DataOUTEndpointDoubleBank;
- }
- else if (EndpointNum == RNDISInterfaceInfo->Config.NotificationEndpointNumber)
- {
- Size = RNDISInterfaceInfo->Config.NotificationEndpointSize;
- Direction = ENDPOINT_DIR_IN;
- Type = EP_TYPE_INTERRUPT;
- DoubleBanked = RNDISInterfaceInfo->Config.NotificationEndpointDoubleBank;
- }
- else
- {
- continue;
- }
-
- if (!(Endpoint_ConfigureEndpoint(EndpointNum, Type, Direction, Size,
- DoubleBanked ? ENDPOINT_BANK_DOUBLE : ENDPOINT_BANK_SINGLE)))
- {
- return false;
- }
- }
+ RNDISInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_BULK;
+ RNDISInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK;
+ RNDISInterfaceInfo->Config.NotificationEndpoint.Type = EP_TYPE_INTERRUPT;
+
+ if (!(Endpoint_ConfigureEndpointTable(&RNDISInterfaceInfo->Config.DataINEndpoint, 1)))
+ return false;
+
+ if (!(Endpoint_ConfigureEndpointTable(&RNDISInterfaceInfo->Config.DataOUTEndpoint, 1)))
+ return false;
+
+ if (!(Endpoint_ConfigureEndpointTable(&RNDISInterfaceInfo->Config.NotificationEndpoint, 1)))
+ return false;
return true;
}
@@ -163,7 +136,7 @@ void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo
if (USB_DeviceState != DEVICE_STATE_Configured)
return;
- Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.NotificationEndpointNumber);
+ Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.NotificationEndpoint.Address);
if (Endpoint_IsINReady() && RNDISInterfaceInfo->State.ResponseReady)
{
@@ -454,7 +427,7 @@ bool RNDIS_Device_IsPacketReceived(USB_ClassInfo_RNDIS_Device_t* const RNDISInte
return false;
}
- Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpoint.Address);
return Endpoint_IsOUTReceived();
}
@@ -468,7 +441,7 @@ uint8_t RNDIS_Device_ReadPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfa
return ENDPOINT_RWSTREAM_DeviceDisconnected;
}
- Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpointNumber);
+ Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpoint.Address);
*PacketLength = 0;
@@ -505,7 +478,7 @@ uint8_t RNDIS_Device_SendPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfa
return ENDPOINT_RWSTREAM_DeviceDisconnected;
}
- Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataINEndpointNumber);
+ Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataINEndpoint.Address);
if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError)
return ErrorCode;
diff --git a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h
index ccd20e38e..33b807da9 100644
--- a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h
+++ b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h
@@ -81,17 +81,9 @@
{
uint8_t ControlInterfaceNumber; /**< Interface number of the RNDIS control interface within the device. */
- uint8_t DataINEndpointNumber; /**< Endpoint number of the RNDIS interface's IN data endpoint. */
- uint16_t DataINEndpointSize; /**< Size in bytes of the RNDIS interface's IN data endpoint. */
- bool DataINEndpointDoubleBank; /**< Indicates if the RNDIS interface's IN data endpoint should use double banking. */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the RNDIS interface's OUT data endpoint. */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the RNDIS interface's OUT data endpoint. */
- bool DataOUTEndpointDoubleBank; /**< Indicates if the RNDIS interface's OUT data endpoint should use double banking. */
-
- uint8_t NotificationEndpointNumber; /**< Endpoint number of the RNDIS interface's IN notification endpoint, if used. */
- uint16_t NotificationEndpointSize; /**< Size in bytes of the RNDIS interface's IN notification endpoint, if used. */
- bool NotificationEndpointDoubleBank; /**< Indicates if the RNDIS interface's notification endpoint should use double banking. */
+ USB_Endpoint_Table_t DataINEndpoint; /**< Data IN endpoint configuration table. */
+ USB_Endpoint_Table_t DataOUTEndpoint; /**< Data OUT endpoint configuration table. */
+ USB_Endpoint_Table_t NotificationEndpoint; /**< Notification IN Endpoint configuration table. */
char* AdapterVendorDescription; /**< String description of the adapter vendor. */
MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter. */
diff --git a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c
index eb4c2530d..7c564e012 100644
--- a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c
@@ -89,45 +89,19 @@ uint8_t AOA_Host_ConfigurePipes(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo
DataOUTEndpoint = EndpointData;
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- bool DoubleBanked;
-
- if (PipeNum == AOAInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = le16_to_cpu(DataINEndpoint->EndpointSize);
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = AOAInterfaceInfo->Config.DataINPipeDoubleBank;
-
- AOAInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == AOAInterfaceInfo->Config.DataOUTPipeNumber)
- {
- Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = AOAInterfaceInfo->Config.DataOUTPipeDoubleBank;
-
- AOAInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return AOA_ENUMERROR_PipeConfigurationFailed;
- }
- }
+ AOAInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ AOAInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ AOAInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK;
+
+ AOAInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ AOAInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ AOAInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
+
+ if (!(Pipe_ConfigurePipeTable(&AOAInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&AOAInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
AOAInterfaceInfo->State.IsActive = true;
AOAInterfaceInfo->State.InterfaceNumber = AOAInterface->InterfaceNumber;
@@ -260,7 +234,7 @@ uint8_t AOA_Host_SendData(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(AOAInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(AOAInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
ErrorCode = Pipe_Write_Stream_LE(Buffer, Length, NULL);
@@ -277,7 +251,7 @@ uint8_t AOA_Host_SendString(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(AOAInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(AOAInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
ErrorCode = Pipe_Write_Stream_LE(String, strlen(String), NULL);
@@ -294,7 +268,7 @@ uint8_t AOA_Host_SendByte(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(AOAInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(AOAInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (!(Pipe_IsReadWriteAllowed()))
@@ -316,7 +290,7 @@ uint16_t AOA_Host_BytesReceived(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo
if ((USB_HostState != HOST_STATE_Configured) || !(AOAInterfaceInfo->State.IsActive))
return 0;
- Pipe_SelectPipe(AOAInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(AOAInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsINReceived())
@@ -348,7 +322,7 @@ int16_t AOA_Host_ReceiveByte(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo)
int16_t ReceivedByte = -1;
- Pipe_SelectPipe(AOAInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(AOAInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsINReceived())
@@ -372,7 +346,7 @@ uint8_t AOA_Host_Flush(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo)
uint8_t ErrorCode;
- Pipe_SelectPipe(AOAInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(AOAInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (!(Pipe_BytesInPipe()))
diff --git a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h
index 0ec44e715..678feda45 100644
--- a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h
@@ -85,11 +85,8 @@
{
struct
{
- uint8_t DataINPipeNumber; /**< Pipe number of the AOA interface's IN data pipe. */
- bool DataINPipeDoubleBank; /**< Indicates if the AOA interface's IN data pipe should use double banking. */
-
- uint8_t DataOUTPipeNumber; /**< Pipe number of the AOA interface's OUT data pipe. */
- bool DataOUTPipeDoubleBank; /**< Indicates if the AOA interface's OUT data pipe should use double banking. */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
char* PropertyStrings[AOA_STRING_TOTAL_STRINGS]; /**< Android Accessory property strings, sent to identify the accessory when the
* Android device is switched into Open Accessory mode. */
@@ -103,9 +100,6 @@
* Configured state.
*/
uint8_t InterfaceNumber; /**< Interface index of the AOA interface within the attached device. */
-
- uint16_t DataINPipeSize; /**< Size in bytes of the AOA interface's IN data pipe. */
- uint16_t DataOUTPipeSize; /**< Size in bytes of the AOA interface's OUT data pipe. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* the interface is enumerated.
diff --git a/LUFA/Drivers/USB/Class/Host/AudioClassHost.c b/LUFA/Drivers/USB/Class/Host/AudioClassHost.c
index e5591ec1d..12783a6a0 100644
--- a/LUFA/Drivers/USB/Class/Host/AudioClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/AudioClassHost.c
@@ -51,8 +51,8 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa
if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
return AUDIO_ENUMERROR_InvalidConfigDescriptor;
- while ((AudioInterfaceInfo->Config.DataINPipeNumber && !(DataINEndpoint)) ||
- (AudioInterfaceInfo->Config.DataOUTPipeNumber && !(DataOUTEndpoint)))
+ while ((AudioInterfaceInfo->Config.DataINPipe.Address && !(DataINEndpoint)) ||
+ (AudioInterfaceInfo->Config.DataOUTPipe.Address && !(DataOUTEndpoint)))
{
if (!(AudioControlInterface) ||
USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
@@ -93,45 +93,21 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa
DataOUTEndpoint = EndpointData;
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- bool DoubleBanked;
-
- if (PipeNum == AudioInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = le16_to_cpu(DataINEndpoint->EndpointSize);
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_ISOCHRONOUS;
- DoubleBanked = true;
-
- AudioInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == AudioInterfaceInfo->Config.DataOUTPipeNumber)
- {
- Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_ISOCHRONOUS;
- DoubleBanked = true;
-
- AudioInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return AUDIO_ENUMERROR_PipeConfigurationFailed;
- }
- }
+ AudioInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ AudioInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ AudioInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_ISOCHRONOUS;
+ AudioInterfaceInfo->Config.DataINPipe.Banks = 2;
+
+ AudioInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ AudioInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ AudioInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_ISOCHRONOUS;
+ AudioInterfaceInfo->Config.DataOUTPipe.Banks = 2;
+
+ if (!(Pipe_ConfigurePipeTable(&AudioInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&AudioInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
AudioInterfaceInfo->State.ControlInterfaceNumber = AudioControlInterface->InterfaceNumber;
AudioInterfaceInfo->State.StreamingInterfaceNumber = AudioStreamingInterface->InterfaceNumber;
diff --git a/LUFA/Drivers/USB/Class/Host/AudioClassHost.h b/LUFA/Drivers/USB/Class/Host/AudioClassHost.h
index a6e425d5f..2d39aa9ca 100644
--- a/LUFA/Drivers/USB/Class/Host/AudioClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/AudioClassHost.h
@@ -79,14 +79,8 @@
{
struct
{
- uint8_t DataINPipeNumber; /**< Pipe number of the Audio interface's IN data pipe. If this interface should not
- * bind to an IN endpoint, this may be set to 0 to disable audio input streaming for
- * this driver instance.
- */
- uint8_t DataOUTPipeNumber; /**< Pipe number of the Audio interface's OUT data pipe. If this interface should not
- * bind to an OUT endpoint, this may be set to 0 to disable audio output streaming for
- * this driver instance.
- */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
} 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.
*/
@@ -100,9 +94,6 @@
uint8_t StreamingInterfaceNumber; /**< Interface index of the Audio Streaming interface within the attached device. */
uint8_t EnabledStreamingAltIndex; /**< Alternative setting index of the Audio Streaming interface when the stream is enabled. */
-
- uint16_t DataINPipeSize; /**< Size in bytes of the Audio interface's IN data pipe. */
- uint16_t DataOUTPipeSize; /**< Size in bytes of the Audio interface's OUT data pipe. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* the interface is enumerated.
@@ -201,7 +192,7 @@
bool SampleReceived = false;
- Pipe_SelectPipe(AudioInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(AudioInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
SampleReceived = Pipe_IsINReceived();
Pipe_Freeze();
@@ -226,7 +217,7 @@
if ((USB_HostState != HOST_STATE_Configured) || !(AudioInterfaceInfo->State.IsActive))
return false;
- Pipe_SelectPipe(AudioInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(AudioInterfaceInfo->Config.DataOUTPipe.Address);
return Pipe_IsOUTReady();
}
diff --git a/LUFA/Drivers/USB/Class/Host/CDCClassHost.c b/LUFA/Drivers/USB/Class/Host/CDCClassHost.c
index 63df6b0c5..8c79e9c22 100644
--- a/LUFA/Drivers/USB/Class/Host/CDCClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/CDCClassHost.c
@@ -99,62 +99,26 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
}
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- uint8_t InterruptPeriod;
- bool DoubleBanked;
-
- if (PipeNum == CDCInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = le16_to_cpu(DataINEndpoint->EndpointSize);
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = CDCInterfaceInfo->Config.DataINPipeDoubleBank;
- InterruptPeriod = 0;
-
- CDCInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == CDCInterfaceInfo->Config.DataOUTPipeNumber)
- {
- Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = CDCInterfaceInfo->Config.DataOUTPipeDoubleBank;
- InterruptPeriod = 0;
-
- CDCInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- }
- else if (PipeNum == CDCInterfaceInfo->Config.NotificationPipeNumber)
- {
- Size = le16_to_cpu(NotificationEndpoint->EndpointSize);
- EndpointAddress = NotificationEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_INTERRUPT;
- DoubleBanked = CDCInterfaceInfo->Config.NotificationPipeDoubleBank;
- InterruptPeriod = NotificationEndpoint->PollingIntervalMS;
-
- CDCInterfaceInfo->State.NotificationPipeSize = NotificationEndpoint->EndpointSize;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return CDC_ENUMERROR_PipeConfigurationFailed;
- }
-
- if (InterruptPeriod)
- Pipe_SetInterruptPeriod(InterruptPeriod);
- }
+ CDCInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ CDCInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ CDCInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK;
+
+ CDCInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ CDCInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ CDCInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
+
+ CDCInterfaceInfo->Config.NotificationPipe.Size = le16_to_cpu(NotificationEndpoint->EndpointSize);
+ CDCInterfaceInfo->Config.NotificationPipe.EndpointAddress = NotificationEndpoint->EndpointAddress;
+ CDCInterfaceInfo->Config.NotificationPipe.Type = EP_TYPE_INTERRUPT;
+
+ if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.NotificationPipe, 1)))
+ return false;
CDCInterfaceInfo->State.ControlInterfaceNumber = CDCControlInterface->InterfaceNumber;
CDCInterfaceInfo->State.ControlLineStates.HostToDevice = (CDC_CONTROL_LINE_OUT_RTS | CDC_CONTROL_LINE_OUT_DTR);
@@ -231,7 +195,7 @@ void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.NotificationPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.NotificationPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsINReceived())
@@ -321,7 +285,7 @@ uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
ErrorCode = Pipe_Write_Stream_LE(Buffer, Length, NULL);
@@ -338,7 +302,7 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
ErrorCode = Pipe_Write_Stream_LE(String, strlen(String), NULL);
@@ -355,7 +319,7 @@ uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (!(Pipe_IsReadWriteAllowed()))
@@ -377,7 +341,7 @@ uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return 0;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsINReceived())
@@ -409,7 +373,7 @@ int16_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
int16_t ReceivedByte = -1;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsINReceived())
@@ -433,7 +397,7 @@ uint8_t CDC_Host_Flush(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
uint8_t ErrorCode;
- Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (!(Pipe_BytesInPipe()))
diff --git a/LUFA/Drivers/USB/Class/Host/CDCClassHost.h b/LUFA/Drivers/USB/Class/Host/CDCClassHost.h
index 5a8df2414..4d79ed951 100644
--- a/LUFA/Drivers/USB/Class/Host/CDCClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/CDCClassHost.h
@@ -81,14 +81,9 @@
{
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. */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
+ USB_Pipe_Table_t NotificationPipe; /**< Notification IN Pipe configuration table. */
} 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.
*/
@@ -100,10 +95,6 @@
*/
uint8_t ControlInterfaceNumber; /**< Interface index of the CDC-ACM control interface within the attached device. */
- uint16_t DataINPipeSize; /**< Size in bytes of the CDC interface's IN data pipe. */
- uint16_t DataOUTPipeSize; /**< Size in bytes of the CDC interface's OUT data pipe. */
- uint16_t NotificationPipeSize; /**< Size in bytes of the CDC interface's IN notification pipe, if used. */
-
struct
{
uint16_t HostToDevice; /**< Control line states from the host to device, as a set of \c CDC_CONTROL_LINE_OUT_*
diff --git a/LUFA/Drivers/USB/Class/Host/HIDClassHost.c b/LUFA/Drivers/USB/Class/Host/HIDClassHost.c
index f51bdf74f..dad6a5afc 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/HIDClassHost.c
@@ -94,55 +94,19 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
DataOUTEndpoint = EndpointData;
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- uint8_t InterruptPeriod;
- bool DoubleBanked;
-
- if (PipeNum == HIDInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = le16_to_cpu(DataINEndpoint->EndpointSize);
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_INTERRUPT;
- DoubleBanked = HIDInterfaceInfo->Config.DataINPipeDoubleBank;
- InterruptPeriod = DataINEndpoint->PollingIntervalMS;
-
- HIDInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == HIDInterfaceInfo->Config.DataOUTPipeNumber)
- {
- if (DataOUTEndpoint == NULL)
- continue;
-
- Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_INTERRUPT;
- DoubleBanked = HIDInterfaceInfo->Config.DataOUTPipeDoubleBank;
- InterruptPeriod = DataOUTEndpoint->PollingIntervalMS;
-
- HIDInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- HIDInterfaceInfo->State.DeviceUsesOUTPipe = true;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return HID_ENUMERROR_PipeConfigurationFailed;
- }
-
- if (InterruptPeriod)
- Pipe_SetInterruptPeriod(InterruptPeriod);
- }
+ HIDInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ HIDInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ HIDInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_INTERRUPT;
+
+ HIDInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ HIDInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ HIDInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_INTERRUPT;
+
+ if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber;
HIDInterfaceInfo->State.HIDReportSize = LE16_TO_CPU(HIDDescriptor->HIDReportLength);
@@ -227,7 +191,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(HIDInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(HIDInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
uint16_t ReportSize;
@@ -277,7 +241,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
{
uint8_t ErrorCode;
- Pipe_SelectPipe(HIDInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(HIDInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (ReportID)
@@ -320,7 +284,7 @@ bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)
bool ReportReceived;
- Pipe_SelectPipe(HIDInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(HIDInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
ReportReceived = Pipe_IsINReceived();
diff --git a/LUFA/Drivers/USB/Class/Host/HIDClassHost.h b/LUFA/Drivers/USB/Class/Host/HIDClassHost.h
index 7bdaad18b..882cc31df 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/HIDClassHost.h
@@ -83,11 +83,8 @@
{
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. */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
uint8_t HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific
* boot subclass protocol is required, a protocol value from the
@@ -112,9 +109,6 @@
*/
uint8_t InterfaceNumber; /**< Interface index of the HID interface within the attached device. */
- uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe. */
- uint16_t DataOUTPipeSize; /**< Size in bytes of the HID interface's OUT data pipe. */
-
bool SupportsBootProtocol; /**< Indicates if the current interface instance supports the HID Boot
* Protocol when enabled via \ref HID_Host_SetBootProtocol().
*/
diff --git a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c
index 5aadbcc7f..0d33bfec4 100644
--- a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c
@@ -78,45 +78,19 @@ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceI
DataOUTEndpoint = EndpointData;
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- bool DoubleBanked;
-
- if (PipeNum == MIDIInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = le16_to_cpu(DataINEndpoint->EndpointSize);
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = MIDIInterfaceInfo->Config.DataINPipeDoubleBank;
-
- MIDIInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == MIDIInterfaceInfo->Config.DataOUTPipeNumber)
- {
- Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = MIDIInterfaceInfo->Config.DataOUTPipeDoubleBank;
-
- MIDIInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return MIDI_ENUMERROR_PipeConfigurationFailed;
- }
- }
+ MIDIInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ MIDIInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ MIDIInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK;
+
+ MIDIInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ MIDIInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ MIDIInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
+
+ if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
MIDIInterfaceInfo->State.InterfaceNumber = MIDIInterface->InterfaceNumber;
MIDIInterfaceInfo->State.IsActive = true;
@@ -181,7 +155,7 @@ uint8_t MIDI_Host_Flush(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)
uint8_t ErrorCode;
- Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipe.Address);
if (Pipe_BytesInPipe())
{
@@ -202,7 +176,7 @@ uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface
uint8_t ErrorCode;
- Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipe.Address);
if ((ErrorCode = Pipe_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
@@ -219,7 +193,7 @@ bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface
if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive))
return HOST_SENDCONTROL_DeviceDisconnected;
- Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataINPipe.Address);
if (!(Pipe_IsReadWriteAllowed()))
return false;
diff --git a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h
index e934ddacb..b9e861143 100644
--- a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h
@@ -79,11 +79,8 @@
{
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. */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
} 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.
*/
@@ -94,9 +91,6 @@
* Configured state.
*/
uint8_t InterfaceNumber; /**< Interface index of the MIDI interface within the attached device. */
-
- uint16_t DataINPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's IN data pipe. */
- uint16_t DataOUTPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's OUT data pipe. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* the interface is enumerated.
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c
index 24b4edc76..f145881fd 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c
@@ -78,45 +78,19 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
DataOUTEndpoint = EndpointData;
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- bool DoubleBanked;
-
- if (PipeNum == MSInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = le16_to_cpu(DataINEndpoint->EndpointSize);
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = MSInterfaceInfo->Config.DataINPipeDoubleBank;
-
- MSInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == MSInterfaceInfo->Config.DataOUTPipeNumber)
- {
- Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = MSInterfaceInfo->Config.DataOUTPipeDoubleBank;
-
- MSInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return MS_ENUMERROR_PipeConfigurationFailed;
- }
- }
+ MSInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ MSInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ MSInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK;
+
+ MSInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ MSInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ MSInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
+
+ if (!(Pipe_ConfigurePipeTable(&MSInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&MSInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
MSInterfaceInfo->State.InterfaceNumber = MassStorageInterface->InterfaceNumber;
MSInterfaceInfo->State.IsActive = true;
@@ -178,7 +152,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
SCSICommandBlock->Signature = CPU_TO_LE32(MS_CBW_SIGNATURE);
SCSICommandBlock->Tag = cpu_to_le32(MSInterfaceInfo->State.TransactionTag);
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if ((ErrorCode = Pipe_Write_Stream_LE(SCSICommandBlock, sizeof(MS_CommandBlockWrapper_t),
@@ -212,7 +186,7 @@ static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInte
uint16_t TimeoutMSRem = MS_COMMAND_DATA_TIMEOUT_MS;
uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber();
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
while (!(Pipe_IsINReceived()))
@@ -228,7 +202,7 @@ static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInte
}
Pipe_Freeze();
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsStalled())
@@ -238,7 +212,7 @@ static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInte
}
Pipe_Freeze();
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsStalled())
@@ -251,10 +225,10 @@ static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInte
return PIPE_RWSTREAM_DeviceDisconnected;
};
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipe.Address);
Pipe_Freeze();
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Freeze();
return PIPE_RWSTREAM_NoError;
@@ -275,7 +249,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfac
return ErrorCode;
}
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem, NULL)) != PIPE_RWSTREAM_NoError)
@@ -285,7 +259,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfac
}
else
{
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem, NULL)) != PIPE_RWSTREAM_NoError)
@@ -313,7 +287,7 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* const MSInterf
if ((ErrorCode = MS_Host_WaitForDataReceived(MSInterfaceInfo)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t),
@@ -349,12 +323,12 @@ uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipe.Address);
if ((ErrorCode = USB_Host_ClearEndpointStall(Pipe_GetBoundEndpointAddress())) != HOST_SENDCONTROL_Successful)
return ErrorCode;
- Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipe.Address);
if ((ErrorCode = USB_Host_ClearEndpointStall(Pipe_GetBoundEndpointAddress())) != HOST_SENDCONTROL_Successful)
return ErrorCode;
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h
index 25d7e1e5e..a8763dd5b 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h
@@ -83,11 +83,8 @@
{
struct
{
- 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. */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
} 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.
*/
@@ -99,9 +96,6 @@
*/
uint8_t InterfaceNumber; /**< Interface index of the Mass Storage interface within the attached device. */
- 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 synchronizing of packets. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
diff --git a/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c b/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c
index 379ccb01c..dd33b115b 100644
--- a/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c
@@ -78,45 +78,19 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
DataOUTEndpoint = EndpointData;
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- bool DoubleBanked;
-
- if (PipeNum == PRNTInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = le16_to_cpu(DataINEndpoint->EndpointSize);
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = PRNTInterfaceInfo->Config.DataINPipeDoubleBank;
-
- PRNTInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == PRNTInterfaceInfo->Config.DataOUTPipeNumber)
- {
- Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = PRNTInterfaceInfo->Config.DataOUTPipeDoubleBank;
-
- PRNTInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return PRNT_ENUMERROR_PipeConfigurationFailed;
- }
- }
+ PRNTInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ PRNTInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ PRNTInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK;
+
+ PRNTInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ PRNTInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ PRNTInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
+
+ if (!(Pipe_ConfigurePipeTable(&PRNTInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&PRNTInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
PRNTInterfaceInfo->State.InterfaceNumber = PrinterInterface->InterfaceNumber;
PRNTInterfaceInfo->State.AlternateSetting = PrinterInterface->AlternateSetting;
@@ -229,7 +203,7 @@ uint8_t PRNT_Host_Flush(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
uint8_t ErrorCode;
- Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (!(Pipe_BytesInPipe()))
@@ -260,7 +234,7 @@ uint8_t PRNT_Host_SendByte(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
uint8_t ErrorCode;
- Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (!(Pipe_IsReadWriteAllowed()))
@@ -285,7 +259,7 @@ uint8_t PRNT_Host_SendString(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
if ((USB_HostState != HOST_STATE_Configured) || !(PRNTInterfaceInfo->State.IsActive))
return PIPE_RWSTREAM_DeviceDisconnected;
- Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if ((ErrorCode = Pipe_Write_Stream_LE(String, strlen(String), NULL)) != PIPE_RWSTREAM_NoError)
@@ -309,7 +283,7 @@ uint8_t PRNT_Host_SendData(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
if ((USB_HostState != HOST_STATE_Configured) || !(PRNTInterfaceInfo->State.IsActive))
return PIPE_RWSTREAM_DeviceDisconnected;
- Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if ((ErrorCode = Pipe_Write_Stream_LE(Buffer, Length, NULL)) != PIPE_RWSTREAM_NoError)
@@ -329,7 +303,7 @@ uint16_t PRNT_Host_BytesReceived(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
if ((USB_HostState != HOST_STATE_Configured) || !(PRNTInterfaceInfo->State.IsActive))
return 0;
- Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsINReceived())
@@ -361,7 +335,7 @@ int16_t PRNT_Host_ReceiveByte(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo
int16_t ReceivedByte = -1;
- Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsINReceived())
diff --git a/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h b/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h
index c8c997f74..25878276f 100644
--- a/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h
@@ -79,11 +79,8 @@
{
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. */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
} 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.
*/
@@ -95,9 +92,6 @@
*/
uint8_t InterfaceNumber; /**< Interface index of the Printer interface within the attached device. */
uint8_t AlternateSetting; /**< Alternate setting within the Printer Interface in the attached device. */
-
- uint16_t DataINPipeSize; /**< Size in bytes of the Printer interface's IN data pipe. */
- uint16_t DataOUTPipeSize; /**< Size in bytes of the Printer interface's OUT data pipe. */
} State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* the interface is enumerated.
diff --git a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c
index a03011d64..e457b5dff 100644
--- a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c
@@ -101,62 +101,26 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa
}
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- uint8_t InterruptPeriod;
- bool DoubleBanked;
-
- if (PipeNum == RNDISInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = le16_to_cpu(DataINEndpoint->EndpointSize);
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = RNDISInterfaceInfo->Config.DataINPipeDoubleBank;
- InterruptPeriod = 0;
-
- RNDISInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == RNDISInterfaceInfo->Config.DataOUTPipeNumber)
- {
- Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = RNDISInterfaceInfo->Config.DataOUTPipeDoubleBank;
- InterruptPeriod = 0;
-
- RNDISInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- }
- else if (PipeNum == RNDISInterfaceInfo->Config.NotificationPipeNumber)
- {
- Size = le16_to_cpu(NotificationEndpoint->EndpointSize);
- EndpointAddress = NotificationEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_INTERRUPT;
- DoubleBanked = RNDISInterfaceInfo->Config.NotificationPipeDoubleBank;
- InterruptPeriod = NotificationEndpoint->PollingIntervalMS;
-
- RNDISInterfaceInfo->State.NotificationPipeSize = NotificationEndpoint->EndpointSize;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return CDC_ENUMERROR_PipeConfigurationFailed;
- }
+ RNDISInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ RNDISInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ RNDISInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK;
+
+ RNDISInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ RNDISInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ RNDISInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
+
+ RNDISInterfaceInfo->Config.NotificationPipe.Size = le16_to_cpu(NotificationEndpoint->EndpointSize);
+ RNDISInterfaceInfo->Config.NotificationPipe.EndpointAddress = NotificationEndpoint->EndpointAddress;
+ RNDISInterfaceInfo->Config.NotificationPipe.Type = EP_TYPE_INTERRUPT;
+
+ if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
- if (InterruptPeriod)
- Pipe_SetInterruptPeriod(InterruptPeriod);
- }
+ if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.NotificationPipe, 1)))
+ return false;
RNDISInterfaceInfo->State.ControlInterfaceNumber = RNDISControlInterface->InterfaceNumber;
RNDISInterfaceInfo->State.IsActive = true;
@@ -419,7 +383,7 @@ bool RNDIS_Host_IsPacketReceived(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfac
if ((USB_HostState != HOST_STATE_Configured) || !(RNDISInterfaceInfo->State.IsActive))
return false;
- Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
PacketWaiting = Pipe_IsINReceived();
@@ -437,7 +401,7 @@ uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceIn
if ((USB_HostState != HOST_STATE_Configured) || !(RNDISInterfaceInfo->State.IsActive))
return PIPE_READYWAIT_DeviceDisconnected;
- Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (!(Pipe_IsReadWriteAllowed()))
@@ -491,7 +455,7 @@ uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceIn
DeviceMessage.DataOffset = CPU_TO_LE32(sizeof(RNDIS_Packet_Message_t) - sizeof(RNDIS_Message_Header_t));
DeviceMessage.DataLength = cpu_to_le32(PacketLength);
- Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(RNDISInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if ((ErrorCode = Pipe_Write_Stream_LE(&DeviceMessage, sizeof(RNDIS_Packet_Message_t),
diff --git a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h
index 085bde22c..57087edf9 100644
--- a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h
@@ -80,14 +80,9 @@
{
struct
{
- uint8_t DataINPipeNumber; /**< Pipe number of the RNDIS interface's IN data pipe. */
- bool DataINPipeDoubleBank; /**< Indicates if the RNDIS interface's IN data pipe should use double banking. */
-
- uint8_t DataOUTPipeNumber; /**< Pipe number of the RNDIS interface's OUT data pipe. */
- bool DataOUTPipeDoubleBank; /**< Indicates if the RNDIS interface's OUT data pipe should use double banking. */
-
- uint8_t NotificationPipeNumber; /**< Pipe number of the RNDIS interface's IN notification endpoint, if used. */
- bool NotificationPipeDoubleBank; /**< Indicates if the RNDIS interface's notification pipe should use double banking. */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
+ USB_Pipe_Table_t NotificationPipe; /**< Notification IN Pipe configuration table. */
uint32_t HostMaxPacketSize; /**< Maximum size of a packet which can be buffered by the host. */
} Config; /**< Config data for the USB class interface within the device. All elements in this section
@@ -101,10 +96,6 @@
*/
uint8_t ControlInterfaceNumber; /**< Interface index of the RNDIS control interface within the attached device. */
- uint16_t DataINPipeSize; /**< Size in bytes of the RNDIS interface's IN data pipe. */
- uint16_t DataOUTPipeSize; /**< Size in bytes of the RNDIS interface's OUT data pipe. */
- uint16_t NotificationPipeSize; /**< Size in bytes of the RNDIS interface's IN notification pipe, if used. */
-
uint32_t DeviceMaxPacketSize; /**< Maximum size of a packet which can be buffered by the attached RNDIS device. */
uint32_t RequestID; /**< Request ID counter to give a unique ID for each command/response pair. */
diff --git a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c
index 2b5514a28..5c18d7503 100644
--- a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c
@@ -87,63 +87,27 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
}
}
- for (uint8_t PipeNum = 1; PipeNum < PIPE_TOTAL_PIPES; PipeNum++)
- {
- uint16_t Size;
- uint8_t Type;
- uint8_t Token;
- uint8_t EndpointAddress;
- uint8_t InterruptPeriod;
- bool DoubleBanked;
-
- if (PipeNum == SIInterfaceInfo->Config.DataINPipeNumber)
- {
- Size = DataINEndpoint->EndpointSize;
- EndpointAddress = DataINEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_BULK;
- DoubleBanked = SIInterfaceInfo->Config.DataINPipeDoubleBank;
- InterruptPeriod = 0;
-
- SIInterfaceInfo->State.DataINPipeSize = DataINEndpoint->EndpointSize;
- }
- else if (PipeNum == SIInterfaceInfo->Config.DataOUTPipeNumber)
- {
- Size = DataOUTEndpoint->EndpointSize;
- EndpointAddress = DataOUTEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_OUT;
- Type = EP_TYPE_BULK;
- DoubleBanked = SIInterfaceInfo->Config.DataOUTPipeDoubleBank;
- InterruptPeriod = 0;
-
- SIInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize;
- }
- else if (PipeNum == SIInterfaceInfo->Config.EventsPipeNumber)
- {
- Size = EventsEndpoint->EndpointSize;
- EndpointAddress = EventsEndpoint->EndpointAddress;
- Token = PIPE_TOKEN_IN;
- Type = EP_TYPE_INTERRUPT;
- DoubleBanked = SIInterfaceInfo->Config.EventsPipeDoubleBank;
- InterruptPeriod = EventsEndpoint->PollingIntervalMS;
-
- SIInterfaceInfo->State.EventsPipeSize = EventsEndpoint->EndpointSize;
- }
- else
- {
- continue;
- }
-
- if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size,
- DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE)))
- {
- return SI_ENUMERROR_PipeConfigurationFailed;
- }
-
- if (InterruptPeriod)
- Pipe_SetInterruptPeriod(InterruptPeriod);
- }
+ SIInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
+ SIInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
+ SIInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK;
+
+ SIInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
+ SIInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
+ SIInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
+
+ SIInterfaceInfo->Config.EventsPipe.Size = le16_to_cpu(EventsEndpoint->EndpointSize);
+ SIInterfaceInfo->Config.EventsPipe.EndpointAddress = EventsEndpoint->EndpointAddress;
+ SIInterfaceInfo->Config.EventsPipe.Type = EP_TYPE_INTERRUPT;
+
+ if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.DataINPipe, 1)))
+ return false;
+
+ if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.DataOUTPipe, 1)))
+ return false;
+ if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.EventsPipe, 1)))
+ return false;
+
SIInterfaceInfo->State.InterfaceNumber = StillImageInterface->InterfaceNumber;
SIInterfaceInfo->State.IsActive = true;
@@ -204,7 +168,7 @@ uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
if (SIInterfaceInfo->State.IsSessionOpen)
PIMAHeader->TransactionID = cpu_to_le32(SIInterfaceInfo->State.TransactionID++);
- Pipe_SelectPipe(SIInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(SIInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if ((ErrorCode = Pipe_Write_Stream_LE(PIMAHeader, PIMA_COMMAND_SIZE(0), NULL)) != PIPE_RWSTREAM_NoError)
@@ -233,7 +197,7 @@ uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return PIPE_RWSTREAM_DeviceDisconnected;
- Pipe_SelectPipe(SIInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(SIInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
while (!(Pipe_IsINReceived()))
@@ -249,7 +213,7 @@ uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
}
Pipe_Freeze();
- Pipe_SelectPipe(SIInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(SIInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsStalled())
@@ -259,7 +223,7 @@ uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
}
Pipe_Freeze();
- Pipe_SelectPipe(SIInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(SIInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
if (Pipe_IsStalled())
@@ -298,7 +262,7 @@ uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return PIPE_RWSTREAM_DeviceDisconnected;
- Pipe_SelectPipe(SIInterfaceInfo->Config.DataOUTPipeNumber);
+ Pipe_SelectPipe(SIInterfaceInfo->Config.DataOUTPipe.Address);
Pipe_Unfreeze();
ErrorCode = Pipe_Write_Stream_LE(Buffer, Bytes, NULL);
@@ -318,7 +282,7 @@ uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return PIPE_RWSTREAM_DeviceDisconnected;
- Pipe_SelectPipe(SIInterfaceInfo->Config.DataINPipeNumber);
+ Pipe_SelectPipe(SIInterfaceInfo->Config.DataINPipe.Address);
Pipe_Unfreeze();
ErrorCode = Pipe_Read_Stream_LE(Buffer, Bytes, NULL);
@@ -335,7 +299,7 @@ bool SI_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return false;
- Pipe_SelectPipe(SIInterfaceInfo->Config.EventsPipeNumber);
+ Pipe_SelectPipe(SIInterfaceInfo->Config.EventsPipe.Address);
Pipe_Unfreeze();
if (Pipe_BytesInPipe())
@@ -354,7 +318,7 @@ uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return PIPE_RWSTREAM_DeviceDisconnected;
- Pipe_SelectPipe(SIInterfaceInfo->Config.EventsPipeNumber);
+ Pipe_SelectPipe(SIInterfaceInfo->Config.EventsPipe.Address);
Pipe_Unfreeze();
ErrorCode = Pipe_Read_Stream_LE(PIMAHeader, sizeof(PIMA_Container_t), NULL);
diff --git a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h
index 4cda70d2e..be616b459 100644
--- a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h
+++ b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h
@@ -83,14 +83,9 @@
{
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. */
+ USB_Pipe_Table_t DataINPipe; /**< Data IN Pipe configuration table. */
+ USB_Pipe_Table_t DataOUTPipe; /**< Data OUT Pipe configuration table. */
+ USB_Pipe_Table_t EventsPipe; /**< Event notification IN Pipe configuration table. */
} 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.
*/
@@ -102,10 +97,6 @@
*/
uint8_t InterfaceNumber; /**< Interface index of the Still Image interface within the attached device. */
- uint16_t DataINPipeSize; /**< Size in bytes of the Still Image interface's IN data pipe. */
- uint16_t DataOUTPipeSize; /**< Size in bytes of the Still Image interface's OUT data pipe. */
- uint16_t EventsPipeSize; /**< Size in bytes of the Still Image interface's IN events pipe. */
-
bool IsSessionOpen; /**< Indicates if a PIMA session is currently open with the attached device. */
uint32_t TransactionID; /**< Transaction ID for the next transaction to send to the device. */
} State; /**< State data for the USB class interface within the device. All elements in this section
diff --git a/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c
index bcf904d99..4440b7631 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c
+++ b/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c
@@ -42,6 +42,21 @@
uint8_t USB_Device_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;
#endif
+bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table,
+ const uint8_t Entries)
+{
+ for (uint8_t i = 0; i < Entries; i++)
+ {
+ if (!(Table[i].Address))
+ continue;
+
+ if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks)))
+ return false;
+ }
+
+ return true;
+}
+
bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
const uint8_t UECFG0XData,
const uint8_t UECFG1XData)
diff --git a/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h b/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h
index 10f69a8fd..37ff220e3 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h
+++ b/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h
@@ -89,35 +89,6 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
- /* Macros: */
- #define _ENDPOINT_GET_MAXSIZE(EPIndex) _ENDPOINT_GET_MAXSIZE2(ENDPOINT_DETAILS_EP ## EPIndex)
- #define _ENDPOINT_GET_MAXSIZE2(EPDetails) _ENDPOINT_GET_MAXSIZE3(EPDetails)
- #define _ENDPOINT_GET_MAXSIZE3(MaxSize, Banks) (MaxSize)
-
- #define _ENDPOINT_GET_BANKS(EPIndex) _ENDPOINT_GET_BANKS2(ENDPOINT_DETAILS_EP ## EPIndex)
- #define _ENDPOINT_GET_BANKS2(EPDetails) _ENDPOINT_GET_BANKS3(EPDetails)
- #define _ENDPOINT_GET_BANKS3(MaxSize, Banks) (Banks)
-
- #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
- #define ENDPOINT_DETAILS_MAXEP 7
-
- #define ENDPOINT_DETAILS_EP0 64, 1
- #define ENDPOINT_DETAILS_EP1 256, 2
- #define ENDPOINT_DETAILS_EP2 64, 2
- #define ENDPOINT_DETAILS_EP3 64, 2
- #define ENDPOINT_DETAILS_EP4 64, 2
- #define ENDPOINT_DETAILS_EP5 64, 2
- #define ENDPOINT_DETAILS_EP6 64, 2
- #else
- #define ENDPOINT_DETAILS_MAXEP 5
-
- #define ENDPOINT_DETAILS_EP0 64, 1
- #define ENDPOINT_DETAILS_EP1 64, 1
- #define ENDPOINT_DETAILS_EP2 64, 1
- #define ENDPOINT_DETAILS_EP3 64, 2
- #define ENDPOINT_DETAILS_EP4 64, 2
- #endif
-
/* Inline Functions: */
static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST
ATTR_ALWAYS_INLINE;
@@ -145,23 +116,6 @@
/* Public Interface - May be used in end-application: */
/* Macros: */
- /** \name Endpoint Bank Mode Masks */
- //@{
- /** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
- * that the endpoint should have one single bank, which requires less USB FIFO memory but results
- * in slower transfers as only one USB device (the AVR or the host) can access the endpoint's
- * bank at the one time.
- */
- #define ENDPOINT_BANK_SINGLE (0 << EPBK0)
-
- /** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
- * that the endpoint should have two banks, which requires more USB FIFO memory but results
- * in faster transfers as one USB device (the AVR or the host) can access one bank while the other
- * accesses the second bank.
- */
- #define ENDPOINT_BANK_DOUBLE (1 << EPBK0)
- //@}
-
#if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
/** Default size of the default control endpoint's bank, until altered by the control endpoint bank size
* value in the device descriptor. Not available if the \c FIXED_CONTROL_ENDPOINT_SIZE token is defined.
@@ -169,30 +123,16 @@
#define ENDPOINT_CONTROLEP_DEFAULT_SIZE 8
#endif
- /** Retrieves the maximum bank size in bytes of a given endpoint.
- *
- * \attention This macro will only work correctly on endpoint indexes that are compile-time constants
- * defined by the preprocessor.
- *
- * \param[in] EPIndex Endpoint number, a value between 0 and (\ref ENDPOINT_TOTAL_ENDPOINTS - 1)
- */
- #define ENDPOINT_MAX_SIZE(EPIndex) _ENDPOINT_GET_MAXSIZE(EPIndex)
-
- /** Retrieves the total number of banks supported by the given endpoint.
- *
- * \attention This macro will only work correctly on endpoint indexes that are compile-time constants
- * defined by the preprocessor.
- *
- * \param[in] EPIndex Endpoint number, a value between 0 and (\ref ENDPOINT_TOTAL_ENDPOINTS - 1)
- */
- #define ENDPOINT_BANKS_SUPPORTED(EPIndex) _ENDPOINT_GET_BANKS(EPIndex)
-
#if !defined(CONTROL_ONLY_DEVICE) || defined(__DOXYGEN__)
- /** Total number of endpoints (including the default control endpoint at address 0) which may
- * be used in the device. Different USB AVR models support different amounts of endpoints,
- * this value reflects the maximum number of endpoints for the currently selected AVR model.
- */
- #define ENDPOINT_TOTAL_ENDPOINTS ENDPOINT_DETAILS_MAXEP
+ #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
+ #define ENDPOINT_TOTAL_ENDPOINTS 7
+ #else
+ /** Total number of endpoints (including the default control endpoint at address 0) which may
+ * be used in the device. Different USB AVR models support different amounts of endpoints,
+ * this value reflects the maximum number of endpoints for the currently selected AVR model.
+ */
+ #define ENDPOINT_TOTAL_ENDPOINTS 5
+ #endif
#else
#define ENDPOINT_TOTAL_ENDPOINTS 1
#endif
@@ -222,28 +162,20 @@
};
/* Inline Functions: */
- /** Configures the specified endpoint number with the given endpoint type, direction, bank size
- * and banking mode. Once configured, the endpoint may be read from or written to, depending
- * on its direction.
+ /** Configures the specified endpoint address with the given endpoint type, bank size and number of hardware
+ * banks. Once configured, the endpoint may be read from or written to, depending on its direction.
*
- * \param[in] Number Endpoint number to configure. This must be more than 0 and less than
- * \ref ENDPOINT_TOTAL_ENDPOINTS.
+ * \param[in] Address Endpoint address to configure.
*
* \param[in] Type Type of endpoint to configure, a \c EP_TYPE_* mask. Not all endpoint types
* are available on Low Speed USB devices - refer to the USB 2.0 specification.
*
- * \param[in] Direction Endpoint data direction, either \ref ENDPOINT_DIR_OUT or \ref ENDPOINT_DIR_IN.
- * All endpoints (except Control type) are unidirectional - data may only be read
- * from or written to the endpoint bank based on its direction, not both.
- *
* \param[in] Size Size of the endpoint's bank, where packets are stored before they are transmitted
* to the USB host, or after they have been received from the USB host (depending on
* the endpoint's data direction). The bank size must indicate the maximum packet size
* that the endpoint can handle.
*
- * \param[in] Banks Number of banks to use for the endpoint being configured, an \c ENDPOINT_BANK_* mask.
- * More banks uses more USB DPRAM, but offers better performance. Isochronous type
- * endpoints <b>must</b> have at least two banks.
+ * \param[in] Banks Number of banks to use for the endpoint being configured.
*
* \attention When the \c ORDERED_EP_CONFIG compile time option is used, Endpoints <b>must</b> be configured in
* ascending order, or bank corruption will occur.
@@ -261,19 +193,18 @@
*
* \return Boolean \c true if the configuration succeeded, \c false otherwise.
*/
- static inline bool Endpoint_ConfigureEndpoint(const uint8_t Number,
+ static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address,
const uint8_t Type,
- const uint8_t Direction,
const uint16_t Size,
const uint8_t Banks) ATTR_ALWAYS_INLINE;
- static inline bool Endpoint_ConfigureEndpoint(const uint8_t Number,
+ static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address,
const uint8_t Type,
- const uint8_t Direction,
const uint16_t Size,
const uint8_t Banks)
{
- return Endpoint_ConfigureEndpoint_Prv(Number, ((Type << EPTYPE0) | (Direction ? (1 << EPDIR) : 0)),
- ((1 << ALLOC) | Banks | Endpoint_BytesToEPSizeMask(Size)));
+ return Endpoint_ConfigureEndpoint_Prv((Address & ENDPOINT_EPNUM_MASK),
+ ((Type << EPTYPE0) | ((Address & ENDPOINT_DIR_IN) ? (1 << EPDIR) : 0)),
+ ((1 << ALLOC) | ((Banks > 1) ? (1 << EPBK0) : 0) | Endpoint_BytesToEPSizeMask(Size)));
}
/** Indicates the number of bytes currently stored in the current endpoint's selected bank.
@@ -294,9 +225,19 @@
#endif
}
+ /** Determines the currently selected endpoint's direction.
+ *
+ * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask.
+ */
+ static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline uint8_t Endpoint_GetEndpointDirection(void)
+ {
+ return (UECFG0X & (1 << EPDIR)) ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT;
+ }
+
/** Get the endpoint address of the currently selected endpoint. This is typically used to save
- * the currently selected endpoint number so that it can be restored after another endpoint has
- * been manipulated.
+ * the currently selected endpoint so that it can be restored after another endpoint has been
+ * manipulated.
*
* \return Index of the currently selected endpoint.
*/
@@ -304,38 +245,36 @@
static inline uint8_t Endpoint_GetCurrentEndpoint(void)
{
#if !defined(CONTROL_ONLY_DEVICE)
- return (UENUM & ENDPOINT_EPNUM_MASK);
+ return ((UENUM & ENDPOINT_EPNUM_MASK) | Endpoint_GetEndpointDirection());
#else
return ENDPOINT_CONTROLEP;
#endif
}
- /** Selects the given endpoint number. If the address from the device descriptors is used, the
- * value should be masked with the \ref ENDPOINT_EPNUM_MASK constant to extract only the endpoint
- * number (and discarding the endpoint direction bit).
+ /** Selects the given endpoint address.
*
- * Any endpoint operations which do not require the endpoint number to be indicated will operate on
+ * Any endpoint operations which do not require the endpoint address to be indicated will operate on
* the currently selected endpoint.
*
- * \param[in] EndpointNumber Endpoint number to select.
+ * \param[in] Address Endpoint address to select.
*/
- static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE;
- static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber)
+ static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
#if !defined(CONTROL_ONLY_DEVICE)
- UENUM = EndpointNumber;
+ UENUM = (Address & ENDPOINT_EPNUM_MASK);
#endif
}
/** Resets the endpoint bank FIFO. This clears all the endpoint banks and resets the USB controller's
* data In and Out pointers to the bank's contents.
*
- * \param[in] EndpointNumber Endpoint number whose FIFO buffers are to be reset.
+ * \param[in] Address Endpoint address whose FIFO buffers are to be reset.
*/
- static inline void Endpoint_ResetEndpoint(const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE;
- static inline void Endpoint_ResetEndpoint(const uint8_t EndpointNumber)
+ static inline void Endpoint_ResetEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Endpoint_ResetEndpoint(const uint8_t Address)
{
- UERST = (1 << EndpointNumber);
+ UERST = (1 << (Address & ENDPOINT_EPNUM_MASK));
UERST = 0;
}
@@ -441,14 +380,14 @@
/** Determines if the specified endpoint number has interrupted (valid only for INTERRUPT type
* endpoints).
*
- * \param[in] EndpointNumber Index of the endpoint whose interrupt flag should be tested.
+ * \param[in] Address Address of the endpoint whose interrupt flag should be tested.
*
* \return Boolean \c true if the specified endpoint has interrupted, \c false otherwise.
*/
- static inline bool Endpoint_HasEndpointInterrupted(const uint8_t EndpointNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline bool Endpoint_HasEndpointInterrupted(const uint8_t EndpointNumber)
+ static inline bool Endpoint_HasEndpointInterrupted(const uint8_t Address) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline bool Endpoint_HasEndpointInterrupted(const uint8_t Address)
{
- return ((Endpoint_GetEndpointInterrupts() & (1 << EndpointNumber)) ? true : false);
+ return ((Endpoint_GetEndpointInterrupts() & (1 << (Address & ENDPOINT_EPNUM_MASK))) ? true : false);
}
/** Determines if the selected IN endpoint is ready for a new packet to be sent to the host.
@@ -576,16 +515,6 @@
UECONX |= (1 << RSTDT);
}
- /** Determines the currently selected endpoint's direction.
- *
- * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask.
- */
- static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline uint8_t Endpoint_GetEndpointDirection(void)
- {
- return (UECFG0X & (1 << EPDIR)) ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT;
- }
-
/** Sets the direction of the currently selected endpoint.
*
* \param[in] DirectionMask New endpoint direction, as a \c ENDPOINT_DIR_* mask.
@@ -841,6 +770,20 @@
#endif
/* Function Prototypes: */
+ /** Configures a table of endpoint descriptions, in sequence. This function can be used to configure multiple
+ * endpoints at the same time.
+ *
+ * \note Endpoints with a zero address will be ignored, thus this function cannot be used to configure the
+ * control endpoint.
+ *
+ * \param[in] Table Pointer to a table of endpoint descriptions.
+ * \param[in] Entries Number of entries in the endpoint table to configure.
+ *
+ * \return Boolean \c true if all endpoints configured successfully, \c false otherwise.
+ */
+ bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table,
+ const uint8_t Entries);
+
/** Completes the status stage of a control transfer on a CONTROL type endpoint automatically,
* with respect to the data direction. This is a convenience function which can be used to
* simplify user control request handling.
diff --git a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
index 3f27c7631..a1e0fd371 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
+++ b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
@@ -114,9 +114,7 @@ void USB_Host_ProcessNextHostState(void)
HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered_ConfigPipe);
break;
case HOST_STATE_Powered_ConfigPipe:
- if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL,
- PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP,
- PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE)))
+ if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, ENDPOINT_CONTROLEP, PIPE_CONTROLPIPE_DEFAULT_SIZE, 1)))
{
ErrorCode = HOST_ENUMERROR_PipeConfigError;
SubErrorCode = 0;
@@ -151,9 +149,7 @@ void USB_Host_ProcessNextHostState(void)
HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset);
break;
case HOST_STATE_Default_PostReset:
- if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL,
- PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP,
- USB_Host_ControlPipeSize, PIPE_BANK_SINGLE)))
+ if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, ENDPOINT_CONTROLEP, USB_Host_ControlPipeSize, 1)))
{
ErrorCode = HOST_ENUMERROR_PipeConfigError;
SubErrorCode = 0;
diff --git a/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
index 5e68cc725..1ddffb51e 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
+++ b/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
@@ -40,21 +40,43 @@
uint8_t USB_Host_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
-bool Pipe_ConfigurePipe(const uint8_t Number,
+bool Pipe_ConfigurePipeTable(const USB_Pipe_Table_t* const Table,
+ const uint8_t Entries)
+{
+ for (uint8_t i = 0; i < Entries; i++)
+ {
+ if (!(Table[i].Address))
+ continue;
+
+ if (!(Pipe_ConfigurePipe(Table[i].Address, Table[i].Type, Table[i].EndpointAddress, Table[i].Size, Table[i].Banks)))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool Pipe_ConfigurePipe(const uint8_t Address,
const uint8_t Type,
- const uint8_t Token,
- const uint8_t EndpointNumber,
+ const uint8_t EndpointAddress,
const uint16_t Size,
const uint8_t Banks)
{
+ uint8_t Number = (Address & PIPE_EPNUM_MASK);
+ uint8_t Token = (Address & PIPE_DIR_IN) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT;
+
+ if (Type == EP_TYPE_CONTROL)
+ Token = PIPE_TOKEN_SETUP;
+
#if defined(ORDERED_EP_CONFIG)
Pipe_SelectPipe(Number);
Pipe_EnablePipe();
UPCFG1X = 0;
- UPCFG0X = ((Type << EPTYPE0) | Token | ((EndpointNumber & PIPE_EPNUM_MASK) << PEPNUM0));
- UPCFG1X = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));
+ UPCFG0X = ((Type << EPTYPE0) | Token | ((EndpointAddress & PIPE_EPNUM_MASK) << PEPNUM0));
+ UPCFG1X = ((1 << ALLOC) | ((Banks > 1) ? (1 << EPBK0) : 0) | Pipe_BytesToEPSizeMask(Size));
Pipe_SetInfiniteINRequests();
@@ -71,7 +93,7 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
if (PNum == Number)
{
- UPCFG0XTemp = ((Type << EPTYPE0) | Token | ((EndpointNumber & PIPE_EPNUM_MASK) << PEPNUM0));
+ UPCFG0XTemp = ((Type << EPTYPE0) | Token | ((EndpointAddress & PIPE_EPNUM_MASK) << PEPNUM0));
UPCFG1XTemp = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));
UPCFG2XTemp = 0;
UPIENXTemp = 0;
diff --git a/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h b/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h
index 86792bf22..1012fa060 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h
+++ b/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h
@@ -124,38 +124,22 @@
/** \name Pipe Token Masks */
//@{
- /** Token mask for \ref Pipe_ConfigurePipe(). This sets the pipe as a SETUP token (for CONTROL type pipes),
+ /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a SETUP token (for CONTROL type pipes),
* which will trigger a control request on the attached device when data is written to the pipe.
*/
#define PIPE_TOKEN_SETUP (0 << PTOKEN0)
- /** Token mask for \ref Pipe_ConfigurePipe(). This sets the pipe as a IN token (for non-CONTROL type pipes),
+ /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a IN token (for non-CONTROL type pipes),
* indicating that the pipe data will flow from device to host.
*/
#define PIPE_TOKEN_IN (1 << PTOKEN0)
- /** Token mask for \ref Pipe_ConfigurePipe(). This sets the pipe as a OUT token (for non-CONTROL type pipes),
+ /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a OUT token (for non-CONTROL type pipes),
* indicating that the pipe data will flow from host to device.
*/
#define PIPE_TOKEN_OUT (2 << PTOKEN0)
//@}
- /** \name Pipe Bank Mode Masks */
- //@{
- /** Mask for the bank mode selection for the \ref Pipe_ConfigurePipe() macro. This indicates that the pipe
- * should have one single bank, which requires less USB FIFO memory but results in slower transfers as
- * only one USB device (the AVR or the attached device) can access the pipe's bank at the one time.
- */
- #define PIPE_BANK_SINGLE (0 << EPBK0)
-
- /** Mask for the bank mode selection for the \ref Pipe_ConfigurePipe() macro. This indicates that the pipe
- * should have two banks, which requires more USB FIFO memory but results in faster transfers as one
- * USB device (the AVR or the attached device) can access one bank while the other accesses the second
- * bank.
- */
- #define PIPE_BANK_DOUBLE (1 << EPBK0)
- //@}
-
/** Default size of the default control pipe's bank, until altered by the Endpoint0Size value
* in the device descriptor of the attached device.
*/
@@ -203,36 +187,46 @@
return UPBCX;
}
+ /** Determines the currently selected pipe's direction.
+ *
+ * \return The currently selected pipe's direction, as a \c PIPE_DIR_* mask.
+ */
+ static inline uint8_t Pipe_GetPipeDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline uint8_t Pipe_GetPipeDirection(void)
+ {
+ return (UPCFG0X & (1 << EPDIR)) ? PIPE_DIR_IN : PIPE_DIR_OUT;
+ }
+
/** Returns the pipe address of the currently selected pipe. This is typically used to save the
- * currently selected pipe number so that it can be restored after another pipe has been manipulated.
+ * currently selected pipe address so that it can be restored after another pipe has been manipulated.
*
* \return Index of the currently selected pipe.
*/
static inline uint8_t Pipe_GetCurrentPipe(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Pipe_GetCurrentPipe(void)
{
- return (UPNUM & PIPE_PIPENUM_MASK);
+ return ((UPNUM & PIPE_PIPENUM_MASK) | Pipe_GetPipeDirection());
}
- /** Selects the given pipe number. Any pipe operations which do not require the pipe number to be
+ /** Selects the given pipe address. Any pipe operations which do not require the pipe address to be
* indicated will operate on the currently selected pipe.
*
- * \param[in] PipeNumber Index of the pipe to select.
+ * \param[in] Address Address of the pipe to select.
*/
- static inline void Pipe_SelectPipe(const uint8_t PipeNumber) ATTR_ALWAYS_INLINE;
- static inline void Pipe_SelectPipe(const uint8_t PipeNumber)
+ static inline void Pipe_SelectPipe(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Pipe_SelectPipe(const uint8_t Address)
{
- UPNUM = PipeNumber;
+ UPNUM = (Address & PIPE_PIPENUM_MASK);
}
/** Resets the desired pipe, including the pipe banks and flags.
*
- * \param[in] PipeNumber Index of the pipe to reset.
+ * \param[in] Address Address of the pipe to reset.
*/
- static inline void Pipe_ResetPipe(const uint8_t PipeNumber) ATTR_ALWAYS_INLINE;
- static inline void Pipe_ResetPipe(const uint8_t PipeNumber)
+ static inline void Pipe_ResetPipe(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Pipe_ResetPipe(const uint8_t Address)
{
- UPRST = (1 << PipeNumber);
+ UPRST = (1 << (Address & PIPE_PIPENUM_MASK));
UPRST = 0;
}
@@ -326,8 +320,9 @@
static inline uint8_t Pipe_GetBoundEndpointAddress(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Pipe_GetBoundEndpointAddress(void)
{
- return (((UPCFG0X >> PEPNUM0) & PIPE_EPNUM_MASK) |
- ((Pipe_GetPipeToken() == PIPE_TOKEN_IN) ? PIPE_EPDIR_MASK : 0));
+ uint8_t UPCFG0X_Temp = UPCFG0X;
+
+ return (((UPCFG0X_Temp >> PEPNUM0) & PIPE_EPNUM_MASK) | ((UPCFG0X_Temp & PEPNUM1) ? ENDPOINT_DIR_OUT : ENDPOINT_DIR_IN));
}
/** Sets the period between interrupts for an INTERRUPT type pipe to a specified number of milliseconds.
@@ -351,17 +346,17 @@
return UPINT;
}
- /** Determines if the specified pipe number has interrupted (valid only for INTERRUPT type
+ /** Determines if the specified pipe address has interrupted (valid only for INTERRUPT type
* pipes).
*
- * \param[in] PipeNumber Index of the pipe whose interrupt flag should be tested.
+ * \param[in] Address Address of the pipe whose interrupt flag should be tested.
*
* \return Boolean \c true if the specified pipe has interrupted, \c false otherwise.
*/
- static inline bool Pipe_HasPipeInterrupted(const uint8_t PipeNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline bool Pipe_HasPipeInterrupted(const uint8_t PipeNumber)
+ static inline bool Pipe_HasPipeInterrupted(const uint8_t Address) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline bool Pipe_HasPipeInterrupted(const uint8_t Address)
{
- return ((UPINT & (1 << PipeNumber)) ? true : false);
+ return ((UPINT & (1 << (Address & PIPE_PIPENUM_MASK))) ? true : false);
}
/** Unfreezes the selected pipe, allowing it to communicate with an attached device. */
@@ -810,8 +805,22 @@
extern uint8_t USB_Host_ControlPipeSize;
/* Function Prototypes: */
- /** Configures the specified pipe number with the given pipe type, token, target endpoint number in the
- * attached device, bank size and banking mode.
+ /** Configures a table of pipe descriptions, in sequence. This function can be used to configure multiple
+ * pipes at the same time.
+ *
+ * \note Pipe with a zero address will be ignored, thus this function cannot be used to configure the
+ * control pipe.
+ *
+ * \param[in] Table Pointer to a table of pipe descriptions.
+ * \param[in] Entries Number of entries in the pipe table to configure.
+ *
+ * \return Boolean \c true if all pipes configured successfully, \c false otherwise.
+ */
+ bool Pipe_ConfigurePipeTable(const USB_Pipe_Table_t* const Table,
+ const uint8_t Entries);
+
+ /** Configures the specified pipe address with the given pipe type, endpoint address within the attached device, bank size
+ * and number of hardware banks.
*
* A newly configured pipe is frozen by default, and must be unfrozen before use via the \ref Pipe_Unfreeze()
* before being used. Pipes should be kept frozen unless waiting for data from a device while in IN mode, or
@@ -819,25 +828,19 @@
* numbers of IN requests without automatic freezing - this can be overridden by a call to
* \ref Pipe_SetFiniteINRequests().
*
- * \param[in] Number Pipe number to configure. This must be more than 0 and less than \ref PIPE_TOTAL_PIPES.
- *
- * \param[in] Type Type of pipe to configure, an \c EP_TYPE_* mask. Not all pipe types are available on Low
- * Speed USB devices - refer to the USB 2.0 specification.
+ * \param[in] Address Pipe address to configure.
*
- * \param[in] Token Pipe data token, either \ref PIPE_TOKEN_SETUP, \ref PIPE_TOKEN_OUT or \ref PIPE_TOKEN_IN.
- * All pipes (except Control type) are unidirectional - data may only be read from or
- * written to the pipe bank based on its direction, not both.
+ * \param[in] Type Type of pipe to configure, an \c EP_TYPE_* mask. Not all pipe types are available on Low
+ * Speed USB devices - refer to the USB 2.0 specification.
*
- * \param[in] EndpointNumber Endpoint index within the attached device that the pipe should interface to.
+ * \param[in] EndpointAddress Endpoint address within the attached device that the pipe should interface to.
*
- * \param[in] Size Size of the pipe's bank, where packets are stored before they are transmitted to
- * the USB device, or after they have been received from the USB device (depending on
- * the pipe's data direction). The bank size must indicate the maximum packet size that
- * the pipe can handle.
+ * \param[in] Size Size of the pipe's bank, where packets are stored before they are transmitted to
+ * the USB device, or after they have been received from the USB device (depending on
+ * the pipe's data direction). The bank size must indicate the maximum packet size that
+ * the pipe can handle.
*
- * \param[in] Banks Number of banks to use for the pipe being configured, a \c PIPE_BANK_* mask. More banks
- * uses more USB DPRAM, but offers better performance. Isochronous type pipes <b>must</b>
- * have at least two banks.
+ * \param[in] Banks Number of banks to use for the pipe being configured.
*
* \attention When the \c ORDERED_EP_CONFIG compile time option is used, Pipes <b>must</b> be configured in ascending order,
* or bank corruption will occur.
@@ -855,10 +858,9 @@
*
* \return Boolean \c true if the configuration succeeded, \c false otherwise.
*/
- bool Pipe_ConfigurePipe(const uint8_t Number,
+ bool Pipe_ConfigurePipe(const uint8_t Address,
const uint8_t Type,
- const uint8_t Token,
- const uint8_t EndpointNumber,
+ const uint8_t EndpointAddress,
const uint16_t Size,
const uint8_t Banks);
diff --git a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c
index e31b88d5f..1f37dfd49 100644
--- a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c
+++ b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c
@@ -232,8 +232,7 @@ static void USB_Init_Device(void)
#endif
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
- ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,
- ENDPOINT_BANK_SINGLE);
+ USB_Device_ControlEndpointSize, 1);
USB_INT_Clear(USB_INT_SUSPI);
USB_INT_Enable(USB_INT_SUSPI);
diff --git a/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c
index f63cf3eb9..e26c86f12 100644
--- a/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c
+++ b/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c
@@ -171,8 +171,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_INT_Enable(USB_INT_WAKEUPI);
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
- ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,
- ENDPOINT_BANK_SINGLE);
+ USB_Device_ControlEndpointSize, 1);
#if defined(INTERRUPT_CONTROL_ENDPOINT)
USB_INT_Enable(USB_INT_RXSTPI);
diff --git a/LUFA/Drivers/USB/Core/Endpoint.h b/LUFA/Drivers/USB/Core/Endpoint.h
index 1fcc6b6f3..b349adfc9 100644
--- a/LUFA/Drivers/USB/Core/Endpoint.h
+++ b/LUFA/Drivers/USB/Core/Endpoint.h
@@ -87,6 +87,18 @@
#endif
/* Public Interface - May be used in end-application: */
+ /* Type Defines: */
+ /** Type define for a endpoint table entry, used to configure endpoints in groups via
+ * \ref Endpoint_ConfigureEndpointTable().
+ */
+ typedef struct
+ {
+ uint8_t Address; /**< Address of the endpoint to configure, or zero if the table entry is to be unused. */
+ uint16_t Size; /**< Size of the endpoint bank, in bytes. */
+ uint8_t Type; /**< Type of the endpoint, a \c EP_TYPE_* mask. */
+ uint8_t Banks; /**< Number of hardware banks to use for the endpoint. */
+ } USB_Endpoint_Table_t;
+
/* Macros: */
/** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's
* numerical address in the device.
diff --git a/LUFA/Drivers/USB/Core/Pipe.h b/LUFA/Drivers/USB/Core/Pipe.h
index bb56b8102..faa803b6d 100644
--- a/LUFA/Drivers/USB/Core/Pipe.h
+++ b/LUFA/Drivers/USB/Core/Pipe.h
@@ -97,6 +97,19 @@
#endif
/* Public Interface - May be used in end-application: */
+ /* Type Defines: */
+ /** Type define for a pipe table entry, used to configure pipes in groups via
+ * \ref Pipe_ConfigurePipeTable().
+ */
+ typedef struct
+ {
+ uint8_t Address; /**< Address of the pipe to configure, or zero if the table entry is to be unused. */
+ uint16_t Size; /**< Size of the pipe bank, in bytes. */
+ uint8_t EndpointAddress; /** Address of the endpoint in the connected device. */
+ uint8_t Type; /**< Type of the endpoint, a \c EP_TYPE_* mask. */
+ uint8_t Banks; /**< Number of hardware banks to use for the pipe. */
+ } USB_Pipe_Table_t;
+
/* Macros: */
/** Pipe address for the default control pipe, which always resides in address 0. This is
* defined for convenience to give more readable code when used with the pipe macros.
@@ -113,11 +126,6 @@
*/
#define PIPE_EPNUM_MASK 0x0F
- /** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's
- * direction for comparing with the \c ENDPOINT_DIR_* masks.
- */
- #define PIPE_EPDIR_MASK 0x80
-
/* Architecture Includes: */
#if (ARCH == ARCH_AVR8)
#include "AVR8/Pipe_AVR8.h"
diff --git a/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c b/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c
index fc1b18a2e..c027585a6 100644
--- a/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c
+++ b/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c
@@ -45,6 +45,23 @@ uint8_t USB_Device_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;
volatile uint32_t USB_Endpoint_SelectedEndpoint = ENDPOINT_CONTROLEP;
volatile uint8_t* USB_Endpoint_FIFOPos[ENDPOINT_TOTAL_ENDPOINTS];
+bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table,
+ const uint8_t Entries)
+{
+ for (uint8_t i = 0; i < Entries; i++)
+ {
+ if (!(Table[i].Address))
+ continue;
+
+ if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks)))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
const uint32_t UECFG0Data)
{
diff --git a/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h b/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h
index c919effa7..84801a13f 100644
--- a/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h
+++ b/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h
@@ -90,47 +90,6 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
- #define _ENDPOINT_GET_MAXSIZE(EPIndex) _ENDPOINT_GET_MAXSIZE2(ENDPOINT_DETAILS_EP ## EPIndex)
- #define _ENDPOINT_GET_MAXSIZE2(EPDetails) _ENDPOINT_GET_MAXSIZE3(EPDetails)
- #define _ENDPOINT_GET_MAXSIZE3(MaxSize, Banks) (MaxSize)
-
- #define _ENDPOINT_GET_BANKS(EPIndex) _ENDPOINT_GET_BANKS2(ENDPOINT_DETAILS_EP ## EPIndex)
- #define _ENDPOINT_GET_BANKS2(EPDetails) _ENDPOINT_GET_BANKS3(EPDetails)
- #define _ENDPOINT_GET_BANKS3(MaxSize, Banks) (Banks)
-
- #if defined(USB_SERIES_UC3A0_AVR32) || defined(USB_SERIES_UC3A1_AVR32)
- #define ENDPOINT_DETAILS_MAXEP 7
-
- #define ENDPOINT_DETAILS_EP0 64, 1
- #define ENDPOINT_DETAILS_EP1 256, 2
- #define ENDPOINT_DETAILS_EP2 256, 2
- #define ENDPOINT_DETAILS_EP3 64, 2
- #define ENDPOINT_DETAILS_EP4 64, 2
- #define ENDPOINT_DETAILS_EP5 256, 2
- #define ENDPOINT_DETAILS_EP6 256, 2
- #elif defined(USB_SERIES_UC3A3_AVR32) || defined(USB_SERIES_UC3A4_AVR32)
- #define ENDPOINT_DETAILS_MAXEP 8
-
- #define ENDPOINT_DETAILS_EP0 64, 1
- #define ENDPOINT_DETAILS_EP1 512, 3
- #define ENDPOINT_DETAILS_EP2 512, 3
- #define ENDPOINT_DETAILS_EP3 512, 3
- #define ENDPOINT_DETAILS_EP4 512, 3
- #define ENDPOINT_DETAILS_EP5 512, 3
- #define ENDPOINT_DETAILS_EP6 512, 3
- #define ENDPOINT_DETAILS_EP7 512, 3
- #elif defined(USB_SERIES_UC3B0_AVR32) || defined(USB_SERIES_UC3B1_AVR32)
- #define ENDPOINT_DETAILS_MAXEP 7
-
- #define ENDPOINT_DETAILS_EP0 64, 1
- #define ENDPOINT_DETAILS_EP1 64, 2
- #define ENDPOINT_DETAILS_EP2 64, 2
- #define ENDPOINT_DETAILS_EP3 64, 2
- #define ENDPOINT_DETAILS_EP4 64, 2
- #define ENDPOINT_DETAILS_EP5 256, 2
- #define ENDPOINT_DETAILS_EP6 256, 2
- #endif
-
#define ENDPOINT_HSB_ADDRESS_SPACE_SIZE (64 * 1024UL)
/* Inline Functions: */
@@ -162,34 +121,6 @@
/* Public Interface - May be used in end-application: */
/* Macros: */
- /** \name Endpoint Bank Mode Masks */
- //@{
- /** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
- * that the endpoint should have one single bank, which requires less USB FIFO memory but results
- * in slower transfers as only one USB device (the AVR or the host) can access the endpoint's
- * bank at the one time.
- */
- #define ENDPOINT_BANK_SINGLE AVR32_USBB_UECFG0_EPBK_SINGLE
-
- /** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
- * that the endpoint should have two banks, which requires more USB FIFO memory but results
- * in faster transfers as one USB device (the AVR or the host) can access one bank while the other
- * accesses the second bank.
- */
- #define ENDPOINT_BANK_DOUBLE AVR32_USBB_UECFG0_EPBK_DOUBLE
-
- #if defined(USB_SERIES_UC3A3_AVR32) || defined(USB_SERIES_UC3A4_AVR32) || defined(__DOXYGEN__)
- /** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
- * that the endpoint should have three banks, which requires more USB FIFO memory but results
- * in faster transfers as one USB device (the AVR or the host) can access one bank while the other
- * accesses the remaining banks.
- *
- * \note Not available on all AVR models.
- */
- #define ENDPOINT_BANK_TRIPLE AVR32_USBB_UECFG0_EPBK_TRIPLE
- #endif
- //@}
-
#if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
/** Default size of the default control endpoint's bank, until altered by the control endpoint bank size
* value in the device descriptor. Not available if the \c FIXED_CONTROL_ENDPOINT_SIZE token is defined.
@@ -197,30 +128,16 @@
#define ENDPOINT_CONTROLEP_DEFAULT_SIZE 8
#endif
- /** Retrieves the maximum bank size in bytes of a given endpoint.
- *
- * \attention This macro will only work correctly on endpoint indexes that are compile-time constants
- * defined by the preprocessor.
- *
- * \param[in] EPIndex Endpoint number, a value between 0 and (\ref ENDPOINT_TOTAL_ENDPOINTS - 1)
- */
- #define ENDPOINT_MAX_SIZE(EPIndex) _ENDPOINT_GET_MAXSIZE(EPIndex)
-
- /** Retrieves the total number of banks supported by the given endpoint.
- *
- * \attention This macro will only work correctly on endpoint indexes that are compile-time constants
- * defined by the preprocessor.
- *
- * \param[in] EPIndex Endpoint number, a value between 0 and (\ref ENDPOINT_TOTAL_ENDPOINTS - 1)
- */
- #define ENDPOINT_BANKS_SUPPORTED(EPIndex) _ENDPOINT_GET_BANKS(EPIndex)
-
#if !defined(CONTROL_ONLY_DEVICE) || defined(__DOXYGEN__)
- /** Total number of endpoints (including the default control endpoint at address 0) which may
- * be used in the device. Different AVR models support different amounts of endpoints,
- * this value reflects the maximum number of endpoints for the currently selected AVR model.
- */
- #define ENDPOINT_TOTAL_ENDPOINTS ENDPOINT_DETAILS_MAXEP
+ #if defined(USB_SERIES_UC3A3_AVR32) || defined(USB_SERIES_UC3A4_AVR32)
+ #define ENDPOINT_TOTAL_ENDPOINTS 8
+ #else
+ /** Total number of endpoints (including the default control endpoint at address 0) which may
+ * be used in the device. Different AVR models support different amounts of endpoints,
+ * this value reflects the maximum number of endpoints for the currently selected AVR model.
+ */
+ #define ENDPOINT_TOTAL_ENDPOINTS 7
+ #endif
#else
#define ENDPOINT_TOTAL_ENDPOINTS 1
#endif
@@ -250,28 +167,21 @@
};
/* Inline Functions: */
- /** Configures the specified endpoint number with the given endpoint type, direction, bank size
+ /** Configures the specified endpoint address with the given endpoint type, direction, bank size
* and banking mode. Once configured, the endpoint may be read from or written to, depending
* on its direction.
*
- * \param[in] Number Endpoint number to configure. This must be more than 0 and less than
- * \ref ENDPOINT_TOTAL_ENDPOINTS.
+ * \param[in] Address Endpoint address to configure.
*
* \param[in] Type Type of endpoint to configure, a \c EP_TYPE_* mask. Not all endpoint types
* are available on Low Speed USB devices - refer to the USB 2.0 specification.
*
- * \param[in] Direction Endpoint data direction, either \ref ENDPOINT_DIR_OUT or \ref ENDPOINT_DIR_IN.
- * All endpoints (except Control type) are unidirectional - data may only be read
- * from or written to the endpoint bank based on its direction, not both.
- *
* \param[in] Size Size of the endpoint's bank, where packets are stored before they are transmitted
* to the USB host, or after they have been received from the USB host (depending on
* the endpoint's data direction). The bank size must indicate the maximum packet size
* that the endpoint can handle.
*
- * \param[in] Banks Number of banks to use for the endpoint being configured, an \c ENDPOINT_BANK_* mask.
- * More banks uses more USB DPRAM, but offers better performance. Isochronous type
- * endpoints <b>must</b> have at least two banks.
+ * \param[in] Banks Number of hardware banks to use for the endpoint being configured.
*
* \attention When the \c ORDERED_EP_CONFIG compile time option is used, Endpoints <b>must</b> be configured in
* ascending order, or bank corruption will occur.
@@ -289,22 +199,21 @@
*
* \return Boolean \c true if the configuration succeeded, \c false otherwise.
*/
- static inline bool Endpoint_ConfigureEndpoint(const uint8_t Number,
+ static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address,
const uint8_t Type,
- const uint8_t Direction,
const uint16_t Size,
const uint8_t Banks) ATTR_ALWAYS_INLINE;
- static inline bool Endpoint_ConfigureEndpoint(const uint8_t Number,
+ static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address,
const uint8_t Type,
- const uint8_t Direction,
const uint16_t Size,
const uint8_t Banks)
{
- return Endpoint_ConfigureEndpoint_Prv(Number, (AVR32_USBB_ALLOC_MASK |
- ((uint32_t)Type << AVR32_USBB_EPTYPE_OFFSET) |
- ((uint32_t)(Direction ? AVR32_USBB_UECFG0_EPDIR_MASK : 0) |
- ((uint32_t)Banks << AVR32_USBB_EPBK_OFFSET) |
- Endpoint_BytesToEPSizeMask(Size))));
+ return Endpoint_ConfigureEndpoint_Prv((Address & ENDPOINT_EPNUM_MASK),
+ (AVR32_USBB_ALLOC_MASK |
+ ((uint32_t)Type << AVR32_USBB_EPTYPE_OFFSET) |
+ ((uint32_t)(Address & ENDPOINT_DIR_IN) ? AVR32_USBB_UECFG0_EPDIR_MASK : 0) |
+ ((uint32_t)Banks << AVR32_USBB_EPBK_OFFSET) |
+ Endpoint_BytesToEPSizeMask(Size)));
}
/** Indicates the number of bytes currently stored in the current endpoint's selected bank.
@@ -319,41 +228,51 @@
return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].byct;
}
+ /** Determines the currently selected endpoint's direction.
+ *
+ * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask.
+ */
+ static inline uint32_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline uint32_t Endpoint_GetEndpointDirection(void)
+ {
+ return ((&AVR32_USBB.UECFG0)[USB_Endpoint_SelectedEndpoint].epdir ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT);
+ }
+
/** Get the endpoint address of the currently selected endpoint. This is typically used to save
- * the currently selected endpoint number so that it can be restored after another endpoint has
- * been manipulated.
+ * the currently selected endpoint so that it can be restored after another endpoint has been
+ * manipulated.
*
* \return Index of the currently selected endpoint.
*/
static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetCurrentEndpoint(void)
{
- return USB_Endpoint_SelectedEndpoint;
+ return (USB_Endpoint_SelectedEndpoint | Endpoint_GetEndpointDirection());
}
- /** Selects the given endpoint number. If the address from the device descriptors is used, the
- * value should be masked with the \ref ENDPOINT_EPNUM_MASK constant to extract only the endpoint
- * number (and discarding the endpoint direction bit).
+ /** Selects the given endpoint address.
*
- * Any endpoint operations which do not require the endpoint number to be indicated will operate on
+ * Any endpoint operations which do not require the endpoint address to be indicated will operate on
* the currently selected endpoint.
*
- * \param[in] EndpointNumber Endpoint number to select.
+ * \param[in] Address Endpoint address to select.
*/
- static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE;
- static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber)
+ static inline void Endpoint_SelectEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
- USB_Endpoint_SelectedEndpoint = EndpointNumber;
+ USB_Endpoint_SelectedEndpoint = (Address & ENDPOINT_EPNUM_MASK);
}
/** Resets the endpoint bank FIFO. This clears all the endpoint banks and resets the USB controller's
* data In and Out pointers to the bank's contents.
*
- * \param[in] EndpointNumber Endpoint number whose FIFO buffers are to be reset.
+ * \param[in] Address Endpoint number whose FIFO buffers are to be reset.
*/
- static inline void Endpoint_ResetEndpoint(const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE;
- static inline void Endpoint_ResetEndpoint(const uint8_t EndpointNumber)
+ static inline void Endpoint_ResetEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Endpoint_ResetEndpoint(const uint8_t Address)
{
+ uint32_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK);
+
AVR32_USBB.uerst |= (AVR32_USBB_EPRST0_MASK << EndpointNumber);
AVR32_USBB.uerst &= ~(AVR32_USBB_EPRST0_MASK << EndpointNumber);
USB_Endpoint_FIFOPos[EndpointNumber] = &AVR32_USBB_SLAVE[EndpointNumber * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
@@ -452,8 +371,8 @@
*
* \return Mask whose bits indicate which endpoints have interrupted.
*/
- static inline uint8_t Endpoint_GetEndpointInterrupts(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline uint8_t Endpoint_GetEndpointInterrupts(void)
+ static inline uint32_t Endpoint_GetEndpointInterrupts(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline uint32_t Endpoint_GetEndpointInterrupts(void)
{
return ((AVR32_USBB.udint & (AVR32_USBB_EP6INT_MASK | AVR32_USBB_EP5INT_MASK |
AVR32_USBB_EP4INT_MASK | AVR32_USBB_EP3INT_MASK |
@@ -464,14 +383,14 @@
/** Determines if the specified endpoint number has interrupted (valid only for INTERRUPT type
* endpoints).
*
- * \param[in] EndpointNumber Index of the endpoint whose interrupt flag should be tested.
+ * \param[in] Address Address of the endpoint whose interrupt flag should be tested.
*
* \return Boolean \c true if the specified endpoint has interrupted, \c false otherwise.
*/
- static inline bool Endpoint_HasEndpointInterrupted(const uint8_t EndpointNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline bool Endpoint_HasEndpointInterrupted(const uint8_t EndpointNumber)
+ static inline bool Endpoint_HasEndpointInterrupted(const uint8_t Address) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline bool Endpoint_HasEndpointInterrupted(const uint8_t Address)
{
- return ((Endpoint_GetEndpointInterrupts() & (AVR32_USBB_EP0INT_MASK << EndpointNumber)) ? true : false);
+ return ((Endpoint_GetEndpointInterrupts() & (AVR32_USBB_EP0INT_MASK << (Address & ENDPOINT_EPNUM_MASK))) ? true : false);
}
/** Determines if the selected IN endpoint is ready for a new packet to be sent to the host.
@@ -596,16 +515,6 @@
(&AVR32_USBB.UECON0SET)[USB_Endpoint_SelectedEndpoint].rstdts = true;
}
- /** Determines the currently selected endpoint's direction.
- *
- * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask.
- */
- static inline uint32_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline uint32_t Endpoint_GetEndpointDirection(void)
- {
- return ((&AVR32_USBB.UECFG0)[USB_Endpoint_SelectedEndpoint].epdir ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT);
- }
-
/** Sets the direction of the currently selected endpoint.
*
* \param[in] DirectionMask New endpoint direction, as a \c ENDPOINT_DIR_* mask.
@@ -837,6 +746,20 @@
#endif
/* Function Prototypes: */
+ /** Configures a table of endpoint descriptions, in sequence. This function can be used to configure multiple
+ * endpoints at the same time.
+ *
+ * \note Endpoints with a zero address will be ignored, thus this function cannot be used to configure the
+ * control endpoint.
+ *
+ * \param[in] Table Pointer to a table of endpoint descriptions.
+ * \param[in] Entries Number of entries in the endpoint table to configure.
+ *
+ * \return Boolean \c true if all endpoints configured successfully, \c false otherwise.
+ */
+ bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table,
+ const uint8_t Entries);
+
/** Completes the status stage of a control transfer on a CONTROL type endpoint automatically,
* with respect to the data direction. This is a convenience function which can be used to
* simplify user control request handling.
diff --git a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c
index 49d43f9b5..932381a14 100644
--- a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c
+++ b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c
@@ -114,9 +114,7 @@ void USB_Host_ProcessNextHostState(void)
HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Powered_ConfigPipe);
break;
case HOST_STATE_Powered_ConfigPipe:
- if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL,
- PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP,
- PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE)))
+ if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, ENDPOINT_CONTROLEP, PIPE_CONTROLPIPE_DEFAULT_SIZE, 1)))
{
ErrorCode = HOST_ENUMERROR_PipeConfigError;
SubErrorCode = 0;
@@ -151,9 +149,7 @@ void USB_Host_ProcessNextHostState(void)
HOST_TASK_NONBLOCK_WAIT(200, HOST_STATE_Default_PostReset);
break;
case HOST_STATE_Default_PostReset:
- if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL,
- PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP,
- USB_Host_ControlPipeSize, PIPE_BANK_SINGLE)))
+ if (!(Pipe_ConfigurePipe(PIPE_CONTROLPIPE, EP_TYPE_CONTROL, ENDPOINT_CONTROLEP, USB_Host_ControlPipeSize, 1)))
{
ErrorCode = HOST_ENUMERROR_PipeConfigError;
SubErrorCode = 0;
diff --git a/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c b/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
index 4e77a28ff..787244b97 100644
--- a/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
+++ b/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
@@ -43,13 +43,35 @@ uint8_t USB_Host_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
volatile uint32_t USB_Pipe_SelectedPipe = PIPE_CONTROLPIPE;
volatile uint8_t* USB_Pipe_FIFOPos[PIPE_TOTAL_PIPES];
-bool Pipe_ConfigurePipe(const uint8_t Number,
+bool Pipe_ConfigurePipeTable(const USB_Pipe_Table_t* const Table,
+ const uint8_t Entries)
+{
+ for (uint8_t i = 0; i < Entries; i++)
+ {
+ if (!(Table[i].Address))
+ continue;
+
+ if (!(Pipe_ConfigurePipe(Table[i].Address, Table[i].Type, Table[i].EndpointAddress, Table[i].Size, Table[i].Banks)))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool Pipe_ConfigurePipe(const uint8_t Address,
const uint8_t Type,
- const uint8_t Token,
- const uint8_t EndpointNumber,
+ const uint8_t EndpointAddress,
const uint16_t Size,
const uint8_t Banks)
{
+ uint8_t Number = (Address & PIPE_EPNUM_MASK);
+ uint8_t Token = (Address & PIPE_DIR_IN) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT;
+
+ if (Type == EP_TYPE_CONTROL)
+ Token = PIPE_TOKEN_SETUP;
+
USB_Pipe_FIFOPos[Number] = &AVR32_USBB_SLAVE[Number * 0x10000];
#if defined(ORDERED_EP_CONFIG)
@@ -60,7 +82,7 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
(&AVR32_USBB.upcfg0)[Number] = (AVR32_USBB_ALLOC_MASK |
((uint32_t)Type << AVR32_USBB_PTYPE_OFFSET) |
((uint32_t)Token << AVR32_USBB_PTOKEN_OFFSET) |
- ((uint32_t)Banks << AVR32_USBB_PBK_OFFSET) |
+ ((Banks > 1) ? AVR32_USBB_PBK_MASK : 0) |
Pipe_BytesToEPSizeMask(Size) |
((EndpointNumber & PIPE_EPNUM_MASK) << AVR32_USBB_PEPNUM_OFFSET));
@@ -79,9 +101,9 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
UPCFG0Temp = (AVR32_USBB_ALLOC_MASK |
((uint32_t)Type << AVR32_USBB_PTYPE_OFFSET) |
((uint32_t)Token << AVR32_USBB_PTOKEN_OFFSET) |
- ((uint32_t)Banks << AVR32_USBB_PBK_OFFSET) |
+ ((Banks > 1) ? AVR32_USBB_PBK_MASK : 0) |
Pipe_BytesToEPSizeMask(Size) |
- ((EndpointNumber & PIPE_EPNUM_MASK) << AVR32_USBB_PEPNUM_OFFSET));
+ ((EndpointAddress & PIPE_EPNUM_MASK) << AVR32_USBB_PEPNUM_OFFSET));
}
else
{
diff --git a/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h b/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h
index f17fa5376..837afe8b8 100644
--- a/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h
+++ b/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h
@@ -131,49 +131,22 @@
/** \name Pipe Token Masks */
//@{
- /** Token mask for \ref Pipe_ConfigurePipe(). This sets the pipe as a SETUP token (for CONTROL type pipes),
+ /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a SETUP token (for CONTROL type pipes),
* which will trigger a control request on the attached device when data is written to the pipe.
*/
#define PIPE_TOKEN_SETUP AVR32_USBB_UPCFG0_PTOKEN_SETUP
- /** Token mask for \ref Pipe_ConfigurePipe(). This sets the pipe as a IN token (for non-CONTROL type pipes),
+ /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a IN token (for non-CONTROL type pipes),
* indicating that the pipe data will flow from device to host.
*/
#define PIPE_TOKEN_IN AVR32_USBB_UPCFG0_PTOKEN_IN
- /** Token mask for \ref Pipe_ConfigurePipe(). This sets the pipe as a OUT token (for non-CONTROL type pipes),
+ /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a OUT token (for non-CONTROL type pipes),
* indicating that the pipe data will flow from host to device.
*/
#define PIPE_TOKEN_OUT AVR32_USBB_UPCFG0_PTOKEN_OUT
//@}
- /** \name Pipe Bank Mode Masks */
- //@{
- /** Mask for the bank mode selection for the \ref Pipe_ConfigurePipe() macro. This indicates that the pipe
- * should have one single bank, which requires less USB FIFO memory but results in slower transfers as
- * only one USB device (the AVR or the attached device) can access the pipe's bank at the one time.
- */
- #define PIPE_BANK_SINGLE AVR32_USBB_UPCFG0_PBK_SINGLE
-
- /** Mask for the bank mode selection for the \ref Pipe_ConfigurePipe() macro. This indicates that the pipe
- * should have two banks, which requires more USB FIFO memory but results in faster transfers as one
- * USB device (the AVR or the attached device) can access one bank while the other accesses the second
- * bank.
- */
- #define PIPE_BANK_DOUBLE AVR32_USBB_UPCFG0_PBK_DOUBLE
-
- #if defined(USB_SERIES_UC3A3_AVR32) || defined(USB_SERIES_UC3A4_AVR32) || defined(__DOXYGEN__)
- /** Mask for the bank mode selection for the \ref Pipe_ConfigurePipe() macro. This indicates that the
- * pipe should have three banks, which requires more USB FIFO memory but results in faster transfers
- * as one USB device (the AVR or the attached device) can access one bank while the other accesses the
- * remaining banks.
- *
- * \note Not available on all AVR models.
- */
- #define PIPE_BANK_TRIPLE AVR32_USBB_UPCFG0_PBK_TRIPLE
- #endif
- //@}
-
/** Default size of the default control pipe's bank, until altered by the Endpoint0Size value
* in the device descriptor of the attached device.
*/
@@ -224,6 +197,16 @@
return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].pbyct;
}
+ /** Determines the currently selected pipe's direction.
+ *
+ * \return The currently selected pipe's direction, as a \c PIPE_DIR_* mask.
+ */
+ static inline uint8_t Pipe_GetPipeDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline uint8_t Pipe_GetPipeDirection(void)
+ {
+ return (((&AVR32_USBB.UPCFG0)[USB_Endpoint_SelectedEndpoint].ptoken == PIPE_TOKEN_OUT) ? PIPE_DIR_OUT : PIPE_DIR_IN);
+ }
+
/** Returns the pipe address of the currently selected pipe. This is typically used to save the
* currently selected pipe number so that it can be restored after another pipe has been manipulated.
*
@@ -232,30 +215,32 @@
static inline uint8_t Pipe_GetCurrentPipe(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Pipe_GetCurrentPipe(void)
{
- return USB_Pipe_SelectedPipe;
+ return (USB_Pipe_SelectedPipe | Pipe_GetPipeDirection());
}
- /** Selects the given pipe number. Any pipe operations which do not require the pipe number to be
+ /** Selects the given pipe address. Any pipe operations which do not require the pipe address to be
* indicated will operate on the currently selected pipe.
*
- * \param[in] PipeNumber Index of the pipe to select.
+ * \param[in] Address Address of the pipe to select.
*/
- static inline void Pipe_SelectPipe(const uint8_t PipeNumber) ATTR_ALWAYS_INLINE;
- static inline void Pipe_SelectPipe(const uint8_t PipeNumber)
+ static inline void Pipe_SelectPipe(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Pipe_SelectPipe(const uint8_t Address)
{
- USB_Pipe_SelectedPipe = PipeNumber;
+ USB_Pipe_SelectedPipe = (Address & PIPE_EPNUM_MASK);
}
/** Resets the desired pipe, including the pipe banks and flags.
*
- * \param[in] PipeNumber Index of the pipe to reset.
+ * \param[in] Address Index of the pipe to reset.
*/
- static inline void Pipe_ResetPipe(const uint8_t PipeNumber) ATTR_ALWAYS_INLINE;
- static inline void Pipe_ResetPipe(const uint8_t PipeNumber)
+ static inline void Pipe_ResetPipe(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Pipe_ResetPipe(const uint8_t Address)
{
+ uint32_t PipeNumber = (Address & PIPE_EPNUM_MASK);
+
AVR32_USBB.uprst |= (AVR32_USBB_PRST0_MASK << PipeNumber);
AVR32_USBB.uprst &= ~(AVR32_USBB_PRST0_MASK << PipeNumber);
- USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe] = &AVR32_USBB_SLAVE[USB_Pipe_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
+ USB_Pipe_FIFOPos[PipeNumber] = &AVR32_USBB_SLAVE[PipeNumber * PIPE_HSB_ADDRESS_SPACE_SIZE];
}
/** Enables the currently selected pipe so that data can be sent and received through it to and from
@@ -349,7 +334,7 @@
static inline uint8_t Pipe_GetBoundEndpointAddress(void)
{
return ((&AVR32_USBB.UPCFG0)[USB_Pipe_SelectedPipe].pepnum |
- ((Pipe_GetPipeToken() == PIPE_TOKEN_IN) ? PIPE_EPDIR_MASK : 0));
+ ((Pipe_GetPipeToken() == PIPE_TOKEN_IN) ? PIPE_DIR_IN : PIPE_DIR_OUT));
}
/** Sets the period between interrupts for an INTERRUPT type pipe to a specified number of milliseconds.
@@ -376,17 +361,17 @@
AVR32_USBB_P0INT_MASK)) >> AVR32_USBB_P0INT_OFFSET);
}
- /** Determines if the specified pipe number has interrupted (valid only for INTERRUPT type
+ /** Determines if the specified pipe address has interrupted (valid only for INTERRUPT type
* pipes).
*
- * \param[in] PipeNumber Index of the pipe whose interrupt flag should be tested.
+ * \param[in] Address Address of the pipe whose interrupt flag should be tested.
*
* \return Boolean \c true if the specified pipe has interrupted, \c false otherwise.
*/
- static inline bool Pipe_HasPipeInterrupted(const uint8_t PipeNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline bool Pipe_HasPipeInterrupted(const uint8_t PipeNumber)
+ static inline bool Pipe_HasPipeInterrupted(const uint8_t Address) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
+ static inline bool Pipe_HasPipeInterrupted(const uint8_t Address)
{
- return ((AVR32_USBB.uhint & (AVR32_USBB_P0INTES_MASK << PipeNumber)) ? true : false);
+ return ((AVR32_USBB.uhint & (AVR32_USBB_P0INTES_MASK << (Address & PIPE_EPNUM_MASK))) ? true : false);
}
/** Unfreezes the selected pipe, allowing it to communicate with an attached device. */
@@ -821,8 +806,22 @@
extern uint8_t USB_Host_ControlPipeSize;
/* Function Prototypes: */
- /** Configures the specified pipe number with the given pipe type, token, target endpoint number in the
- * attached device, bank size and banking mode.
+ /** Configures a table of pipe descriptions, in sequence. This function can be used to configure multiple
+ * pipes at the same time.
+ *
+ * \note Pipe with a zero address will be ignored, thus this function cannot be used to configure the
+ * control pipe.
+ *
+ * \param[in] Table Pointer to a table of pipe descriptions.
+ * \param[in] Entries Number of entries in the pipe table to configure.
+ *
+ * \return Boolean \c true if all pipes configured successfully, \c false otherwise.
+ */
+ bool Pipe_ConfigurePipeTable(const USB_Pipe_Table_t* const Table,
+ const uint8_t Entries);
+
+ /** Configures the specified pipe address with the given pipe type, endpoint address within the attached device, bank size
+ * and number of hardware banks.
*
* A newly configured pipe is frozen by default, and must be unfrozen before use via the \ref Pipe_Unfreeze()
* before being used. Pipes should be kept frozen unless waiting for data from a device while in IN mode, or
@@ -830,25 +829,19 @@
* numbers of IN requests without automatic freezing - this can be overridden by a call to
* \ref Pipe_SetFiniteINRequests().
*
- * \param[in] Number Pipe number to configure. This must be more than 0 and less than \ref PIPE_TOTAL_PIPES.
- *
- * \param[in] Type Type of pipe to configure, an \c EP_TYPE_* mask. Not all pipe types are available on Low
- * Speed USB devices - refer to the USB 2.0 specification.
+ * \param[in] Address Pipe address to configure.
*
- * \param[in] Token Pipe data token, either \ref PIPE_TOKEN_SETUP, \ref PIPE_TOKEN_OUT or \ref PIPE_TOKEN_IN.
- * All pipes (except Control type) are unidirectional - data may only be read from or
- * written to the pipe bank based on its direction, not both.
+ * \param[in] Type Type of pipe to configure, an \c EP_TYPE_* mask. Not all pipe types are available on Low
+ * Speed USB devices - refer to the USB 2.0 specification.
*
- * \param[in] EndpointNumber Endpoint index within the attached device that the pipe should interface to.
+ * \param[in] EndpointAddress Endpoint address within the attached device that the pipe should interface to.
*
- * \param[in] Size Size of the pipe's bank, where packets are stored before they are transmitted to
- * the USB device, or after they have been received from the USB device (depending on
- * the pipe's data direction). The bank size must indicate the maximum packet size that
- * the pipe can handle.
+ * \param[in] Size Size of the pipe's bank, where packets are stored before they are transmitted to
+ * the USB device, or after they have been received from the USB device (depending on
+ * the pipe's data direction). The bank size must indicate the maximum packet size that
+ * the pipe can handle.
*
- * \param[in] Banks Number of banks to use for the pipe being configured, a \c PIPE_BANK_* mask. More banks
- * uses more USB DPRAM, but offers better performance. Isochronous type pipes <b>must</b>
- * have at least two banks.
+ * \param[in] Banks Number of banks to use for the pipe being configured.
*
* \note When the \c ORDERED_EP_CONFIG compile time option is used, Pipes <b>must</b> be configured in ascending order,
* or bank corruption will occur.
@@ -867,10 +860,9 @@
*
* \return Boolean \c true if the configuration succeeded, \c false otherwise.
*/
- bool Pipe_ConfigurePipe(const uint8_t Number,
+ bool Pipe_ConfigurePipe(const uint8_t Address,
const uint8_t Type,
- const uint8_t Token,
- const uint8_t EndpointNumber,
+ const uint8_t EndpointAddress,
const uint16_t Size,
const uint8_t Banks);
diff --git a/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c b/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c
index 95ca7d9aa..32772446e 100644
--- a/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c
+++ b/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c
@@ -191,8 +191,7 @@ static void USB_Init_Device(void)
USB_INT_Enable(USB_INT_VBUSTI);
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
- ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,
- ENDPOINT_BANK_SINGLE);
+ USB_Device_ControlEndpointSize, 1);
USB_INT_Clear(USB_INT_SUSPI);
USB_INT_Enable(USB_INT_SUSPI);
diff --git a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c
index d411a9305..a2a5c4a96 100644
--- a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c
+++ b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c
@@ -121,8 +121,7 @@ ISR(USB_GEN_vect)
USB_Device_SetDeviceAddress(0);
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
- ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,
- ENDPOINT_BANK_SINGLE);
+ USB_Device_ControlEndpointSize, 1);
#if defined(INTERRUPT_CONTROL_ENDPOINT)
USB_INT_Enable(USB_INT_RXSTPI);
diff --git a/LUFA/Drivers/USB/Core/USBController.h b/LUFA/Drivers/USB/Core/USBController.h
index a91e18c27..44a10e371 100644
--- a/LUFA/Drivers/USB/Core/USBController.h
+++ b/LUFA/Drivers/USB/Core/USBController.h
@@ -81,6 +81,24 @@
#define ENDPOINT_DIR_IN 0x80
//@}
+ /** \name Pipe Direction Masks */
+ //@{
+ /** Pipe direction mask, for masking against pipe addresses to retrieve the pipe's
+ * direction for comparing with the \c PIPE_DIR_* masks.
+ */
+ #define PIPE_DIR_MASK 0x80
+
+ /** Endpoint address direction mask for an OUT direction (Host to Device) endpoint. This may be ORed with
+ * the index of the address within a device to obtain the full endpoint address.
+ */
+ #define PIPE_DIR_OUT 0x00
+
+ /** Endpoint address direction mask for an IN direction (Device to Host) endpoint. This may be ORed with
+ * the index of the address within a device to obtain the full endpoint address.
+ */
+ #define PIPE_DIR_IN 0x80
+ //@}
+
/** \name Endpoint/Pipe Type Masks */
//@{
/** Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared
diff --git a/LUFA/Drivers/USB/Core/USBMode.h b/LUFA/Drivers/USB/Core/USBMode.h
index bc2f86dd5..56e5b5e84 100644
--- a/LUFA/Drivers/USB/Core/USBMode.h
+++ b/LUFA/Drivers/USB/Core/USBMode.h
@@ -137,6 +137,16 @@
*/
#define USB_SERIES_B3_XMEGA
+ /** Indicates that the target AVR microcontroller belongs to the XMEGA C3 Series USB controller
+ * (i.e. ATXMEGA*C3) when defined.
+ */
+ #define USB_SERIES_C3_XMEGA
+
+ /** Indicates that the target AVR microcontroller belongs to the XMEGA C4 Series USB controller
+ * (i.e. ATXMEGA*C4) when defined.
+ */
+ #define USB_SERIES_C4_XMEGA
+
/** Indicates that the target microcontroller and compilation settings allow for the
* target to be configured in USB Device mode when defined.
*/
@@ -219,6 +229,13 @@
#elif (defined(__AVR_ATxmega128B3__) || defined(__AVR_ATxmega64B3__))
#define USB_SERIES_B3_XMEGA
#define USB_CAN_BE_DEVICE
+ #elif (defined(__AVR_ATxmega128C3__) || defined(__AVR_ATxmega64C3__) || \
+ defined(__AVR_ATxmega192C3__) || defined(__AVR_ATxmega256C3__))
+ #define USB_SERIES_C3_XMEGA
+ #define USB_CAN_BE_DEVICE
+ #elif (defined(__AVR_ATxmega16C4__) || defined(__AVR_ATxmega32C4__))
+ #define USB_SERIES_C4_XMEGA
+ #define USB_CAN_BE_DEVICE
#endif
#if (defined(USB_CAN_BE_DEVICE) && defined(USB_CAN_BE_HOST))
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h
index 85be0f1bf..268fe95c0 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h
+++ b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h
@@ -157,7 +157,7 @@
static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint16_t USB_Device_GetFrameNumber(void)
{
- return USB_EndpointTable.FrameNum;
+ return ((USB_EndpointTable_t*)USB.EPPTR)->FrameNum;
}
#if !defined(NO_SOF_EVENTS)
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c
index 98e35e59a..1aeb985f8 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c
+++ b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c
@@ -48,20 +48,36 @@ volatile uint8_t USB_Endpoint_SelectedEndpoint;
volatile USB_EP_t* USB_Endpoint_SelectedHandle;
volatile Endpoint_FIFO_t* USB_Endpoint_SelectedFIFO;
-bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Number,
- const uint8_t Direction,
+bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table,
+ const uint8_t Entries)
+{
+ for (uint8_t i = 0; i < Entries; i++)
+ {
+ if (!(Table[i].Address))
+ continue;
+
+ if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks)))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Address,
const uint8_t Config,
const uint8_t Size)
{
- Endpoint_SelectEndpoint(Number | Direction);
+ Endpoint_SelectEndpoint(Address);
USB_Endpoint_SelectedHandle->CTRL = 0;
- USB_Endpoint_SelectedHandle->STATUS = (Direction == ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0;
+ USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0;
USB_Endpoint_SelectedHandle->CTRL = Config;
USB_Endpoint_SelectedHandle->CNT = 0;
USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data;
- USB_Endpoint_SelectedFIFO->Length = (Direction == ENDPOINT_DIR_IN) ? Size : 0;
+ USB_Endpoint_SelectedFIFO->Length = (Address & ENDPOINT_DIR_IN) ? Size : 0;
USB_Endpoint_SelectedFIFO->Position = 0;
return true;
@@ -71,8 +87,8 @@ void Endpoint_ClearEndpoints(void)
{
for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++)
{
- USB_EndpointTable.Endpoints[EPNum].IN.CTRL = 0;
- USB_EndpointTable.Endpoints[EPNum].OUT.CTRL = 0;
+ ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0;
+ ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0;
}
}
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
index 7828f308a..720b5f3b4 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
+++ b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
@@ -88,14 +88,20 @@
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
- /* Private Interface - For use in library only: */
- #if !defined(__DOXYGEN__)
+ /* Public Interface - May be used in end-application: */
/* Macros: */
- #define _ENDPOINT_GET_MAXSIZE(EPIndex) 1023
- #define _ENDPOINT_GET_BANKS(EPIndex) 2
-
- #define ENDPOINT_DETAILS_MAXEP 16
+ #if !defined(CONTROL_ONLY_DEVICE) || defined(__DOXYGEN__)
+ /** Total number of endpoints (including the default control endpoint at address 0) which may
+ * be used in the device. Different USB AVR models support different amounts of endpoints,
+ * this value reflects the maximum number of endpoints for the currently selected AVR model.
+ */
+ #define ENDPOINT_TOTAL_ENDPOINTS 16
+ #else
+ #define ENDPOINT_TOTAL_ENDPOINTS 1
+ #endif
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
/* Type Defines: */
typedef struct
{
@@ -112,7 +118,7 @@
} Endpoint_FIFOPair_t;
/* External Variables: */
- extern Endpoint_FIFOPair_t USB_Endpoint_FIFOs[ENDPOINT_DETAILS_MAXEP];
+ extern Endpoint_FIFOPair_t USB_Endpoint_FIFOs[ENDPOINT_TOTAL_ENDPOINTS];
extern volatile uint8_t USB_Endpoint_SelectedEndpoint;
extern volatile USB_EP_t* USB_Endpoint_SelectedHandle;
extern volatile Endpoint_FIFO_t* USB_Endpoint_SelectedFIFO;
@@ -135,8 +141,7 @@
}
/* Function Prototypes: */
- bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Number,
- const uint8_t Direction,
+ bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Address,
const uint8_t Config,
const uint8_t Size);
void Endpoint_ClearEndpoints(void);
@@ -144,23 +149,6 @@
/* Public Interface - May be used in end-application: */
/* Macros: */
- /** \name Endpoint Bank Mode Masks */
- //@{
- /** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
- * that the endpoint should have one single bank, which requires less USB FIFO memory but results
- * in slower transfers as only one USB device (the AVR or the host) can access the endpoint's
- * bank at the one time.
- */
- #define ENDPOINT_BANK_SINGLE 0
-
- /** Mask for the bank mode selection for the \ref Endpoint_ConfigureEndpoint() macro. This indicates
- * that the endpoint should have two banks, which requires more USB FIFO memory but results
- * in faster transfers as one USB device (the AVR or the host) can access one bank while the other
- * accesses the second bank.
- */
- #define ENDPOINT_BANK_DOUBLE USB_EP_PINGPONG_bm
- //@}
-
#if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
/** Default size of the default control endpoint's bank, until altered by the control endpoint bank size
* value in the device descriptor. Not available if the \c FIXED_CONTROL_ENDPOINT_SIZE token is defined.
@@ -168,34 +156,6 @@
#define ENDPOINT_CONTROLEP_DEFAULT_SIZE 8
#endif
- /** Retrieves the maximum bank size in bytes of a given endpoint.
- *
- * \attention This macro will only work correctly on endpoint indexes that are compile-time constants
- * defined by the preprocessor.
- *
- * \param[in] EPIndex Endpoint number, a value between 0 and (\ref ENDPOINT_TOTAL_ENDPOINTS - 1)
- */
- #define ENDPOINT_MAX_SIZE(EPIndex) _ENDPOINT_GET_MAXSIZE(EPIndex)
-
- /** Retrieves the total number of banks supported by the given endpoint.
- *
- * \attention This macro will only work correctly on endpoint indexes that are compile-time constants
- * defined by the preprocessor.
- *
- * \param[in] EPIndex Endpoint number, a value between 0 and (\ref ENDPOINT_TOTAL_ENDPOINTS - 1)
- */
- #define ENDPOINT_BANKS_SUPPORTED(EPIndex) _ENDPOINT_GET_BANKS(EPIndex)
-
- #if !defined(CONTROL_ONLY_DEVICE) || defined(__DOXYGEN__)
- /** Total number of endpoints (including the default control endpoint at address 0) which may
- * be used in the device. Different USB AVR models support different amounts of endpoints,
- * this value reflects the maximum number of endpoints for the currently selected AVR model.
- */
- #define ENDPOINT_TOTAL_ENDPOINTS ENDPOINT_DETAILS_MAXEP
- #else
- #define ENDPOINT_TOTAL_ENDPOINTS 1
- #endif
-
/* Enums: */
/** Enum for the possible error return codes of the \ref Endpoint_WaitUntilReady() function.
*
@@ -221,54 +181,47 @@
};
/* Inline Functions: */
- /** Selects the given endpoint number. If the address from the device descriptors is used, the
- * value should be masked with the \ref ENDPOINT_EPNUM_MASK constant to extract only the endpoint
- * number (and discarding the endpoint direction bit).
+ /** Selects the given endpoint address.
*
- * Any endpoint operations which do not require the endpoint number to be indicated will operate on
+ * Any endpoint operations which do not require the endpoint address to be indicated will operate on
* the currently selected endpoint.
*
- * \param[in] EndpointNumber Endpoint number to select.
+ * \param[in] Address Endpoint address to select.
*/
- static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber);
- static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber)
+ static inline void Endpoint_SelectEndpoint(const uint8_t Address);
+ static inline void Endpoint_SelectEndpoint(const uint8_t Address)
{
- USB_Endpoint_SelectedEndpoint = EndpointNumber;
+ uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK);
+
+ USB_Endpoint_SelectedEndpoint = Address;
- if (EndpointNumber & ENDPOINT_DIR_IN)
+ if (Address & ENDPOINT_DIR_IN)
{
- USB_Endpoint_SelectedFIFO = &USB_Endpoint_FIFOs[EndpointNumber & ENDPOINT_EPNUM_MASK].IN;
- USB_Endpoint_SelectedHandle = &USB_EndpointTable.Endpoints[EndpointNumber & ENDPOINT_EPNUM_MASK].IN;
+ USB_Endpoint_SelectedFIFO = &USB_Endpoint_FIFOs[EndpointNumber].IN;
+ USB_Endpoint_SelectedHandle = &((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EndpointNumber].IN;
}
else
{
- USB_Endpoint_SelectedFIFO = &USB_Endpoint_FIFOs[EndpointNumber & ENDPOINT_EPNUM_MASK].OUT;
- USB_Endpoint_SelectedHandle = &USB_EndpointTable.Endpoints[EndpointNumber & ENDPOINT_EPNUM_MASK].OUT;
+ USB_Endpoint_SelectedFIFO = &USB_Endpoint_FIFOs[EndpointNumber].OUT;
+ USB_Endpoint_SelectedHandle = &((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EndpointNumber].OUT;
}
}
- /** Configures the specified endpoint number with the given endpoint type, direction, bank size
+ /** Configures the specified endpoint address with the given endpoint type, direction, bank size
* and banking mode. Once configured, the endpoint may be read from or written to, depending
* on its direction.
*
- * \param[in] Number Endpoint number to configure. This must be more than 0 and less than
- * \ref ENDPOINT_TOTAL_ENDPOINTS.
+ * \param[in] Address Endpoint address to configure.
*
* \param[in] Type Type of endpoint to configure, a \c EP_TYPE_* mask. Not all endpoint types
* are available on Low Speed USB devices - refer to the USB 2.0 specification.
*
- * \param[in] Direction Endpoint data direction, either \ref ENDPOINT_DIR_OUT or \ref ENDPOINT_DIR_IN.
- * All endpoints (except Control type) are unidirectional - data may only be read
- * from or written to the endpoint bank based on its direction, not both.
- *
* \param[in] Size Size of the endpoint's bank, where packets are stored before they are transmitted
* to the USB host, or after they have been received from the USB host (depending on
* the endpoint's data direction). The bank size must indicate the maximum packet size
* that the endpoint can handle.
*
- * \param[in] Banks Number of banks to use for the endpoint being configured, an \c ENDPOINT_BANK_* mask.
- * More banks uses more USB DPRAM, but offers better performance. Isochronous type
- * endpoints <b>must</b> have at least two banks.
+ * \param[in] Banks Number of hardware banks to use for the endpoint being configured.
*
* \note The default control endpoint should not be manually configured by the user application, as
* it is automatically configured by the library internally.
@@ -278,21 +231,19 @@
*
* \return Boolean \c true if the configuration succeeded, \c false otherwise.
*/
- static inline bool Endpoint_ConfigureEndpoint(const uint8_t Number,
+ static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address,
const uint8_t Type,
- const uint8_t Direction,
const uint16_t Size,
const uint8_t Banks) ATTR_ALWAYS_INLINE;
- static inline bool Endpoint_ConfigureEndpoint(const uint8_t Number,
+ static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address,
const uint8_t Type,
- const uint8_t Direction,
const uint16_t Size,
const uint8_t Banks)
{
- uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | Banks | Endpoint_BytesToEPSizeMask(Size));
+ uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size));
// TODO - Fix once limitations are lifted
- if ((Banks != ENDPOINT_BANK_SINGLE) || (Size > 64))
+ if ((Banks > 1) || (Size > 64))
return false;
switch (Type)
@@ -309,9 +260,9 @@
}
if (Type == EP_TYPE_CONTROL)
- Endpoint_ConfigureEndpoint_PRV(Number, (Direction ^ ENDPOINT_DIR_IN), EPConfigMask, Size);
+ Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size);
- return Endpoint_ConfigureEndpoint_PRV(Number, Direction, EPConfigMask, Size);
+ return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size);
}
/** Indicates the number of bytes currently stored in the current endpoint's selected bank.
@@ -327,8 +278,8 @@
}
/** Get the endpoint address of the currently selected endpoint. This is typically used to save
- * the currently selected endpoint number so that it can be restored after another endpoint has
- * been manipulated.
+ * the currently selected endpoint so that it can be restored after another endpoint has been
+ * manipulated.
*
* \return Index of the currently selected endpoint.
*/
@@ -341,15 +292,15 @@
/** Resets the endpoint bank FIFO. This clears all the endpoint banks and resets the USB controller's
* data In and Out pointers to the bank's contents.
*
- * \param[in] EndpointNumber Endpoint number whose FIFO buffers are to be reset.
+ * \param[in] Address Endpoint address whose FIFO buffers are to be reset.
*/
- static inline void Endpoint_ResetEndpoint(const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE;
- static inline void Endpoint_ResetEndpoint(const uint8_t EndpointNumber)
+ static inline void Endpoint_ResetEndpoint(const uint8_t Address) ATTR_ALWAYS_INLINE;
+ static inline void Endpoint_ResetEndpoint(const uint8_t Address)
{
- if (EndpointNumber & ENDPOINT_DIR_IN)
- USB_Endpoint_FIFOs[EndpointNumber & ENDPOINT_EPNUM_MASK].IN.Position = 0;
+ if (Address & ENDPOINT_DIR_IN)
+ USB_Endpoint_FIFOs[Address & ENDPOINT_EPNUM_MASK].IN.Position = 0;
else
- USB_Endpoint_FIFOs[EndpointNumber & ENDPOINT_EPNUM_MASK].OUT.Position = 0;
+ USB_Endpoint_FIFOs[Address & ENDPOINT_EPNUM_MASK].OUT.Position = 0;
}
/** Determines if the currently selected endpoint is enabled, but not necessarily configured.
@@ -388,10 +339,7 @@
static inline bool Endpoint_IsReadWriteAllowed(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsReadWriteAllowed(void)
{
- if (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN)
- return (USB_Endpoint_SelectedFIFO->Position < USB_Endpoint_SelectedFIFO->Length);
- else
- return (USB_Endpoint_SelectedFIFO->Position > 0);
+ return (USB_Endpoint_SelectedFIFO->Position < USB_Endpoint_SelectedFIFO->Length);
}
/** Determines if the currently selected endpoint is configured.
@@ -404,32 +352,6 @@
return ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) ? true : false);
}
- /** Returns a mask indicating which INTERRUPT type endpoints have interrupted - i.e. their
- * interrupt duration has elapsed. Which endpoints have interrupted can be determined by
- * masking the return value against <tt>(1 << <i>{Endpoint Number}</i>)</tt>.
- *
- * \return Mask whose bits indicate which endpoints have interrupted.
- */
- static inline uint8_t Endpoint_GetEndpointInterrupts(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline uint8_t Endpoint_GetEndpointInterrupts(void)
- {
- return 0; // TODO
- }
-
- /** Determines if the specified endpoint number has interrupted (valid only for INTERRUPT type
- * endpoints).
- *
- * \param[in] EndpointNumber Index of the endpoint whose interrupt flag should be tested.
- *
- * \return Boolean \c true if the specified endpoint has interrupted, \c false otherwise.
- */
- static inline bool Endpoint_HasEndpointInterrupted(const uint8_t EndpointNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
- static inline bool Endpoint_HasEndpointInterrupted(const uint8_t EndpointNumber)
- {
- (void)EndpointNumber;
- return 0; // TODO
- }
-
/** Determines if the selected IN endpoint is ready for a new packet to be sent to the host.
*
* \ingroup Group_EndpointPacketManagement_XMEGA
@@ -800,6 +722,20 @@
#endif
/* Function Prototypes: */
+ /** Configures a table of endpoint descriptions, in sequence. This function can be used to configure multiple
+ * endpoints at the same time.
+ *
+ * \note Endpoints with a zero address will be ignored, thus this function cannot be used to configure the
+ * control endpoint.
+ *
+ * \param[in] Table Pointer to a table of endpoint descriptions.
+ * \param[in] Entries Number of entries in the endpoint table to configure.
+ *
+ * \return Boolean \c true if all endpoints configured successfully, \c false otherwise.
+ */
+ bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table,
+ const uint8_t Entries);
+
/** Completes the status stage of a control transfer on a CONTROL type endpoint automatically,
* with respect to the data direction. This is a convenience function which can be used to
* simplify user control request handling.
diff --git a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c
index 387e8e417..ffdca3adf 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c
+++ b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c
@@ -43,7 +43,8 @@ volatile uint8_t USB_CurrentMode = USB_MODE_None;
volatile uint8_t USB_Options;
#endif
-USB_EndpointTable_t USB_EndpointTable ATTR_ALIGNED(4);
+/* Ugly workaround to ensure an aligned table, since __BIGGEST_ALIGNMENT__ == 1 for 8-bit AVR-GCC */
+uint8_t USB_EndpointTable[sizeof(USB_EndpointTable_t) + 1];
void USB_Init(
#if defined(USB_CAN_BE_BOTH)
@@ -75,8 +76,9 @@ void USB_Init(
USB.CAL1 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL1));
NVM.CMD = 0;
- USB.EPPTR = (intptr_t)&USB_EndpointTable;
- USB.CTRLA = (USB_STFRNUM_bm | USB_MAXEP_gm);
+ /* Ugly workaround to ensure an aligned table, since __BIGGEST_ALIGNMENT__ == 1 for 8-bit AVR-GCC */
+ USB.EPPTR = ((intptr_t)&USB_EndpointTable[1] & ~(1 << 0));
+ USB.CTRLA = (USB_STFRNUM_bm | ((ENDPOINT_TOTAL_ENDPOINTS - 1) << USB_MAXEP_gp));
if ((USB_Options & USB_OPT_BUSEVENT_PRIHIGH) == USB_OPT_BUSEVENT_PRIHIGH)
USB.INTCTRLA = (3 << USB_INTLVL_gp);
@@ -109,7 +111,7 @@ void USB_ResetInterface(void)
CLK.USBCTRL = (((F_USB / 48000000) - 1) << CLK_USBPSDIV_gp);
if (USB_Options & USB_OPT_PLLCLKSRC)
- CLK.USBCTRL |= (CLK_USBSRC_PLL_gc | CLK_USBSEN_bm);
+ CLK.USBCTRL |= (CLK_USBSRC_PLL_gc | CLK_USBSEN_bm);
else
CLK.USBCTRL |= (CLK_USBSRC_RC32M_gc | CLK_USBSEN_bm);
@@ -172,8 +174,7 @@ static void USB_Init_Device(void)
USB_Device_SetFullSpeed();
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
- ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,
- ENDPOINT_BANK_SINGLE);
+ USB_Device_ControlEndpointSize, 1);
USB_INT_Enable(USB_INT_BUSEVENTI);
diff --git a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h
index 2f14f758a..1cdb6f03c 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h
+++ b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h
@@ -69,7 +69,7 @@
} ATTR_PACKED USB_EndpointTable_t;
/* External Variables: */
- extern USB_EndpointTable_t USB_EndpointTable;
+ extern uint8_t USB_EndpointTable[];
#endif
diff --git a/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c b/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c
index b0e52d06e..3554165c1 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c
+++ b/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c
@@ -97,8 +97,7 @@ ISR(USB_BUSEVENT_vect)
Endpoint_ClearEndpoints();
Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
- ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,
- ENDPOINT_BANK_SINGLE);
+ USB_Device_ControlEndpointSize, 1);
EVENT_USB_Device_Reset();
}
diff --git a/LUFA/Drivers/USB/USB.h b/LUFA/Drivers/USB/USB.h
index 35b285c6d..c99c1d267 100644
--- a/LUFA/Drivers/USB/USB.h
+++ b/LUFA/Drivers/USB/USB.h
@@ -166,9 +166,12 @@
* .Config =
* {
* .StreamingInterfaceNumber = 1,
- *
- * .DataINEndpointNumber = 1,
- * .DataINEndpointSize = 256,
+ * .DataINEndpoint =
+ * {
+ * .Address = (ENDPOINT_DIR_IN | 1),
+ * .Size = 64,
+ * .Banks = 1,
+ * },
* },
* };
* \endcode
@@ -262,11 +265,18 @@
* {
* .Config =
* {
- * .DataINPipeNumber = 1,
- * .DataINPipeDoubleBank = false,
- *
- * .DataOUTPipeNumber = 2,
- * .DataOUTPipeDoubleBank = false,
+ * .DataINPipe =
+ * {
+ * .Address = (PIPE_DIR_IN | 1),
+ * .Size = 64,
+ * .Banks = 1,
+ * },
+ * .DataOUTPipe =
+ * {
+ * .Address = (PIPE_DIR_OUT | 2),
+ * .Size = 64,
+ * .Banks = 1,
+ * },
* },
* };
* \endcode
diff --git a/LUFA/Platform/XMEGA/ClockManagement.h b/LUFA/Platform/XMEGA/ClockManagement.h
index dcde7dcdb..9b3b56244 100644
--- a/LUFA/Platform/XMEGA/ClockManagement.h
+++ b/LUFA/Platform/XMEGA/ClockManagement.h
@@ -53,13 +53,13 @@
*
* void main(void)
* {
- * // Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it
- * XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, 32000000);
- * XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL, F_CPU);
+ * // Start the PLL to multiply the 2MHz RC oscillator to F_CPU and switch the CPU core to run from it
+ * XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ * XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
*
- * // Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference
+ * // Start the 32MHz internal RC oscillator and start the DFLL to increase it to F_USB using the USB SOF as a reference
* XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
- * XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, 48000000);
+ * XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
* }
* \endcode
*
@@ -117,6 +117,26 @@
};
/* Inline Functions: */
+ /** Write a value to a location protected by the XMEGA CCP protection mechanism. This function uses inline assembly to ensure that
+ * the protected address is written to within four clock cycles of the CCP key being written.
+ *
+ * \param[in] Address Address to write to, a memory address protected by the CCP mechanism
+ * \param[in] Value Value to write to the protected location
+ */
+ static inline void XMEGACLK_CCP_Write(volatile void* Address, const uint8_t Value) ATTR_ALWAYS_INLINE;
+ static inline void XMEGACLK_CCP_Write(volatile void* Address, const uint8_t Value)
+ {
+ __asm__ __volatile__ (
+ "out %0, __zero_reg__" "\n\t" /* Zero RAMPZ using fixed zero value register */
+ "movw r30, %1" "\n\t" /* Copy address to Z register pair */
+ "out %2, %3" "\n\t" /* Write key to CCP register */
+ "st Z, %4" "\n\t" /* Indirectly write value to address */
+ : /* No output operands */
+ : /* Input operands: */ "m" (RAMPZ), "e" (Address), "m" (CCP), "r" (CCP_IOREG_gc), "r" (Value)
+ : /* Clobbered registers: */ "r30", "r31"
+ );
+ }
+
/** Starts the external oscillator of the XMEGA microcontroller, with the given options. This routine blocks until
* the oscillator is ready for use.
*
@@ -219,6 +239,9 @@
if (SourceFreq > Frequency)
return false;
+
+ if (MulFactor > 31)
+ return false;
switch (Source)
{
@@ -355,8 +378,7 @@
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
- CCP = CCP_IOREG_gc;
- CLK_CTRL = ClockSourceMask;
+ XMEGACLK_CCP_Write(&CLK.CTRL, ClockSourceMask);
SetGlobalInterruptMask(CurrentGlobalInt);
diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.c b/Projects/AVRISP-MKII/AVRISP-MKII.c
index 760193ab0..eaf04cb7a 100644
--- a/Projects/AVRISP-MKII/AVRISP-MKII.c
+++ b/Projects/AVRISP-MKII/AVRISP-MKII.c
@@ -93,12 +93,10 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup AVRISP Data Endpoint(s) */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- AVRISP_DATA_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
#if defined(LIBUSB_DRIVER_COMPAT)
- ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- AVRISP_DATA_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
#endif
/* Indicate endpoint configuration success or failure */
@@ -114,7 +112,7 @@ void AVRISP_Task(void)
V2Params_UpdateParamValues();
- Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPADDR);
/* Check to see if a V2 Protocol command has been received */
if (Endpoint_IsOUTReceived())
diff --git a/Projects/AVRISP-MKII/Descriptors.c b/Projects/AVRISP-MKII/Descriptors.c
index 12f44f9e2..da57b7113 100644
--- a/Projects/AVRISP-MKII/Descriptors.c
+++ b/Projects/AVRISP-MKII/Descriptors.c
@@ -106,7 +106,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | AVRISP_DATA_IN_EPNUM),
+ .EndpointAddress = AVRISP_DATA_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AVRISP_DATA_EPSIZE,
.PollingIntervalMS = 0x0A
@@ -116,7 +116,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | AVRISP_DATA_OUT_EPNUM),
+ .EndpointAddress = AVRISP_DATA_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AVRISP_DATA_EPSIZE,
.PollingIntervalMS = 0x0A
diff --git a/Projects/AVRISP-MKII/Descriptors.h b/Projects/AVRISP-MKII/Descriptors.h
index 5a994ba19..1b140f30d 100644
--- a/Projects/AVRISP-MKII/Descriptors.h
+++ b/Projects/AVRISP-MKII/Descriptors.h
@@ -42,18 +42,15 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- #if !defined(LIBUSB_DRIVER_COMPAT)
- /** Endpoint number of the AVRISP data OUT endpoint. */
- #define AVRISP_DATA_OUT_EPNUM 2
+ #if !defined(LIBUSB_DRIVER_COMPAT) || defined(__DOXYGEN__)
+ /** Endpoint address of the AVRISP data OUT endpoint. */
+ #define AVRISP_DATA_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
- /** Endpoint number of the AVRISP data IN endpoint. */
- #define AVRISP_DATA_IN_EPNUM 2
+ /** Endpoint address of the AVRISP data IN endpoint. */
+ #define AVRISP_DATA_IN_EPADDR (ENDPOINT_DIR_IN | 2)
#else
- /** Endpoint number of the AVRISP data OUT endpoint. */
- #define AVRISP_DATA_OUT_EPNUM 2
-
- /** Endpoint number of the AVRISP data IN endpoint. */
- #define AVRISP_DATA_IN_EPNUM 3
+ #define AVRISP_DATA_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
+ #define AVRISP_DATA_IN_EPADDR (ENDPOINT_DIR_IN | 3)
#endif
/** Size in bytes of the AVRISP data endpoint. */
diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c
index f757ac143..445e088d2 100644
--- a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c
+++ b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c
@@ -57,7 +57,7 @@ void ISPProtocol_EnterISPMode(void)
Endpoint_Read_Stream_LE(&Enter_ISP_Params, sizeof(Enter_ISP_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t ResponseStatus = STATUS_CMD_FAILED;
@@ -115,7 +115,7 @@ void ISPProtocol_LeaveISPMode(void)
Endpoint_Read_Stream_LE(&Leave_ISP_Params, sizeof(Leave_ISP_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
/* Perform pre-exit delay, release the target /RESET, disable the SPI bus and perform the post-exit delay */
@@ -154,7 +154,7 @@ void ISPProtocol_ProgramMemory(uint8_t V2Command)
if (Write_Memory_Params.BytesToWrite > sizeof(Write_Memory_Params.ProgData))
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(V2Command);
@@ -175,7 +175,7 @@ void ISPProtocol_ProgramMemory(uint8_t V2Command)
}
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t ProgrammingStatus = STATUS_CMD_OK;
@@ -295,7 +295,7 @@ void ISPProtocol_ReadMemory(uint8_t V2Command)
Read_Memory_Params.BytesToRead = SwapEndian_16(Read_Memory_Params.BytesToRead);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(V2Command);
@@ -368,7 +368,7 @@ void ISPProtocol_ChipErase(void)
Endpoint_Read_Stream_LE(&Erase_Chip_Params, sizeof(Erase_Chip_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t ResponseStatus = STATUS_CMD_OK;
@@ -404,7 +404,7 @@ void ISPProtocol_ReadFuseLockSigOSCCAL(uint8_t V2Command)
Endpoint_Read_Stream_LE(&Read_FuseLockSigOSCCAL_Params, sizeof(Read_FuseLockSigOSCCAL_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t ResponseBytes[4];
@@ -435,7 +435,7 @@ void ISPProtocol_WriteFuseLock(uint8_t V2Command)
Endpoint_Read_Stream_LE(&Write_FuseLockSig_Params, sizeof(Write_FuseLockSig_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
/* Send the Fuse or Lock byte program commands as given by the host to the device */
@@ -463,7 +463,7 @@ void ISPProtocol_SPIMulti(void)
Endpoint_Read_Stream_LE(&SPI_Multi_Params.TxData, SPI_Multi_Params.TxBytes, NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(CMD_SPI_MULTI);
diff --git a/Projects/AVRISP-MKII/Lib/V2Protocol.c b/Projects/AVRISP-MKII/Lib/V2Protocol.c
index f48581051..e7c43cd01 100644
--- a/Projects/AVRISP-MKII/Lib/V2Protocol.c
+++ b/Projects/AVRISP-MKII/Lib/V2Protocol.c
@@ -150,7 +150,7 @@ void V2Protocol_ProcessCommand(void)
TCCR0B = 0;
Endpoint_WaitUntilReady();
- Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_OUT);
}
@@ -169,7 +169,7 @@ static void V2Protocol_UnknownCommand(const uint8_t V2Command)
}
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(V2Command);
@@ -181,7 +181,7 @@ static void V2Protocol_UnknownCommand(const uint8_t V2Command)
static void V2Protocol_SignOn(void)
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(CMD_SIGN_ON);
@@ -197,7 +197,7 @@ static void V2Protocol_SignOn(void)
static void V2Protocol_ResetProtection(void)
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(CMD_RESET_PROTECTION);
@@ -220,7 +220,7 @@ static void V2Protocol_GetSetParam(const uint8_t V2Command)
ParamValue = Endpoint_Read_8();
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(V2Command);
@@ -254,7 +254,7 @@ static void V2Protocol_LoadAddress(void)
Endpoint_Read_Stream_BE(&CurrentAddress, sizeof(CurrentAddress), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
if (CurrentAddress & (1UL << 31))
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
index d34273093..ad8cd530a 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
@@ -65,7 +65,7 @@ void XPROGProtocol_SetMode(void)
Endpoint_Read_Stream_LE(&SetMode_XPROG_Params, sizeof(SetMode_XPROG_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
XPROG_SelectedProtocol = SetMode_XPROG_Params.Protocol;
@@ -112,7 +112,7 @@ void XPROGProtocol_Command(void)
static void XPROGProtocol_EnterXPROGMode(void)
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
bool NVMBusEnabled = false;
@@ -134,7 +134,7 @@ static void XPROGProtocol_EnterXPROGMode(void)
static void XPROGProtocol_LeaveXPROGMode(void)
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
@@ -169,7 +169,7 @@ static void XPROGProtocol_Erase(void)
Erase_XPROG_Params.Address = SwapEndian_32(Erase_XPROG_Params.Address);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t EraseCommand;
@@ -260,7 +260,7 @@ static void XPROGProtocol_WriteMemory(void)
}
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
@@ -342,7 +342,7 @@ static void XPROGProtocol_ReadMemory(void)
ReadMemory_XPROG_Params.Length = SwapEndian_16(ReadMemory_XPROG_Params.Length);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint8_t ReadBuffer[256];
@@ -385,7 +385,7 @@ static void XPROGProtocol_ReadCRC(void)
Endpoint_Read_Stream_LE(&ReadCRC_XPROG_Params, sizeof(ReadCRC_XPROG_Params), NULL);
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
uint32_t MemoryCRC;
@@ -467,7 +467,7 @@ static void XPROGProtocol_SetParam(void)
}
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPADDR);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
Endpoint_Write_8(CMD_XPROG);
diff --git a/Projects/Benito/Benito.c b/Projects/Benito/Benito.c
index 8d9ac5302..d68cee3c9 100644
--- a/Projects/Benito/Benito.c
+++ b/Projects/Benito/Benito.c
@@ -62,19 +62,25 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{
.Config =
{
- .ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
+ .ControlInterfaceNumber = 0,
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
},
};
diff --git a/Projects/Benito/Descriptors.c b/Projects/Benito/Descriptors.c
index 86d8c4d0c..2990848eb 100644
--- a/Projects/Benito/Descriptors.c
+++ b/Projects/Benito/Descriptors.c
@@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -167,7 +167,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/Benito/Descriptors.h b/Projects/Benito/Descriptors.h
index 03f4e5e7a..e481793b0 100644
--- a/Projects/Benito/Descriptors.h
+++ b/Projects/Benito/Descriptors.h
@@ -42,14 +42,14 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 3
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 4
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Projects/HIDReportViewer/HIDReportViewer.c b/Projects/HIDReportViewer/HIDReportViewer.c
index c0cc11f67..fa44c0843 100644
--- a/Projects/HIDReportViewer/HIDReportViewer.c
+++ b/Projects/HIDReportViewer/HIDReportViewer.c
@@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Device_HID_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.HIDInterfaceProtocol = HID_CSCP_NonBootProtocol,
-
.HIDParserData = &HIDReportInfo
},
};
diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c
index a3319e4ab..e674c93e0 100644
--- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c
+++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c
@@ -120,7 +120,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ .EndpointAddress = MASS_STORAGE_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -130,7 +130,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ .EndpointAddress = MASS_STORAGE_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.h b/Projects/Incomplete/StandaloneProgrammer/Descriptors.h
index 250fcf79b..c0e8f46d7 100644
--- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.h
+++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.h
@@ -42,14 +42,14 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 5
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 5)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 1
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 2
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 2)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
@@ -57,11 +57,11 @@
/** Size in bytes of the CDC data IN and OUT endpoints. */
#define CDC_TXRX_EPSIZE 16
- /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
- #define MASS_STORAGE_IN_EPNUM 3
+ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */
+ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
- #define MASS_STORAGE_OUT_EPNUM 4
+ /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */
+ #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the Mass Storage data endpoints. */
#define MASS_STORAGE_IO_EPSIZE 64
diff --git a/Projects/Incomplete/StandaloneProgrammer/DiskDevice.c b/Projects/Incomplete/StandaloneProgrammer/DiskDevice.c
index bc70910e7..73bf5545a 100644
--- a/Projects/Incomplete/StandaloneProgrammer/DiskDevice.c
+++ b/Projects/Incomplete/StandaloneProgrammer/DiskDevice.c
@@ -40,15 +40,18 @@ USB_ClassInfo_MS_Device_t DiskDevice_MS_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
- .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
- .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
+ .DataINEndpoint =
+ {
+ .Address = MASS_STORAGE_IN_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MASS_STORAGE_OUT_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
.TotalLUNs = 1,
},
};
diff --git a/Projects/Incomplete/StandaloneProgrammer/DiskHost.c b/Projects/Incomplete/StandaloneProgrammer/DiskHost.c
index 1dafda43b..c93029c06 100644
--- a/Projects/Incomplete/StandaloneProgrammer/DiskHost.c
+++ b/Projects/Incomplete/StandaloneProgrammer/DiskHost.c
@@ -39,11 +39,16 @@ USB_ClassInfo_MS_Host_t DiskHost_MS_Interface =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
},
};
diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
index cac0bd957..d953875a2 100644
--- a/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
+++ b/Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
@@ -5,7 +5,7 @@
#include "diskio.h"
#include <string.h>
-#include <LUFA/Drivers/USB/Class/MassStorage.h>
+#include <LUFA/Drivers/USB/USB.h>
#include "../DataflashManager.h"
#include "../../DiskHost.h"
diff --git a/Projects/LEDNotifier/Descriptors.c b/Projects/LEDNotifier/Descriptors.c
index e362857b4..9dda9e699 100644
--- a/Projects/LEDNotifier/Descriptors.c
+++ b/Projects/LEDNotifier/Descriptors.c
@@ -143,7 +143,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -169,7 +169,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -179,7 +179,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/LEDNotifier/Descriptors.h b/Projects/LEDNotifier/Descriptors.h
index 03f4e5e7a..e481793b0 100644
--- a/Projects/LEDNotifier/Descriptors.h
+++ b/Projects/LEDNotifier/Descriptors.h
@@ -42,14 +42,14 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 3
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 4
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Projects/LEDNotifier/LEDNotifier.c b/Projects/LEDNotifier/LEDNotifier.c
index 34f29e124..dd3a8ae3a 100644
--- a/Projects/LEDNotifier/LEDNotifier.c
+++ b/Projects/LEDNotifier/LEDNotifier.c
@@ -44,19 +44,25 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{
.Config =
{
- .ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
+ .ControlInterfaceNumber = 0,
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
},
};
diff --git a/Projects/MIDIToneGenerator/Descriptors.c b/Projects/MIDIToneGenerator/Descriptors.c
index 9ad0e86a5..84898acf6 100644
--- a/Projects/MIDIToneGenerator/Descriptors.c
+++ b/Projects/MIDIToneGenerator/Descriptors.c
@@ -199,7 +199,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
+ .EndpointAddress = MIDI_STREAM_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MIDI_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
@@ -224,7 +224,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM),
+ .EndpointAddress = MIDI_STREAM_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MIDI_STREAM_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/MIDIToneGenerator/Descriptors.h b/Projects/MIDIToneGenerator/Descriptors.h
index c5dc2e217..83844449d 100644
--- a/Projects/MIDIToneGenerator/Descriptors.h
+++ b/Projects/MIDIToneGenerator/Descriptors.h
@@ -42,11 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
- #define MIDI_STREAM_IN_EPNUM 2
+ /** Endpoint address of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
+ #define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
- #define MIDI_STREAM_OUT_EPNUM 1
+ /** Endpoint address of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
+ #define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | 1)
/** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */
#define MIDI_STREAM_EPSIZE 64
diff --git a/Projects/MIDIToneGenerator/MIDIToneGenerator.c b/Projects/MIDIToneGenerator/MIDIToneGenerator.c
index 4062bffab..2a9d5c3c0 100644
--- a/Projects/MIDIToneGenerator/MIDIToneGenerator.c
+++ b/Projects/MIDIToneGenerator/MIDIToneGenerator.c
@@ -45,14 +45,18 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
.Config =
{
.StreamingInterfaceNumber = 1,
-
- .DataINEndpointNumber = MIDI_STREAM_IN_EPNUM,
- .DataINEndpointSize = MIDI_STREAM_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = MIDI_STREAM_OUT_EPNUM,
- .DataOUTEndpointSize = MIDI_STREAM_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
+ .DataINEndpoint =
+ {
+ .Address = MIDI_STREAM_IN_EPADDR,
+ .Size = MIDI_STREAM_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MIDI_STREAM_OUT_EPADDR,
+ .Size = MIDI_STREAM_EPSIZE,
+ .Banks = 1,
+ },
},
};
diff --git a/Projects/Magstripe/Descriptors.c b/Projects/Magstripe/Descriptors.c
index aec8b880d..b031d5403 100644
--- a/Projects/Magstripe/Descriptors.c
+++ b/Projects/Magstripe/Descriptors.c
@@ -132,7 +132,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_EPNUM),
+ .EndpointAddress = KEYBOARD_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/Magstripe/Descriptors.h b/Projects/Magstripe/Descriptors.h
index 27ea9a1c5..f90816a82 100644
--- a/Projects/Magstripe/Descriptors.h
+++ b/Projects/Magstripe/Descriptors.h
@@ -58,8 +58,8 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the keyboard key press reporting endpoint. */
- #define KEYBOARD_EPNUM 1
+ /** Endpoint address of the keyboard key press reporting endpoint. */
+ #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size of the keyboard report endpoints, in bytes. */
#define KEYBOARD_EPSIZE 8
diff --git a/Projects/Magstripe/Magstripe.c b/Projects/Magstripe/Magstripe.c
index 6e41ce67f..ecdf68b0b 100644
--- a/Projects/Magstripe/Magstripe.c
+++ b/Projects/Magstripe/Magstripe.c
@@ -57,11 +57,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = KEYBOARD_EPNUM,
- .ReportINEndpointSize = KEYBOARD_EPSIZE,
- .ReportINEndpointDoubleBank = KEYBOARD_EPSIZE,
-
+ .ReportINEndpoint =
+ {
+ .Address = KEYBOARD_EPADDR,
+ .Size = KEYBOARD_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevKeyboardHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer),
},
diff --git a/Projects/MediaController/Descriptors.c b/Projects/MediaController/Descriptors.c
index fc862aa90..7ba467c28 100644
--- a/Projects/MediaController/Descriptors.c
+++ b/Projects/MediaController/Descriptors.c
@@ -149,7 +149,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MEDIACONTROL_HID_EPNUM),
+ .EndpointAddress = MEDIACONTROL_HID_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MEDIACONTROL_HID_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/MediaController/Descriptors.h b/Projects/MediaController/Descriptors.h
index ec9b33082..3844e3138 100644
--- a/Projects/MediaController/Descriptors.h
+++ b/Projects/MediaController/Descriptors.h
@@ -57,11 +57,11 @@
} USB_Descriptor_Configuration_t;
/* Macros: */
- /** Endpoint number of the Media Control HID reporting IN endpoint. */
- #define MEDIACONTROL_HID_EPNUM 1
+ /** Endpoint address of the Media Control HID reporting IN endpoint. */
+ #define MEDIACONTROL_HID_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Size in bytes of the Media Control HID reporting IN and OUT endpoints. */
- #define MEDIACONTROL_HID_EPSIZE 8
+ /** Size in bytes of the Media Control HID reporting IN endpoint. */
+ #define MEDIACONTROL_HID_EPSIZE 8
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
diff --git a/Projects/MediaController/MediaController.c b/Projects/MediaController/MediaController.c
index 01405270a..24f02580d 100644
--- a/Projects/MediaController/MediaController.c
+++ b/Projects/MediaController/MediaController.c
@@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t MediaControl_HID_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .ReportINEndpointNumber = MEDIACONTROL_HID_EPNUM,
- .ReportINEndpointSize = MEDIACONTROL_HID_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = MEDIACONTROL_HID_EPADDR,
+ .Size = MEDIACONTROL_HID_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevMediaControlHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevMediaControlHIDReportBuffer),
},
diff --git a/Projects/MissileLauncher/ConfigDescriptor.c b/Projects/MissileLauncher/ConfigDescriptor.c
index efcd2be5c..e287d78d3 100644
--- a/Projects/MissileLauncher/ConfigDescriptor.c
+++ b/Projects/MissileLauncher/ConfigDescriptor.c
@@ -109,16 +109,14 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the HID data IN pipe */
- Pipe_ConfigurePipe(HID_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(HID_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS);
/* Check if the HID interface contained an optional OUT data endpoint */
if (DataOUTEndpoint)
{
/* Configure the HID data OUT pipe */
- Pipe_ConfigurePipe(HID_DATA_OUT_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(HID_DATA_OUT_PIPE, EP_TYPE_INTERRUPT, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
}
/* Valid data found, return success */
diff --git a/Projects/MissileLauncher/ConfigDescriptor.h b/Projects/MissileLauncher/ConfigDescriptor.h
index b05f7efe4..c857bf7c0 100644
--- a/Projects/MissileLauncher/ConfigDescriptor.h
+++ b/Projects/MissileLauncher/ConfigDescriptor.h
@@ -45,11 +45,11 @@
/** Interface Class value for the Human Interface Device class. */
#define HID_CLASS 0x03
- /** Pipe number for the HID data IN pipe. */
- #define HID_DATA_IN_PIPE 1
+ /** Pipe address for the HID data IN pipe. */
+ #define HID_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number for the HID data OUT pipe. */
- #define HID_DATA_OUT_PIPE 2
+ /** Pipe address for the HID data OUT pipe. */
+ #define HID_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Projects/RelayBoard/Doxygen.conf b/Projects/RelayBoard/Doxygen.conf
index 953c2af7e..7dc0279fc 100644
--- a/Projects/RelayBoard/Doxygen.conf
+++ b/Projects/RelayBoard/Doxygen.conf
@@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = "OB's Dual-Relay outlet control using a Teensy2++"
+PROJECT_NAME = "OB's Dual-Relay Outlet Control Project"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
diff --git a/Projects/TempDataLogger/Descriptors.c b/Projects/TempDataLogger/Descriptors.c
index d930137ad..f75d78823 100644
--- a/Projects/TempDataLogger/Descriptors.c
+++ b/Projects/TempDataLogger/Descriptors.c
@@ -136,7 +136,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ .EndpointAddress = MASS_STORAGE_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -146,7 +146,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ .EndpointAddress = MASS_STORAGE_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | GENERIC_IN_EPNUM),
+ .EndpointAddress = GENERIC_IN_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = GENERIC_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/TempDataLogger/Descriptors.h b/Projects/TempDataLogger/Descriptors.h
index 87ed01e1b..5f9814308 100644
--- a/Projects/TempDataLogger/Descriptors.h
+++ b/Projects/TempDataLogger/Descriptors.h
@@ -17,17 +17,17 @@
#include "TempDataLogger.h"
/* Macros: */
- /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
- #define MASS_STORAGE_IN_EPNUM 3
+ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */
+ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
- #define MASS_STORAGE_OUT_EPNUM 4
+ /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */
+ #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the Mass Storage data endpoints. */
#define MASS_STORAGE_IO_EPSIZE 64
- /** Endpoint number of the Generic HID reporting IN endpoint. */
- #define GENERIC_IN_EPNUM 1
+ /** Endpoint address of the Generic HID reporting IN endpoint. */
+ #define GENERIC_IN_EPADDR (ENDPOINT_DIR_IN | 1)
/** Size in bytes of the Generic HID reporting endpoint. */
#define GENERIC_EPSIZE 16
diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c
index 83590b311..9ead42ed3 100644
--- a/Projects/TempDataLogger/TempDataLogger.c
+++ b/Projects/TempDataLogger/TempDataLogger.c
@@ -45,15 +45,18 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
.Config =
{
.InterfaceNumber = 0,
-
- .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
- .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
- .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
+ .DataINEndpoint =
+ {
+ .Address = MASS_STORAGE_IN_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MASS_STORAGE_OUT_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
.TotalLUNs = 1,
},
};
@@ -70,11 +73,12 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface =
.Config =
{
.InterfaceNumber = 1,
-
- .ReportINEndpointNumber = GENERIC_IN_EPNUM,
- .ReportINEndpointSize = GENERIC_EPSIZE,
- .ReportINEndpointDoubleBank = false,
-
+ .ReportINEndpoint =
+ {
+ .Address = GENERIC_IN_EPADDR,
+ .Size = GENERIC_EPSIZE,
+ .Banks = 1,
+ },
.PrevReportINBuffer = PrevHIDReportBuffer,
.PrevReportINBufferSize = sizeof(PrevHIDReportBuffer),
},
diff --git a/Projects/USBtoSerial/Descriptors.c b/Projects/USBtoSerial/Descriptors.c
index e623a541d..66f81b814 100644
--- a/Projects/USBtoSerial/Descriptors.c
+++ b/Projects/USBtoSerial/Descriptors.c
@@ -143,7 +143,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -169,7 +169,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -179,7 +179,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/USBtoSerial/Descriptors.h b/Projects/USBtoSerial/Descriptors.h
index 03f4e5e7a..e481793b0 100644
--- a/Projects/USBtoSerial/Descriptors.h
+++ b/Projects/USBtoSerial/Descriptors.h
@@ -42,14 +42,14 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 3
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 4
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c
index 194f6b084..7fe67da44 100644
--- a/Projects/USBtoSerial/USBtoSerial.c
+++ b/Projects/USBtoSerial/USBtoSerial.c
@@ -57,18 +57,24 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
.Config =
{
.ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
},
};
diff --git a/Projects/Webserver/Descriptors.c b/Projects/Webserver/Descriptors.c
index 54cec1ce3..fb19a081a 100644
--- a/Projects/Webserver/Descriptors.c
+++ b/Projects/Webserver/Descriptors.c
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -193,7 +193,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -219,7 +219,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ .EndpointAddress = MASS_STORAGE_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -229,7 +229,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ .EndpointAddress = MASS_STORAGE_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/Webserver/Descriptors.h b/Projects/Webserver/Descriptors.h
index b0e0c1160..591947c89 100644
--- a/Projects/Webserver/Descriptors.h
+++ b/Projects/Webserver/Descriptors.h
@@ -42,23 +42,23 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
- #define MASS_STORAGE_IN_EPNUM 3
+ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */
+ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
- #define MASS_STORAGE_OUT_EPNUM 4
+ /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */
+ #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the Mass Storage data endpoints. */
#define MASS_STORAGE_IO_EPSIZE 64
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 5
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 5)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 1
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 2
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 2)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Projects/Webserver/USBDeviceMode.c b/Projects/Webserver/USBDeviceMode.c
index 591ee92b0..158e7590f 100644
--- a/Projects/Webserver/USBDeviceMode.c
+++ b/Projects/Webserver/USBDeviceMode.c
@@ -45,19 +45,24 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface_Device =
.Config =
{
.ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = true,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = true,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = true,
-
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
.AdapterVendorDescription = "LUFA RNDIS Adapter",
.AdapterMACAddress = {{0x02, 0x00, 0x02, 0x00, 0x02, 0x00}},
},
@@ -71,16 +76,19 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
{
.Config =
{
- .InterfaceNumber = 2,
-
- .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
- .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataINEndpointDoubleBank = false,
-
- .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
- .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
- .DataOUTEndpointDoubleBank = false,
-
+ .InterfaceNumber = 2,
+ .DataINEndpoint =
+ {
+ .Address = MASS_STORAGE_IN_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MASS_STORAGE_OUT_EPADDR,
+ .Size = MASS_STORAGE_IO_EPSIZE,
+ .Banks = 1,
+ },
.TotalLUNs = 1,
},
};
diff --git a/Projects/Webserver/USBHostMode.c b/Projects/Webserver/USBHostMode.c
index e7091fc89..601ebda45 100644
--- a/Projects/Webserver/USBHostMode.c
+++ b/Projects/Webserver/USBHostMode.c
@@ -44,16 +44,22 @@ USB_ClassInfo_RNDIS_Host_t Ethernet_RNDIS_Interface_Host =
{
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
- .NotificationPipeNumber = 3,
- .NotificationPipeDoubleBank = false,
-
- .HostMaxPacketSize = UIP_CONF_BUFFER_SIZE,
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
+ .NotificationPipe =
+ {
+ .Address = (PIPE_DIR_IN | 3),
+ .Banks = 1,
+ },
+ .HostMaxPacketSize = UIP_CONF_BUFFER_SIZE,
},
};
diff --git a/Projects/XPLAINBridge/AVRISPDescriptors.c b/Projects/XPLAINBridge/AVRISPDescriptors.c
index 5f2071ebb..a901e0945 100644
--- a/Projects/XPLAINBridge/AVRISPDescriptors.c
+++ b/Projects/XPLAINBridge/AVRISPDescriptors.c
@@ -106,7 +106,7 @@ const AVRISP_USB_Descriptor_Configuration_t PROGMEM AVRISP_ConfigurationDescript
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | AVRISP_DATA_IN_EPNUM),
+ .EndpointAddress = AVRISP_DATA_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AVRISP_DATA_EPSIZE,
.PollingIntervalMS = 0x0A
@@ -116,7 +116,7 @@ const AVRISP_USB_Descriptor_Configuration_t PROGMEM AVRISP_ConfigurationDescript
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | AVRISP_DATA_OUT_EPNUM),
+ .EndpointAddress = AVRISP_DATA_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AVRISP_DATA_EPSIZE,
.PollingIntervalMS = 0x0A
diff --git a/Projects/XPLAINBridge/AVRISPDescriptors.h b/Projects/XPLAINBridge/AVRISPDescriptors.h
index 9487f685b..c0eeedf70 100644
--- a/Projects/XPLAINBridge/AVRISPDescriptors.h
+++ b/Projects/XPLAINBridge/AVRISPDescriptors.h
@@ -42,18 +42,15 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- #if !defined(LIBUSB_DRIVER_COMPAT)
- /** Endpoint number of the AVRISP data OUT endpoint. */
- #define AVRISP_DATA_OUT_EPNUM 2
+ #if !defined(LIBUSB_DRIVER_COMPAT) || defined(__DOXYGEN__)
+ /** Endpoint address of the AVRISP data OUT endpoint. */
+ #define AVRISP_DATA_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
- /** Endpoint number of the AVRISP data IN endpoint. */
- #define AVRISP_DATA_IN_EPNUM 2
+ /** Endpoint address of the AVRISP data IN endpoint. */
+ #define AVRISP_DATA_IN_EPADDR (ENDPOINT_DIR_IN | 2)
#else
- /** Endpoint number of the AVRISP data OUT endpoint. */
- #define AVRISP_DATA_OUT_EPNUM 2
-
- /** Endpoint number of the AVRISP data IN endpoint. */
- #define AVRISP_DATA_IN_EPNUM 3
+ #define AVRISP_DATA_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
+ #define AVRISP_DATA_IN_EPADDR (ENDPOINT_DIR_IN | 3)
#endif
/** Size in bytes of the AVRISP data endpoint. */
diff --git a/Projects/XPLAINBridge/Doxygen.conf b/Projects/XPLAINBridge/Doxygen.conf
index 6b9c96de9..5628d23a7 100644
--- a/Projects/XPLAINBridge/Doxygen.conf
+++ b/Projects/XPLAINBridge/Doxygen.conf
@@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = "LUFA Library - XPLAIN Serial Bridge/PDI Programmer Device Demo"
+PROJECT_NAME = "LUFA Library - XPLAIN Serial Bridge/PDI Programmer Project"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
diff --git a/Projects/XPLAINBridge/USARTDescriptors.c b/Projects/XPLAINBridge/USARTDescriptors.c
index 30039aa2b..d058aeabf 100644
--- a/Projects/XPLAINBridge/USARTDescriptors.c
+++ b/Projects/XPLAINBridge/USARTDescriptors.c
@@ -143,7 +143,7 @@ const USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
+ .EndpointAddress = CDC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
@@ -169,7 +169,7 @@ const USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
+ .EndpointAddress = CDC_RX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
@@ -179,7 +179,7 @@ const USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
+ .EndpointAddress = CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/XPLAINBridge/USARTDescriptors.h b/Projects/XPLAINBridge/USARTDescriptors.h
index 2569a72a3..4bb771be9 100644
--- a/Projects/XPLAINBridge/USARTDescriptors.h
+++ b/Projects/XPLAINBridge/USARTDescriptors.h
@@ -42,14 +42,14 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 3
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 4
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the CDC device-to-host notification IN endpoint. */
#define CDC_NOTIFICATION_EPSIZE 8
diff --git a/Projects/XPLAINBridge/XPLAINBridge.c b/Projects/XPLAINBridge/XPLAINBridge.c
index bee770a98..071c13e53 100644
--- a/Projects/XPLAINBridge/XPLAINBridge.c
+++ b/Projects/XPLAINBridge/XPLAINBridge.c
@@ -48,18 +48,24 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
.Config =
{
.ControlInterfaceNumber = 0,
-
- .DataINEndpointNumber = CDC_TX_EPNUM,
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
- .DataINEndpointDoubleBank = true,
-
- .DataOUTEndpointNumber = CDC_RX_EPNUM,
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
- .DataOUTEndpointDoubleBank = true,
-
- .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
- .NotificationEndpointDoubleBank = false,
+ .DataINEndpoint =
+ {
+ .Address = CDC_TX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = CDC_RX_EPADDR,
+ .Size = CDC_TXRX_EPSIZE,
+ .Banks = 1,
+ },
+ .NotificationEndpoint =
+ {
+ .Address = CDC_NOTIFICATION_EPADDR,
+ .Size = CDC_NOTIFICATION_EPSIZE,
+ .Banks = 1,
+ },
},
};
@@ -105,7 +111,7 @@ void AVRISP_Task(void)
V2Params_UpdateParamValues();
- Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPADDR);
/* Check to see if a V2 Protocol command has been received */
if (Endpoint_IsOUTReceived())
@@ -213,12 +219,10 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}
else
{
- ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- AVRISP_DATA_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
#if defined(LIBUSB_DRIVER_COMPAT)
- ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- AVRISP_DATA_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1);
#endif
/* Configure the V2 protocol packet handler */