From 47f6a35013b2c6a370e5dce29aa6da3a96844695 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 14 Apr 2012 14:41:17 +0000 Subject: [PATCH 01/37] Reintegrate the FullEPAddresses development branch into trunk. --- Bootloaders/CDC/BootloaderCDC.c | 23 +- Bootloaders/CDC/Descriptors.c | 6 +- Bootloaders/CDC/Descriptors.h | 12 +- Bootloaders/HID/BootloaderHID.c | 4 +- Bootloaders/HID/Descriptors.c | 2 +- Bootloaders/HID/Descriptors.h | 4 +- BuildTests/ModuleTest/makefile | 6 +- .../ClassDriver/AudioInput/AudioInput.c | 11 +- .../ClassDriver/AudioInput/Descriptors.c | 2 +- .../ClassDriver/AudioInput/Descriptors.h | 11 +- .../ClassDriver/AudioOutput/AudioOutput.c | 11 +- .../ClassDriver/AudioOutput/Descriptors.c | 2 +- .../ClassDriver/AudioOutput/Descriptors.h | 11 +- .../DualVirtualSerial/Descriptors.c | 12 +- .../DualVirtualSerial/Descriptors.h | 24 +- .../DualVirtualSerial/DualVirtualSerial.c | 63 +++--- .../ClassDriver/GenericHID/Descriptors.c | 2 +- .../ClassDriver/GenericHID/Descriptors.h | 4 +- .../ClassDriver/GenericHID/GenericHID.c | 11 +- .../Device/ClassDriver/Joystick/Descriptors.c | 2 +- .../Device/ClassDriver/Joystick/Descriptors.h | 4 +- Demos/Device/ClassDriver/Joystick/Joystick.c | 11 +- .../Device/ClassDriver/Keyboard/Descriptors.c | 2 +- .../Device/ClassDriver/Keyboard/Descriptors.h | 4 +- Demos/Device/ClassDriver/Keyboard/Keyboard.c | 11 +- .../ClassDriver/KeyboardMouse/Descriptors.c | 4 +- .../ClassDriver/KeyboardMouse/Descriptors.h | 8 +- .../ClassDriver/KeyboardMouse/KeyboardMouse.c | 21 +- .../KeyboardMouseMultiReport/Descriptors.c | 2 +- .../KeyboardMouseMultiReport/Descriptors.h | 4 +- .../KeyboardMouseMultiReport.c | 11 +- Demos/Device/ClassDriver/MIDI/Descriptors.c | 4 +- Demos/Device/ClassDriver/MIDI/Descriptors.h | 8 +- Demos/Device/ClassDriver/MIDI/MIDI.c | 20 +- .../ClassDriver/MassStorage/Descriptors.c | 4 +- .../ClassDriver/MassStorage/Descriptors.h | 8 +- .../ClassDriver/MassStorage/MassStorage.c | 21 +- .../MassStorageKeyboard/Descriptors.c | 6 +- .../MassStorageKeyboard/Descriptors.h | 12 +- .../MassStorageKeyboard/MassStorageKeyboard.c | 32 +-- Demos/Device/ClassDriver/Mouse/Descriptors.c | 2 +- Demos/Device/ClassDriver/Mouse/Descriptors.h | 14 +- Demos/Device/ClassDriver/Mouse/Mouse.c | 11 +- .../ClassDriver/RNDISEthernet/Descriptors.c | 6 +- .../ClassDriver/RNDISEthernet/Descriptors.h | 12 +- .../ClassDriver/RNDISEthernet/RNDISEthernet.c | 31 +-- .../ClassDriver/VirtualSerial/Descriptors.c | 6 +- .../ClassDriver/VirtualSerial/Descriptors.h | 12 +- .../ClassDriver/VirtualSerial/VirtualSerial.c | 32 +-- .../VirtualSerialMassStorage/Descriptors.c | 10 +- .../VirtualSerialMassStorage/Descriptors.h | 20 +- .../VirtualSerialMassStorage.c | 51 +++-- .../VirtualSerialMouse/Descriptors.c | 8 +- .../VirtualSerialMouse/Descriptors.h | 16 +- .../VirtualSerialMouse/VirtualSerialMouse.c | 41 ++-- .../Device/Incomplete/Sideshow/Descriptors.c | 4 +- .../Device/Incomplete/Sideshow/Descriptors.h | 4 +- .../Sideshow/Lib/SideshowCommands.c | 32 +-- Demos/Device/Incomplete/Sideshow/Sideshow.c | 8 +- .../TestAndMeasurement/Descriptors.c | 6 +- .../TestAndMeasurement/Descriptors.h | 16 +- .../TestAndMeasurement/TestAndMeasurement.c | 13 +- Demos/Device/LowLevel/AudioInput/AudioInput.c | 9 +- .../Device/LowLevel/AudioInput/Descriptors.c | 2 +- .../Device/LowLevel/AudioInput/Descriptors.h | 11 +- .../Device/LowLevel/AudioOutput/AudioOutput.c | 9 +- .../Device/LowLevel/AudioOutput/Descriptors.c | 2 +- .../Device/LowLevel/AudioOutput/Descriptors.h | 11 +- .../LowLevel/DualVirtualSerial/Descriptors.c | 12 +- .../LowLevel/DualVirtualSerial/Descriptors.h | 24 +- .../DualVirtualSerial/DualVirtualSerial.c | 26 +-- .../Device/LowLevel/GenericHID/Descriptors.c | 4 +- .../Device/LowLevel/GenericHID/Descriptors.h | 8 +- Demos/Device/LowLevel/GenericHID/GenericHID.c | 10 +- Demos/Device/LowLevel/Joystick/Descriptors.c | 2 +- Demos/Device/LowLevel/Joystick/Descriptors.h | 4 +- Demos/Device/LowLevel/Joystick/Joystick.c | 5 +- Demos/Device/LowLevel/Keyboard/Descriptors.c | 4 +- Demos/Device/LowLevel/Keyboard/Descriptors.h | 8 +- Demos/Device/LowLevel/Keyboard/Keyboard.c | 10 +- .../LowLevel/KeyboardMouse/Descriptors.c | 6 +- .../LowLevel/KeyboardMouse/Descriptors.h | 12 +- .../LowLevel/KeyboardMouse/KeyboardMouse.c | 15 +- Demos/Device/LowLevel/MIDI/Descriptors.c | 4 +- Demos/Device/LowLevel/MIDI/Descriptors.h | 8 +- Demos/Device/LowLevel/MIDI/MIDI.c | 10 +- .../Device/LowLevel/MassStorage/Descriptors.c | 4 +- .../Device/LowLevel/MassStorage/Descriptors.h | 8 +- .../Device/LowLevel/MassStorage/MassStorage.c | 24 +- Demos/Device/LowLevel/Mouse/Descriptors.c | 2 +- Demos/Device/LowLevel/Mouse/Descriptors.h | 14 +- Demos/Device/LowLevel/Mouse/Mouse.c | 5 +- .../LowLevel/RNDISEthernet/Descriptors.c | 6 +- .../LowLevel/RNDISEthernet/Descriptors.h | 12 +- .../LowLevel/RNDISEthernet/RNDISEthernet.c | 15 +- .../LowLevel/VirtualSerial/Descriptors.c | 6 +- .../LowLevel/VirtualSerial/Descriptors.h | 12 +- .../LowLevel/VirtualSerial/VirtualSerial.c | 13 +- .../ClassDriver/MouseHostDevice/Descriptors.c | 2 +- .../ClassDriver/MouseHostDevice/Descriptors.h | 4 +- .../MouseHostDevice/DeviceFunctions.c | 11 +- .../MouseHostDevice/HostFunctions.c | 13 +- .../AndroidAccessoryHost.c | 16 +- .../AudioInputHost/AudioInputHost.c | 7 +- .../AudioOutputHost/AudioOutputHost.c | 7 +- .../JoystickHostWithParser.c | 17 +- .../ClassDriver/KeyboardHost/KeyboardHost.c | 16 +- .../KeyboardHostWithParser.c | 17 +- Demos/Host/ClassDriver/MIDIHost/MIDIHost.c | 15 +- .../MassStorageHost/MassStorageHost.c | 15 +- Demos/Host/ClassDriver/MouseHost/MouseHost.c | 16 +- .../MouseHostWithParser/MouseHostWithParser.c | 17 +- .../ClassDriver/PrinterHost/PrinterHost.c | 15 +- .../RNDISEthernetHost/RNDISEthernetHost.c | 26 ++- .../StillImageHost/StillImageHost.c | 23 +- .../VirtualSerialHost/VirtualSerialHost.c | 23 +- .../BluetoothHost/ConfigDescriptor.c | 9 +- .../BluetoothHost/ConfigDescriptor.h | 6 +- .../AndroidAccessoryHost/ConfigDescriptor.c | 6 +- .../AndroidAccessoryHost/ConfigDescriptor.h | 7 +- .../AudioInputHost/ConfigDescriptor.c | 3 +- .../AudioInputHost/ConfigDescriptor.h | 4 +- .../Host/LowLevel/AudioInputHost/Doxygen.conf | 2 +- .../AudioOutputHost/ConfigDescriptor.c | 3 +- .../AudioOutputHost/ConfigDescriptor.h | 4 +- .../LowLevel/AudioOutputHost/Doxygen.conf | 2 +- .../GenericHIDHost/ConfigDescriptor.c | 6 +- .../GenericHIDHost/ConfigDescriptor.h | 8 +- .../JoystickHostWithParser/ConfigDescriptor.c | 3 +- .../JoystickHostWithParser/ConfigDescriptor.h | 4 +- .../JoystickHostWithParser/Doxygen.conf | 2 +- .../LowLevel/KeyboardHost/ConfigDescriptor.c | 3 +- .../LowLevel/KeyboardHost/ConfigDescriptor.h | 4 +- .../KeyboardHostWithParser/ConfigDescriptor.c | 3 +- .../KeyboardHostWithParser/ConfigDescriptor.h | 4 +- .../KeyboardHostWithParser/Doxygen.conf | 2 +- .../Host/LowLevel/MIDIHost/ConfigDescriptor.c | 6 +- .../Host/LowLevel/MIDIHost/ConfigDescriptor.h | 8 +- .../MassStorageHost/ConfigDescriptor.c | 6 +- .../MassStorageHost/ConfigDescriptor.h | 8 +- .../LowLevel/MouseHost/ConfigDescriptor.c | 3 +- .../LowLevel/MouseHost/ConfigDescriptor.h | 4 +- .../MouseHostWithParser/ConfigDescriptor.c | 3 +- .../MouseHostWithParser/ConfigDescriptor.h | 4 +- .../LowLevel/MouseHostWithParser/Doxygen.conf | 2 +- .../LowLevel/PrinterHost/ConfigDescriptor.c | 6 +- .../LowLevel/PrinterHost/ConfigDescriptor.h | 8 +- .../RNDISEthernetHost/ConfigDescriptor.c | 9 +- .../RNDISEthernetHost/ConfigDescriptor.h | 12 +- .../StillImageHost/ConfigDescriptor.c | 9 +- .../StillImageHost/ConfigDescriptor.h | 12 +- .../VirtualSerialHost/ConfigDescriptor.c | 9 +- .../VirtualSerialHost/ConfigDescriptor.h | 12 +- LUFA/Common/ArchitectureSpecific.h | 55 +++-- LUFA/DoxygenPages/ChangeLog.txt | 12 + LUFA/DoxygenPages/DeviceSupport.txt | 30 +++ LUFA/DoxygenPages/FutureChanges.txt | 1 - LUFA/DoxygenPages/LUFAPoweredProjects.txt | 1 + LUFA/DoxygenPages/MigrationInformation.txt | 19 +- .../Board/XMEGA/A3BU_XPLAINED/Dataflash.h | 13 +- .../Board/XMEGA/B1_XPLAINED/Dataflash.h | 21 +- LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h | 9 +- .../Peripheral/XMEGA/SerialSPI_XMEGA.h | 11 +- .../USB/Class/Device/AudioClassDevice.c | 57 ++--- .../USB/Class/Device/AudioClassDevice.h | 25 +-- .../Drivers/USB/Class/Device/CDCClassDevice.c | 61 ++---- .../Drivers/USB/Class/Device/CDCClassDevice.h | 18 +- .../Drivers/USB/Class/Device/HIDClassDevice.c | 14 +- .../Drivers/USB/Class/Device/HIDClassDevice.h | 4 +- .../USB/Class/Device/MIDIClassDevice.c | 46 +--- .../USB/Class/Device/MIDIClassDevice.h | 9 +- .../USB/Class/Device/MassStorageClassDevice.c | 62 ++---- .../USB/Class/Device/MassStorageClassDevice.h | 9 +- .../USB/Class/Device/RNDISClassDevice.c | 59 ++--- .../USB/Class/Device/RNDISClassDevice.h | 14 +- .../Class/Host/AndroidAccessoryClassHost.c | 64 ++---- .../Class/Host/AndroidAccessoryClassHost.h | 10 +- LUFA/Drivers/USB/Class/Host/AudioClassHost.c | 58 ++--- LUFA/Drivers/USB/Class/Host/AudioClassHost.h | 17 +- LUFA/Drivers/USB/Class/Host/CDCClassHost.c | 90 +++----- LUFA/Drivers/USB/Class/Host/CDCClassHost.h | 15 +- LUFA/Drivers/USB/Class/Host/HIDClassHost.c | 68 ++---- LUFA/Drivers/USB/Class/Host/HIDClassHost.h | 10 +- LUFA/Drivers/USB/Class/Host/MIDIClassHost.c | 58 ++--- LUFA/Drivers/USB/Class/Host/MIDIClassHost.h | 10 +- .../USB/Class/Host/MassStorageClassHost.c | 74 ++----- .../USB/Class/Host/MassStorageClassHost.h | 10 +- .../Drivers/USB/Class/Host/PrinterClassHost.c | 64 ++---- .../Drivers/USB/Class/Host/PrinterClassHost.h | 10 +- LUFA/Drivers/USB/Class/Host/RNDISClassHost.c | 80 ++----- LUFA/Drivers/USB/Class/Host/RNDISClassHost.h | 15 +- .../USB/Class/Host/StillImageClassHost.c | 92 +++----- .../USB/Class/Host/StillImageClassHost.h | 15 +- LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c | 15 ++ LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h | 175 +++++---------- LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c | 8 +- LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c | 34 ++- LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h | 116 +++++----- .../USB/Core/AVR8/USBController_AVR8.c | 3 +- .../Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c | 3 +- LUFA/Drivers/USB/Core/Endpoint.h | 12 + LUFA/Drivers/USB/Core/Pipe.h | 18 +- LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c | 17 ++ LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h | 205 ++++++------------ LUFA/Drivers/USB/Core/UC3/Host_UC3.c | 8 +- LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c | 34 ++- LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h | 124 +++++------ LUFA/Drivers/USB/Core/UC3/USBController_UC3.c | 3 +- LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c | 3 +- LUFA/Drivers/USB/Core/USBController.h | 18 ++ LUFA/Drivers/USB/Core/USBMode.h | 17 ++ LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h | 2 +- LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c | 30 ++- LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h | 182 +++++----------- .../USB/Core/XMEGA/USBController_XMEGA.c | 13 +- .../USB/Core/XMEGA/USBController_XMEGA.h | 2 +- .../USB/Core/XMEGA/USBInterrupt_XMEGA.c | 3 +- LUFA/Drivers/USB/USB.h | 26 ++- LUFA/Platform/XMEGA/ClockManagement.h | 36 ++- Projects/AVRISP-MKII/AVRISP-MKII.c | 8 +- Projects/AVRISP-MKII/Descriptors.c | 4 +- Projects/AVRISP-MKII/Descriptors.h | 17 +- Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c | 18 +- Projects/AVRISP-MKII/Lib/V2Protocol.c | 12 +- .../AVRISP-MKII/Lib/XPROG/XPROGProtocol.c | 16 +- Projects/Benito/Benito.c | 32 +-- Projects/Benito/Descriptors.c | 6 +- Projects/Benito/Descriptors.h | 12 +- Projects/HIDReportViewer/HIDReportViewer.c | 17 +- .../StandaloneProgrammer/Descriptors.c | 4 +- .../StandaloneProgrammer/Descriptors.h | 20 +- .../StandaloneProgrammer/DiskDevice.c | 21 +- .../StandaloneProgrammer/DiskHost.c | 15 +- .../Lib/PetiteFATFs/diskio.c | 2 +- Projects/LEDNotifier/Descriptors.c | 6 +- Projects/LEDNotifier/Descriptors.h | 12 +- Projects/LEDNotifier/LEDNotifier.c | 32 +-- Projects/MIDIToneGenerator/Descriptors.c | 4 +- Projects/MIDIToneGenerator/Descriptors.h | 8 +- .../MIDIToneGenerator/MIDIToneGenerator.c | 20 +- Projects/Magstripe/Descriptors.c | 2 +- Projects/Magstripe/Descriptors.h | 4 +- Projects/Magstripe/Magstripe.c | 11 +- Projects/MediaController/Descriptors.c | 2 +- Projects/MediaController/Descriptors.h | 8 +- Projects/MediaController/MediaController.c | 11 +- Projects/MissileLauncher/ConfigDescriptor.c | 6 +- Projects/MissileLauncher/ConfigDescriptor.h | 8 +- Projects/RelayBoard/Doxygen.conf | 2 +- Projects/TempDataLogger/Descriptors.c | 6 +- Projects/TempDataLogger/Descriptors.h | 12 +- Projects/TempDataLogger/TempDataLogger.c | 32 +-- Projects/USBtoSerial/Descriptors.c | 6 +- Projects/USBtoSerial/Descriptors.h | 12 +- Projects/USBtoSerial/USBtoSerial.c | 30 ++- Projects/Webserver/Descriptors.c | 10 +- Projects/Webserver/Descriptors.h | 20 +- Projects/Webserver/USBDeviceMode.c | 54 +++-- Projects/Webserver/USBHostMode.c | 26 ++- Projects/XPLAINBridge/AVRISPDescriptors.c | 4 +- Projects/XPLAINBridge/AVRISPDescriptors.h | 17 +- Projects/XPLAINBridge/Doxygen.conf | 2 +- Projects/XPLAINBridge/USARTDescriptors.c | 6 +- Projects/XPLAINBridge/USARTDescriptors.h | 12 +- Projects/XPLAINBridge/XPLAINBridge.c | 38 ++-- 265 files changed, 2128 insertions(+), 2494 deletions(-) diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index e9ea8ae352..a7fc883cf3 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 4bf3eced5f..4b769c223a 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 e5ef641020..0010fc69b7 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 928000f8bf..d8f0186afd 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 5d4271e0c6..a531015556 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 41c4ee4027..ad216038a3 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 974a3ddbb6..c0d3ec040d 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 382446a80a..867a09eef4 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 6b7593f523..8557e18e5b 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 ac0a536deb..359a287307 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.h @@ -42,14 +42,11 @@ #include /* 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 78d81f57a8..82f664a9b2 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 06cc5caf5e..0df27453e6 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 ac0a536deb..d5c8a2b849 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h @@ -42,14 +42,11 @@ #include /* 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 5df6808c67..7542ab9af1 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 01d10f29b2..dc3aa0b866 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h @@ -42,23 +42,23 @@ #include /* 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 8f1eb96cf3..a07967c054 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 ee1ba49c80..f8bb128f9d 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 ddeef240c7..0b9ec8f718 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 36eb8f7fe3..aa365bde20 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 da6fc3d094..d0a469f6b0 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 f0ad9c2f19..d2e2943160 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 3c1913f8fb..4f361daf01 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 cb7852667a..84ec47a984 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 3704895140..f032b728e6 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 15a7f17609..24bf8d5fa6 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 d6471d6e73..207e7829bc 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 fe41f923eb..e35e266c08 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 cb2eebf818..7b5caa4055 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 f08cdc717b..fc2eafccd5 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 f579edfb82..5632aa8498 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 7197959bb9..c0526abfd4 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 9ad0e86a5b..84898acf62 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 c5dc2e2175..83844449da 100644 --- a/Demos/Device/ClassDriver/MIDI/Descriptors.h +++ b/Demos/Device/ClassDriver/MIDI/Descriptors.h @@ -42,11 +42,11 @@ #include /* 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 317c37db07..a55c6a70ed 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 fb829423af..0ab09b6a58 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 813f995208..84879e822f 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.h @@ -42,11 +42,11 @@ #include /* 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 6a720f9838..0ba06a5d07 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 27909034c3..e7c9486b87 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 86f6cc4c41..fb1a3794f7 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h @@ -43,17 +43,17 @@ #include /* 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 bfdf09cebf..7e12a5d6e3 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 1a7af876ce..93bd02d619 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 da78dd0ff3..abcd938a80 100644 --- a/Demos/Device/ClassDriver/Mouse/Descriptors.h +++ b/Demos/Device/ClassDriver/Mouse/Descriptors.h @@ -41,6 +41,13 @@ #include + /* 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 04d4268f08..00cadb41c6 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 41bc4b59ea..86cc420c70 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 7c40d87a14..6301b83aa6 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 2a8ba97351..37fb817de9 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 f4e9fb3244..0858bc47ce 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 fb69344cbb..af9183ed24 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 c3e16edb03..8b11c298c3 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 299ddbdca2..a3738651e5 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 b4b5ef67a1..544a2b5c06 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 d8ffea8736..14d6abdd95 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 af674563f1..0a40b4fa88 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 2509314b2a..06cfd459b7 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 f2d67542dd..dbbc8e7b4f 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 533c921214..cc1a094c89 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 6c9c6e3d73..1725a79515 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 4634036e77..3e23924673 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 3bc58d3769..41009f3738 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 14be2ec498..2a60a741cf 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 8876f732ba..e45654a27b 100644 --- a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h +++ b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h @@ -43,20 +43,20 @@ #include /* 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 c77b01e1a1..5102f101c7 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 60eeaf64c6..eb9c4b57c0 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 0b16522467..ee37affd23 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 ac0a536deb..4680294c96 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.h @@ -42,14 +42,11 @@ #include /* 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 813108a716..ebf4ad51d6 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 7f12fc72c2..12a5a1562c 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 ac0a536deb..e0c756744e 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.h @@ -42,14 +42,11 @@ #include /* 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 5df6808c67..7542ab9af1 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 0a172d83d6..fee2c85522 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h @@ -42,23 +42,23 @@ #include /* 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 9208b2c44a..2db6f4e23d 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 2dcdcf030d..1d8765b546 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 4647a05f01..e47220a1c0 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 4d61acfb68..c36c33f7e5 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 272595d995..74f388c659 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 93b315b4ea..bc90fb7cc0 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 9e84b61f99..cfdfaae2fa 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 46b9fdec5c..2de04d3480 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 3c0ea17975..2e1fe3c814 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 45bf010fc7..3755d09def 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 9d02fa45c5..9d592f7d44 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 573cb65b67..178f5ed998 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 4de6f64c98..a916659ea6 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 9ad0e86a5b..84898acf62 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 5415a31cd2..7947a463ce 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.h +++ b/Demos/Device/LowLevel/MIDI/Descriptors.h @@ -42,11 +42,11 @@ #include /* 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 a29a8c86be..f8bc4e9179 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 fb829423af..0ab09b6a58 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 0e7a91ffde..34a85f6d11 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.h +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.h @@ -42,11 +42,11 @@ #include /* 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 947636cf82..0e8e1083b8 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 d42fb835c5..bd0cb61651 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 da78dd0ff3..abcd938a80 100644 --- a/Demos/Device/LowLevel/Mouse/Descriptors.h +++ b/Demos/Device/LowLevel/Mouse/Descriptors.h @@ -41,6 +41,13 @@ #include + /* 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 98da9be92b..e9f92e4a22 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 41bc4b59ea..86cc420c70 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 9ffa5262f1..6337335ac1 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 a36ecf4bb1..c041bb91a5 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 f4e9fb3244..0858bc47ce 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 765345bc33..36ec8f9ff3 100644 --- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.h +++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 93fd4353e2..7d185481df 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 2ee35de878..33a825d9a0 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 da78dd0ff3..14cb8e9a3e 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 16fc3fb2b7..39a682a604 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 a71e85b5a0..29def30d5a 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 d0737acd7c..4c53cc2215 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 3e4a69a050..aa274932f3 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 783b0a5e5a..833be1b2c7 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 5d912497de..18c02d7699 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 f67cd1161e..69499089b3 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 4247e9e568..6ef182000a 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 8293fbd3b5..129bd3d628 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 10c7f79217..aacc078790 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 4272591d55..1290e48555 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 857d494129..8004b5ca19 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 3df0eedf26..51157a315c 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 f03ee49676..d27aab143a 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 eeac14d11b..9a89452afc 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 631925e456..bce7804b4c 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 7d10506011..fa19052a85 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 9c40fcdcb5..c46add71aa 100644 --- a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h +++ b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h @@ -40,9 +40,9 @@ #include /* 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 1b8613b69d..6db853267d 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 05e1b91e17..53b7280b40 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h @@ -40,8 +40,11 @@ #include /* 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 b26dbb80e2..9274e633de 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 a5f4259005..84d27c7e69 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 b98cf1f14a..44513ef35e 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 99980fd3d7..cc2506274c 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 dcf367e159..0c4f067669 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 55c9bb563c..9cb0e55a26 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 6df253cb55..9067450e28 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 4614893d55..547f1545b1 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 4f7a0d61b3..be6eb09cd6 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 69fdfedf23..fba5713b26 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 4366e6edd1..65c60866b8 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 cfcee7b8b4..73dc5dfe5a 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 5b44d3fd58..eb09f695fa 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 765b325f0b..ddd43590b6 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 ffa2afd8ed..c40211cb00 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 9f76d7efdc..3e481571d1 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 39e513cf63..70381ea566 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 d41513e4e4..40d4dc9cc8 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 566cdb10cf..0e967f9728 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 a40debd98d..eb0746b047 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 c33e08769c..4992e3a677 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 9619c44ac4..14051a6a9c 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 c6647007c4..7d63d2bdb1 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 799761bbaa..0a2582bfeb 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 fcf83567fd..b41e8d85a1 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 f259c1fd82..922734f331 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 cc9e2cb44b..d5a32cddff 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 04930009e6..df317ef62c 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 e9cf19f4cb..19f26b4083 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 269dc3ba4a..c5c78ce60c 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 04b81a2819..93dcfc6449 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 4126d761d5..552b02aff8 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 c5a60b48a5..e9f12dcc45 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 3ba7a5c0a2..f7dca6631d 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 b35a39cb83..c0193f2766 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -10,6 +10,8 @@ * New: * - 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 c8083d2759..214938fbbf 100644 --- a/LUFA/DoxygenPages/DeviceSupport.txt +++ b/LUFA/DoxygenPages/DeviceSupport.txt @@ -377,6 +377,36 @@ * Yes * No * + * + * ATXMEGA64C3 + * Yes + * No + * + * + * ATXMEGA128C3 + * Yes + * No + * + * + * ATXMEGA192C3 + * Yes + * No + * + * + * ATXMEGA256C3 + * Yes + * No + * + * + * ATXMEGA16C4 + * Yes + * No + * + * + * ATXMEGA32C4 + * Yes + * No + * * * * \section Sec_XMEGASupport_Boards Supported Atmel Boards diff --git a/LUFA/DoxygenPages/FutureChanges.txt b/LUFA/DoxygenPages/FutureChanges.txt index b75e94d7a3..3e7a217b9a 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 ea08705159..5179850e12 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 93082bb5cf..fe04732843 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. * * Host Mode * - 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 * USB Core @@ -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 abc8d85d11..df357611bd 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 f1e6da5f09..0b8a2617e8 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 0126630acf..562aaecfdc 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 6f8251f609..a0e9e33701 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 15fcd588db..ad79e9b2ba 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 2391266074..a8bfc78331 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 * must 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 5b53438605..a16949cfd2 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 cc0dd1b153..508c234d75 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 * must 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 5c8d878e7e..e4b5653274 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 a6361c6b0f..e358dec756 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 9f0506e56c..c9553a4135 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 4fe49af1f9..2703600eaa 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 * must 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 6294a0a946..153ebbc890 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 c2d536ce2a..6b490eca1a 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 f78a5abf24..e5aa40cd0d 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 ccd20e38e8..33b807da9f 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 eb4c2530d5..7c564e0124 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 0ec44e7153..678feda451 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 * may 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 e5591ec1d6..12783a6a06 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 a6e425d5f5..2d39aa9ca9 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 * must 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 * may 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 63df6b0c5b..8c79e9c228 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 5a8df24146..4d79ed9517 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 * must 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 f51bdf74f8..dad6a5afc5 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 7bdaad18bf..882cc31df0 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 5aadbcc7ff..0d33bfec4f 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 e934ddacbb..b9e8611437 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 * must 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 * may 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 24b4edc767..f145881fd3 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 25d7e1e5e2..a8763dd5ba 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 * must 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 * may 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 379ccb01c9..dd33b115b3 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 c8c997f741..25878276f6 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 * must 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 * may 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 a03011d644..e457b5dff6 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 085bde22cf..57087edf91 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 2b5514a28f..5c18d75035 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 4cda70d2e6..be616b4595 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 * must 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 bcf904d99f..4440b76316 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 10f69a8fd5..37ff220e30 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 must 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 must 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 3f27c76319..a1e0fd3710 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 5e68cc7256..1ddffb51e8 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 86792bf22d..1012fa060a 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 must - * 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 must 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 e31b88d5ff..1f37dfd495 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 f63cf3eb9e..e26c86f12f 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 1fcc6b6f37..b349adfc9d 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 bb56b81027..faa803b6d5 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 fc1b18a2e8..c027585a65 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 c919effa79..84801a13f2 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 must 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 must 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 49d43f9b56..932381a149 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 4e77a28ffe..787244b97b 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 f17fa53760..837afe8b8e 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 must - * 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 must 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 95ca7d9aa9..32772446ef 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 d411a93053..a2a5c4a962 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 a91e18c277..44a10e3712 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 bc2f86dd56..56e5b5e84b 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 85be0f1bf8..268fe95c03 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 98e35e59ae..1aeb985f85 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 7828f308ae..720b5f3b4f 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 must 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 (1 << {Endpoint Number}). - * - * \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 387e8e417e..ffdca3adfb 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 2f14f758ad..1cdb6f03ce 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 b0e52d06e9..3554165c1e 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 35b285c6d3..c99c1d2679 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 dcde7dcdb8..9b3b56244f 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 760193ab07..eaf04cb7a3 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 12f44f9e2c..da57b7113c 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 5a994ba199..1b140f30df 100644 --- a/Projects/AVRISP-MKII/Descriptors.h +++ b/Projects/AVRISP-MKII/Descriptors.h @@ -42,18 +42,15 @@ #include /* 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 f757ac1436..445e088d25 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 f485810517..e7c43cd016 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 d342730933..ad8cd530a6 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 8d9ac53022..d68cee3c96 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 86d8c4d0cf..2990848ebd 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 03f4e5e7a8..e481793b06 100644 --- a/Projects/Benito/Descriptors.h +++ b/Projects/Benito/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 c0cc11f67a..fa44c08435 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 a3319e4ab0..e674c93e02 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 250fcf79b1..c0e8f46d7f 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.h +++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 bc70910e7d..73bf5545ae 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 1dafda43bc..c93029c060 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 cac0bd957e..d953875a24 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 -#include +#include #include "../DataflashManager.h" #include "../../DiskHost.h" diff --git a/Projects/LEDNotifier/Descriptors.c b/Projects/LEDNotifier/Descriptors.c index e362857b41..9dda9e6998 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 03f4e5e7a8..e481793b06 100644 --- a/Projects/LEDNotifier/Descriptors.h +++ b/Projects/LEDNotifier/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 34f29e1248..dd3a8ae3a0 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 9ad0e86a5b..84898acf62 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 c5dc2e2175..83844449da 100644 --- a/Projects/MIDIToneGenerator/Descriptors.h +++ b/Projects/MIDIToneGenerator/Descriptors.h @@ -42,11 +42,11 @@ #include /* 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 4062bffab6..2a9d5c3c07 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 aec8b880dd..b031d54032 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 27ea9a1c59..f90816a824 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 6e41ce67fb..ecdf68b0b6 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 fc862aa905..7ba467c280 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 ec9b330827..3844e31387 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 01405270ab..24f02580dc 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 efcd2be5c3..e287d78d34 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 b05f7efe4e..c857bf7c07 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 953c2af7e3..7dc0279fce 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 d930137ad0..f75d78823e 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 87ed01e1bc..5f9814308b 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 83590b311d..9ead42ed36 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 e623a541dd..66f81b8143 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 03f4e5e7a8..e481793b06 100644 --- a/Projects/USBtoSerial/Descriptors.h +++ b/Projects/USBtoSerial/Descriptors.h @@ -42,14 +42,14 @@ #include /* 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 194f6b084e..7fe67da447 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 54cec1ce3b..fb19a081a2 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 b0e0c11602..591947c893 100644 --- a/Projects/Webserver/Descriptors.h +++ b/Projects/Webserver/Descriptors.h @@ -42,23 +42,23 @@ #include /* 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 591ee92b00..158e7590f8 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 e7091fc896..601ebda453 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 5f2071ebb9..a901e09456 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 9487f685bd..c0eeedf70d 100644 --- a/Projects/XPLAINBridge/AVRISPDescriptors.h +++ b/Projects/XPLAINBridge/AVRISPDescriptors.h @@ -42,18 +42,15 @@ #include /* 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 6b9c96de90..5628d23a77 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 30039aa2bc..d058aeabf8 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 2569a72a31..4bb771be9c 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.h +++ b/Projects/XPLAINBridge/USARTDescriptors.h @@ -42,14 +42,14 @@ #include /* 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 bee770a980..071c13e53b 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 */ From 2e757d8c38a6852427f25f302884c34dd509431a Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 14 Apr 2012 21:35:25 +0000 Subject: [PATCH 02/37] Added new SerialToLCD user project contributed by Simon Foster. --- LUFA.pnproj | 2 +- LUFA/DoxygenPages/ChangeLog.txt | 1 + Projects/SerialToLCD/Descriptors.c | 272 ++++ Projects/SerialToLCD/Descriptors.h | 90 ++ Projects/SerialToLCD/Doxygen.conf | 1814 ++++++++++++++++++++++++++ Projects/SerialToLCD/Lib/HD44780.c | 127 ++ Projects/SerialToLCD/Lib/HD44780.h | 64 + Projects/SerialToLCD/SerialToLCD.c | 194 +++ Projects/SerialToLCD/SerialToLCD.h | 63 + Projects/SerialToLCD/SerialToLCD.txt | 51 + Projects/SerialToLCD/makefile | 731 +++++++++++ Projects/makefile | 4 + 12 files changed, 3412 insertions(+), 1 deletion(-) create mode 100644 Projects/SerialToLCD/Descriptors.c create mode 100644 Projects/SerialToLCD/Descriptors.h create mode 100644 Projects/SerialToLCD/Doxygen.conf create mode 100644 Projects/SerialToLCD/Lib/HD44780.c create mode 100644 Projects/SerialToLCD/Lib/HD44780.h create mode 100644 Projects/SerialToLCD/SerialToLCD.c create mode 100644 Projects/SerialToLCD/SerialToLCD.h create mode 100644 Projects/SerialToLCD/SerialToLCD.txt create mode 100644 Projects/SerialToLCD/makefile diff --git a/LUFA.pnproj b/LUFA.pnproj index 4fc91f63c4..86d3a641d8 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index c0193f2766..6bf1e82b55 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -15,6 +15,7 @@ * - 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 + * - Added new SerialToLCD user project contributed by Simon Foster * * Changed: * - Core: diff --git a/Projects/SerialToLCD/Descriptors.c b/Projects/SerialToLCD/Descriptors.c new file mode 100644 index 0000000000..74f8e608ba --- /dev/null +++ b/Projects/SerialToLCD/Descriptors.c @@ -0,0 +1,272 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 Simon Foster (simon.foster [at] inbox [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * USB Device Descriptors, for library use when in USB device mode. Descriptors are special + * computer-readable structures which the host requests upon device enumeration, to determine + * the device's capabilities and functions. + */ + +#include "Descriptors.h" + +/* On some devices, there is a factory set internal serial number which can be automatically sent to the host as + * the device's serial number when the Device Descriptor's .SerialNumStrIndex entry is set to USE_INTERNAL_SERIAL. + * This allows the host to track a device across insertions on different ports, allowing them to retain allocated + * resources like COM port numbers and drivers. On demos using this feature, give a warning on unsupported devices + * so that the user can supply their own serial number descriptor instead or remove the USE_INTERNAL_SERIAL value + * from the Device Descriptor (forcing the host to generate a serial number for each device from the VID, PID and + * port location). + */ +#if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. +#endif + +/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall + * device characteristics, including the supported USB version, control endpoint size and the + * number of device configurations. The descriptor is read out by the USB host when the enumeration + * process begins. + */ +const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = +{ + .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, + + .USBSpecification = VERSION_BCD(01.10), + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, + + .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, + + .VendorID = 0x03EB, + .ProductID = 0x204B, + .ReleaseNumber = VERSION_BCD(00.01), + + .ManufacturerStrIndex = 0x01, + .ProductStrIndex = 0x02, + .SerialNumStrIndex = USE_INTERNAL_SERIAL, + + .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS +}; + +/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage + * of the device in one of its supported configurations, including information about any device interfaces + * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting + * a configuration so that the host may correctly communicate with the USB device. + */ +const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = +{ + .Config = + { + .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, + + .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), + .TotalInterfaces = 2, + + .ConfigurationNumber = 1, + .ConfigurationStrIndex = NO_DESCRIPTOR, + + .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED), + + .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) + }, + + .CDC_CCI_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = 0, + .AlternateSetting = 0, + + .TotalEndpoints = 1, + + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .CDC_Functional_Header = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Header, + + .CDCSpecification = VERSION_BCD(01.10), + }, + + .CDC_Functional_ACM = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, + + .Capabilities = 0x06, + }, + + .CDC_Functional_Union = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, + + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, + }, + + .CDC_NotificationEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = CDC_NOTIFICATION_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_NOTIFICATION_EPSIZE, + .PollingIntervalMS = 0xFF + }, + + .CDC_DCI_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = 1, + .AlternateSetting = 0, + + .TotalEndpoints = 2, + + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .CDC_DataOutEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = CDC_RX_EPADDR, + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_TXRX_EPSIZE, + .PollingIntervalMS = 0x01 + }, + + .CDC_DataInEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = CDC_TX_EPADDR, + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_TXRX_EPSIZE, + .PollingIntervalMS = 0x01 + } +}; + +/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests + * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate + * via the language ID table available at USB.org what languages the device supports for its string descriptors. + */ +const USB_Descriptor_String_t PROGMEM LanguageString = +{ + .Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String}, + + .UnicodeString = {LANGUAGE_ID_ENG} +}; + +/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable + * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device + * Descriptor. + */ +const USB_Descriptor_String_t PROGMEM ManufacturerString = +{ + .Header = {.Size = USB_STRING_LEN(12), .Type = DTYPE_String}, + + .UnicodeString = L"Simon Foster" +}; + +/** Product descriptor string. This is a Unicode string containing the product's details in human readable form, + * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device + * Descriptor. + */ +const USB_Descriptor_String_t PROGMEM ProductString = +{ + .Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String}, + + .UnicodeString = L"USB-HD44780 Adapter" +}; + +/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" + * documentation) by the application code so that the address and size of a requested descriptor can be given + * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function + * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the + * USB host. + */ +uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + const void** const DescriptorAddress) +{ + const uint8_t DescriptorType = (wValue >> 8); + const uint8_t DescriptorNumber = (wValue & 0xFF); + + const void* Address = NULL; + uint16_t Size = NO_DESCRIPTOR; + + switch (DescriptorType) + { + case DTYPE_Device: + Address = &DeviceDescriptor; + Size = sizeof(USB_Descriptor_Device_t); + break; + case DTYPE_Configuration: + Address = &ConfigurationDescriptor; + Size = sizeof(USB_Descriptor_Configuration_t); + break; + case DTYPE_String: + switch (DescriptorNumber) + { + case 0x00: + Address = &LanguageString; + Size = pgm_read_byte(&LanguageString.Header.Size); + break; + case 0x01: + Address = &ManufacturerString; + Size = pgm_read_byte(&ManufacturerString.Header.Size); + break; + case 0x02: + Address = &ProductString; + Size = pgm_read_byte(&ProductString.Header.Size); + break; + } + + break; + } + + *DescriptorAddress = Address; + return Size; +} + diff --git a/Projects/SerialToLCD/Descriptors.h b/Projects/SerialToLCD/Descriptors.h new file mode 100644 index 0000000000..5a316a2cda --- /dev/null +++ b/Projects/SerialToLCD/Descriptors.h @@ -0,0 +1,90 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 Simon Foster (simon.foster [at] inbox [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Header file for Descriptors.c. + */ + +#ifndef _DESCRIPTORS_H_ +#define _DESCRIPTORS_H_ + + /* Includes: */ + #include + + #include + + /* Macros: */ + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) + + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) + + /** 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 + + /** Size in bytes of the CDC data IN and OUT endpoints. */ + #define CDC_TXRX_EPSIZE 16 + + /* 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 + * vary between devices, and which describe the device's usage to the host. + */ + typedef struct + { + USB_Descriptor_Configuration_Header_t Config; + + // CDC Command Interface + USB_Descriptor_Interface_t CDC_CCI_Interface; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; + USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; + + // CDC Data Interface + USB_Descriptor_Interface_t CDC_DCI_Interface; + USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; + USB_Descriptor_Endpoint_t CDC_DataInEndpoint; + } USB_Descriptor_Configuration_t; + + /* Function Prototypes: */ + uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + const void** const DescriptorAddress) + ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); + +#endif + diff --git a/Projects/SerialToLCD/Doxygen.conf b/Projects/SerialToLCD/Doxygen.conf new file mode 100644 index 0000000000..af2e82e97a --- /dev/null +++ b/Projects/SerialToLCD/Doxygen.conf @@ -0,0 +1,1814 @@ +# Doxyfile 1.8.0 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# 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 = "Simon Foster's USB Serial to HD44780 LCD 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 +# if some version control system is used. + +PROJECT_NUMBER = 0.0.0 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = ./Documentation/ + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = YES + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = NO + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = NO + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = NO + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ./ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.h \ + *.c \ + *.txt + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = Documentation/ + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = __* \ + INCLUDE_FROM_* + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = NO + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# style sheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = YES + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = YES + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 1 + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. +# However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = __DOXYGEN__ \ + PROGMEM + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = NO + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = NO + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = NO + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = NO + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = NO + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = NO + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 15 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 2 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/Projects/SerialToLCD/Lib/HD44780.c b/Projects/SerialToLCD/Lib/HD44780.c new file mode 100644 index 0000000000..d67dc6d408 --- /dev/null +++ b/Projects/SerialToLCD/Lib/HD44780.c @@ -0,0 +1,127 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 Simon Foster (simon.foster [at] inbox [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +#include "HD44780.h" + +static void HD44780_WriteNibble(const uint8_t nib) +{ + /* Read PORTD and clear the ENABLE and PD0..3 bits + then OR in the data */ + + PORTD = (PORTD & ~(ENABLE | LO4_MASK)) | (nib & LO4_MASK); + + /* Enforce address setup time (tAS) 60ns + 60 @ 16MHz = <1 + Let's us a few NOPs for good measure */ + asm volatile("nop\n\t" + "nop\n\t" + :: ); + + /* Take enable high and enforce Enable High time (tEH=450ns) + 450ns @ 16MHz = 7.2 => 7 NOPs */ + + PORTD |= ENABLE; + + asm volatile("nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + :: ); + + /* Take enable low and enforce Enable Low time (tEL=500ns) + 500ns @ 16MHz = 8.0 => 7 NOPs */ + PORTD &= ~ENABLE; + + asm volatile("nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + :: ); +} + +static void HD44780_WriteByte(const uint8_t c) +{ + HD44780_WriteNibble(HI4(c)); + HD44780_WriteNibble(LO4(c)); +} + +static void HD44780_PowerUp4Bit(void) +{ + /* Wait for more than 40 ms after VCC rises to 2.7 V */ + _delay_ms(40); + HD44780_WriteNibble(0x03); // FN_SET 8-bit + + /* Wait for more than 4.1 ms */ + _delay_ms(5); + HD44780_WriteNibble(0x03); // FN_SET 8-bit + + /* Wait for more than 100 µs */ + _delay_us(100); + HD44780_WriteNibble(0x03); // FN_SET 8-bit + + /* From now on we must allow 40us for each command */ + _delay_us(50); + HD44780_WriteNibble(0x02); // FN_SET 4-bit + + /* The LCD is now in 4-bit mode so we can continue + using the 4-bit API */ + _delay_us(50); +} + +void HD44780_Initialise(void) +{ + PORTD &= ~ALL_BITS; + DDRD |= ALL_BITS; + HD44780_PowerUp4Bit(); +} + +void HD44780_WriteCommand(const uint8_t c) +{ + PORTD &= ~RS; + HD44780_WriteByte(c); + _delay_us(50); +} + +void HD44780_WriteData(const uint8_t c) +{ + PORTD |= RS; + HD44780_WriteByte(c); + PORTD &= ~RS; + _delay_us(50); +} diff --git a/Projects/SerialToLCD/Lib/HD44780.h b/Projects/SerialToLCD/Lib/HD44780.h new file mode 100644 index 0000000000..a800ae712d --- /dev/null +++ b/Projects/SerialToLCD/Lib/HD44780.h @@ -0,0 +1,64 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 Simon Foster (simon.foster [at] inbox [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Header file for HD44780.c. + */ + +#ifndef _HD44780_H_ +#define _HD44780_H_ + + /* Includes: */ + #include + #include + #include + + /* Macros: */ + #define RS (0x10) // PD4 + #define ENABLE (0x80) // PD7 + + #define HI4_MASK (0xF0) + #define LO4_MASK (0x0F) // PD0..3 + + #define ALL_BITS (RS|ENABLE|LO4_MASK) + + #define HI4( c ) (( c & HI4_MASK ) >> 4 ) + #define LO4( c ) (( c & LO4_MASK ) >> 0 ) + + #define CMD_DISPLAY_ON 0x0C + + /* Function Prototypes: */ + void HD44780_Initialise(void); + void HD44780_WriteData(const uint8_t c); + void HD44780_WriteCommand(const uint8_t c); + +#endif diff --git a/Projects/SerialToLCD/SerialToLCD.c b/Projects/SerialToLCD/SerialToLCD.c new file mode 100644 index 0000000000..7a289270b4 --- /dev/null +++ b/Projects/SerialToLCD/SerialToLCD.c @@ -0,0 +1,194 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 Simon Foster (simon.foster [at] inbox [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Main source file for the SerialToLCD program. This file contains the main tasks of + * the project and is responsible for the initial application hardware configuration. + * + * \section Hardware Information + * + * LCD Datasheet: See http://www.sparkfun.com/datasheets/LCD/HD44780.pdf + * + * Also see the two articles from EPE which are linked from here: + * http://en.wikipedia.org/wiki/HD44780_Character_LCD + * + * Connections from the Minimus to the HD44780 as shown below. + * + * ========================================================= \n + * Minimus HD44780 Pin \n + * ========================================================= \n + * PD0 DB4 11 \n + * PD1 DB5 12 \n + * PD2 DB6 13 \n + * PD3 DB7 14 \n + * \n + * PD4 RS 4 \n + * RW 5 GND \n + * PD7 EN 6 \n + * \n + * 1 GND \n + * 2 USB +5V \n + * 3 2k -> GND \n + */ + +#include "SerialToLCD.h" + +/** Circular buffer to hold data from the host before it is sent to the LCD */ +static RingBuffer_t FromHost_Buffer; + +/** Underlying data buffer for \ref FromHost_Buffer, where the stored bytes are located. */ +static uint8_t FromHost_Buffer_Data[128]; + +/** LUFA CDC Class driver interface configuration and state information. This structure is + * passed to all CDC Class driver functions, so that multiple instances of the same class + * within a device can be differentiated from one another. + */ +USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = + { + .Config = + { + .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, + }, + }, + }; + + +/** Main program entry point. This routine contains the overall program flow, including initial + * setup of all components and the main program loop. + */ +int main(void) +{ + SetupHardware(); + + RingBuffer_InitBuffer(&FromHost_Buffer, FromHost_Buffer_Data, sizeof(FromHost_Buffer_Data)); + + sei(); + + for (;;) + { + /* Only try to read in bytes from the CDC interface if the transmit buffer is not full */ + if (!(RingBuffer_IsFull(&FromHost_Buffer))) + { + int16_t ReceivedByte = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface); + + /* Read bytes from the USB OUT endpoint into the USART transmit buffer */ + if (!(ReceivedByte < 0)) + RingBuffer_Insert(&FromHost_Buffer, ReceivedByte); + } + + while (RingBuffer_GetCount(&FromHost_Buffer) > 0) + { + static uint8_t escape_pending = 0; + int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer); + + if (HD44780Byte == COMMAND_ESCAPE) + { + if (escape_pending) + { + HD44780_WriteData(HD44780Byte); + escape_pending = 0; + } + else + { + escape_pending = 1; + } + } + else + { + if (escape_pending) + { + HD44780_WriteCommand(HD44780Byte); + escape_pending = 0; + } + else + { + HD44780_WriteData(HD44780Byte); + } + } + } + + CDC_Device_USBTask(&VirtualSerial_CDC_Interface); + USB_USBTask(); + } +} + +/** Configures the board hardware and chip peripherals for the application's functionality. */ +void SetupHardware(void) +{ + /* Disable watchdog if enabled by bootloader/fuses */ + MCUSR &= ~(1 << WDRF); + wdt_disable(); + + /* Disable clock division */ + clock_prescale_set(clock_div_1); + + /* Hardware Initialization */ + USB_Init(); + + /* Power up the HD44780 Interface */ + HD44780_Initialise(); + HD44780_WriteCommand(CMD_DISPLAY_ON); + + /* Start the flush timer so that overflows occur rapidly to push received bytes to the USB interface */ + TCCR0B = (1 << CS02); +} + +/** Event handler for the library USB Configuration Changed event. */ +void EVENT_USB_Device_ConfigurationChanged(void) +{ + bool ConfigSuccess = true; + + ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface); +} + +/** Event handler for the library USB Control Request reception event. */ +void EVENT_USB_Device_ControlRequest(void) +{ + CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface); +} diff --git a/Projects/SerialToLCD/SerialToLCD.h b/Projects/SerialToLCD/SerialToLCD.h new file mode 100644 index 0000000000..52efe44016 --- /dev/null +++ b/Projects/SerialToLCD/SerialToLCD.h @@ -0,0 +1,63 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 Simon Foster (simon.foster [at] inbox [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Header file for SerialToLCD.c. + */ + +#ifndef _SERIALTOLCD_H_ +#define _SERIALTOLCD_H_ + + /* Includes: */ + #include + #include + #include + #include + + #include "Descriptors.h" + #include "Lib/HD44780.h" + + #include + #include + #include + + /* Macros: */ + #define COMMAND_ESCAPE 0x1B + + /* Function Prototypes: */ + void SetupHardware(void); + + void EVENT_USB_Device_ConfigurationChanged(void); + void EVENT_USB_Device_ControlRequest(void); + +#endif + diff --git a/Projects/SerialToLCD/SerialToLCD.txt b/Projects/SerialToLCD/SerialToLCD.txt new file mode 100644 index 0000000000..8bf2102a48 --- /dev/null +++ b/Projects/SerialToLCD/SerialToLCD.txt @@ -0,0 +1,51 @@ +/** \file + * + * This file contains special DoxyGen information for the generation of the main page and other special + * documentation pages. It is not a project source file. + */ + +/** \mainpage Simon Foster's USB Serial to HD44780 LCD Project + * + * \section Sec_Compat Project Compatibility: + * + * The following list indicates what microcontrollers are compatible with this project. + * + * - AT90USB162 + * + * \section Sec_Info USB Information: + * + * The following table gives a rundown of the USB utilization of this project. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
USB Mode:Device
USB Class:Communications Device Class (CDC)
USB Subclass:Abstract Control Model (ACM)
Relevant Standards:USBIF CDC Class Standard
Usable Speeds:Full Speed Mode
+ * + * \section Sec_Description Project Description: + * + * Firmware for a USB Virtual Serial to HD44780 LCD controller project, by Simon Foster. This + * project connects a standard HD7780 compatible LCD controller to a PC via a virtual serial + * link, so that data supplied by the host can be written to the display. This project is + * designed to use the Minimum USB AVR board, however it can be modified to suit other hardware + * if desired. + * + * See comments in the SerialToLCD.c source file for hardware pinouts of the Minimus board. + */ diff --git a/Projects/SerialToLCD/makefile b/Projects/SerialToLCD/makefile new file mode 100644 index 0000000000..ad66578e92 --- /dev/null +++ b/Projects/SerialToLCD/makefile @@ -0,0 +1,731 @@ +# Hey Emacs, this is a -*- makefile -*- +#---------------------------------------------------------------------------- +# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al. +# >> Modified for use with the LUFA project. << +# +# Released to the Public Domain +# +# Additional material for this makefile was written by: +# Peter Fleury +# Tim Henigan +# Colin O'Flynn +# Reiner Patommel +# Markus Pfaff +# Sander Pool +# Frederik Rouleau +# Carlos Lamas +# Dean Camera +# Opendous Inc. +# Denver Gingerich +# +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device, using avrdude. +# Please customize the avrdude settings below first! +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make doxygen = Generate DoxyGen documentation for the project (must have +# DoxyGen installed) +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + + +# MCU name +MCU = at90usb162 + + +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + +# Target board (see library "Board Types" documentation, NONE for projects not requiring +# LUFA board drivers). If USER is selected, put custom board drivers in a directory called +# "Board" inside the application directory. +BOARD = MINIMUS + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + + +# Output format. (can be srec, ihex, binary) +FORMAT = ihex + + +# Target file name (without extension). +TARGET = SerialToLCD + + +# Object files directory +# To put object files in current directory, use a dot (.), do NOT make +# this an empty or blank macro! +OBJDIR = . + + +# Path to the LUFA library +LUFA_PATH = ../.. + + +# LUFA library compile-time options and predefined tokens +LUFA_OPTS = -D USB_DEVICE_ONLY +LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 +LUFA_OPTS += -D ORDERED_EP_CONFIG +LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 +LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 +LUFA_OPTS += -D USE_FLASH_DESCRIPTORS +LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" +LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT + + +# Create the LUFA source path variables by including the LUFA root makefile +include $(LUFA_PATH)/LUFA/makefile + + +# List C source files here. (C dependencies are automatically generated.) +SRC = $(TARGET).c \ + Lib/HD44780.c \ + Descriptors.c \ + $(LUFA_SRC_USB) \ + $(LUFA_SRC_USBCLASS) + + +# List C++ source files here. (C dependencies are automatically generated.) +CPPSRC = + + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = + + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = s + + +# Debugging format. +# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. +# AVR Studio 4.10 requires dwarf-2. +# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. +DEBUG = dwarf-2 + + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRAINCDIRS = $(LUFA_PATH)/ + + +# Compiler flag to set the C Standard level. +# c89 = "ANSI" C +# gnu89 = c89 plus GCC extensions +# c99 = ISO C99 standard (not yet fully implemented) +# gnu99 = c99 plus GCC extensions +CSTANDARD = -std=gnu99 + + +# Place -D or -U options here for C sources +CDEFS = -DF_CPU=$(F_CPU)UL +CDEFS += -DF_USB=$(F_USB)UL +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) +CDEFS += $(LUFA_OPTS) + + +# Place -D or -U options here for ASM sources +ADEFS = -DF_CPU=$(F_CPU) +ADEFS += -DF_USB=$(F_USB)UL +ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += $(LUFA_OPTS) + +# Place -D or -U options here for C++ sources +CPPDEFS = -DF_CPU=$(F_CPU)UL +CPPDEFS += -DF_USB=$(F_USB)UL +CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += $(LUFA_OPTS) +#CPPDEFS += -D__STDC_LIMIT_MACROS +#CPPDEFS += -D__STDC_CONSTANT_MACROS + + + +#---------------- Compiler Options C ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CFLAGS = -g$(DEBUG) +CFLAGS += $(CDEFS) +CFLAGS += -O$(OPT) +CFLAGS += -funsigned-char +CFLAGS += -funsigned-bitfields +CFLAGS += -ffunction-sections +CFLAGS += -fno-inline-small-functions +CFLAGS += -fpack-struct +CFLAGS += -fshort-enums +CFLAGS += -fno-strict-aliasing +CFLAGS += -Wall +CFLAGS += -Wstrict-prototypes +#CFLAGS += -mshort-calls +#CFLAGS += -fno-unit-at-a-time +#CFLAGS += -Wundef +#CFLAGS += -Wunreachable-code +#CFLAGS += -Wsign-compare +CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +CFLAGS += $(CSTANDARD) + + +#---------------- Compiler Options C++ ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CPPFLAGS = -g$(DEBUG) +CPPFLAGS += $(CPPDEFS) +CPPFLAGS += -O$(OPT) +CPPFLAGS += -funsigned-char +CPPFLAGS += -funsigned-bitfields +CPPFLAGS += -fpack-struct +CPPFLAGS += -fshort-enums +CPPFLAGS += -fno-exceptions +CPPFLAGS += -Wall +CPPFLAGS += -Wundef +#CPPFLAGS += -mshort-calls +#CPPFLAGS += -fno-unit-at-a-time +#CPPFLAGS += -Wstrict-prototypes +#CPPFLAGS += -Wunreachable-code +#CPPFLAGS += -Wsign-compare +CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) +CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +#CPPFLAGS += $(CSTANDARD) + + +#---------------- Assembler Options ---------------- +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns: create listing +# -gstabs: have the assembler create line number information; note that +# for use in COFF files, additional information about filenames +# and function names needs to be present in the assembler source +# files -- see avr-libc docs [FIXME: not yet described there] +# -listing-cont-lines: Sets the maximum number of continuation lines of hex +# dump that will be displayed for a given single line of source input. +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 + + +#---------------- Library Options ---------------- +# Minimalistic printf version +PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min + +# Floating point printf version (requires MATH_LIB = -lm below) +PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt + +# If this is left blank, then it will use the Standard printf version. +PRINTF_LIB = +#PRINTF_LIB = $(PRINTF_LIB_MIN) +#PRINTF_LIB = $(PRINTF_LIB_FLOAT) + + +# Minimalistic scanf version +SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min + +# Floating point + %[ scanf version (requires MATH_LIB = -lm below) +SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt + +# If this is left blank, then it will use the Standard scanf version. +SCANF_LIB = +#SCANF_LIB = $(SCANF_LIB_MIN) +#SCANF_LIB = $(SCANF_LIB_FLOAT) + + +MATH_LIB = -lm + + +# List any extra directories to look for libraries here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRALIBDIRS = + + + +#---------------- External Memory Options ---------------- + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# used for variables (.data/.bss) and heap (malloc()). +#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# only used for heap (malloc()). +#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff + +EXTMEMOPTS = + + + +#---------------- Linker Options ---------------- +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += -Wl,--relax +LDFLAGS += -Wl,--gc-sections +LDFLAGS += $(EXTMEMOPTS) +LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) +LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) +#LDFLAGS += -T linker_script.x + + + +#---------------- Programming Options (avrdude) ---------------- + +# Programming hardware +# Type: avrdude -c ? +# to get a full listing. +# +AVRDUDE_PROGRAMMER = jtagmkII + +# com1 = serial port. Use lpt1 to connect to parallel port. +AVRDUDE_PORT = usb + +AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex +#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep + + +# Uncomment the following if you want avrdude's erase cycle counter. +# Note that this counter needs to be initialized first using -Yn, +# see avrdude manual. +#AVRDUDE_ERASE_COUNTER = -y + +# Uncomment the following if you do /not/ wish a verification to be +# performed after programming the device. +#AVRDUDE_NO_VERIFY = -V + +# Increase verbosity level. Please use this when submitting bug +# reports about avrdude. See +# to submit bug reports. +#AVRDUDE_VERBOSE = -v -v + +AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) +AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) +AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) + + + +#---------------- Debugging Options ---------------- + +# For simulavr only - target MCU frequency. +DEBUG_MFREQ = $(F_CPU) + +# Set the DEBUG_UI to either gdb or insight. +# DEBUG_UI = gdb +DEBUG_UI = insight + +# Set the debugging back-end to either avarice, simulavr. +DEBUG_BACKEND = avarice +#DEBUG_BACKEND = simulavr + +# GDB Init Filename. +GDBINIT_FILE = __avr_gdbinit + +# When using avarice settings for the JTAG +JTAG_DEV = /dev/com1 + +# Debugging port used to communicate between GDB / avarice / simulavr. +DEBUG_PORT = 4242 + +# Debugging host used to communicate between GDB / avarice / simulavr, normally +# just set to localhost unless doing some sort of crazy debugging when +# avarice is running on a different computer. +DEBUG_HOST = localhost + + + +#============================================================================ + + +# Define programs and commands. +SHELL = sh +CC = avr-gcc +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump +SIZE = avr-size +AR = avr-ar rcs +NM = avr-nm +AVRDUDE = avrdude +REMOVE = rm -f +REMOVEDIR = rm -rf +COPY = cp +WINSHELL = cmd + + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = -------- begin -------- +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_COFF = Converting to AVR COFF: +MSG_EXTENDED_COFF = Converting to AVR Extended COFF: +MSG_FLASH = Creating load file for Flash: +MSG_EEPROM = Creating load file for EEPROM: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling C: +MSG_COMPILING_CPP = Compiling C++: +MSG_ASSEMBLING = Assembling: +MSG_CLEANING = Cleaning project: +MSG_CREATING_LIBRARY = Creating library: + + + + +# Define all object files. +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + +# Define all listing files. +LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + + +# Compiler flags to generate dependency files. +GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d + + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + + + + +# Default target. +all: begin gccversion sizebefore build sizeafter end + +# Change the build target to build a HEX file or a library. +build: elf hex eep lss sym +#build: lib + + +elf: $(TARGET).elf +hex: $(TARGET).hex +eep: $(TARGET).eep +lss: $(TARGET).lss +sym: $(TARGET).sym +LIBNAME=lib$(TARGET).a +lib: $(LIBNAME) + + + +# Eye candy. +# AVR Studio 3.x does not check make's exit code but relies on +# the following magic strings to be generated by the compile job. +begin: + @echo + @echo $(MSG_BEGIN) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf +MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) +FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) + + +sizebefore: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ + 2>/dev/null; echo; fi + +sizeafter: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ + 2>/dev/null; echo; fi + + + +# Display compiler version information. +gccversion : + @$(CC) --version + + +# Program the device. +program: $(TARGET).hex $(TARGET).eep + $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) + +flip: $(TARGET).hex + batchisp -hardware usb -device $(MCU) -operation erase f + batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program + batchisp -hardware usb -device $(MCU) -operation start reset 0 + +dfu: $(TARGET).hex + dfu-programmer $(MCU) erase + dfu-programmer $(MCU) flash $(TARGET).hex + dfu-programmer $(MCU) reset + +flip-ee: $(TARGET).hex $(TARGET).eep + $(COPY) $(TARGET).eep $(TARGET)eep.hex + batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase + batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program + batchisp -hardware usb -device $(MCU) -operation start reset 0 + $(REMOVE) $(TARGET)eep.hex + +dfu-ee: $(TARGET).hex $(TARGET).eep + dfu-programmer $(MCU) eeprom-flash $(TARGET).eep + dfu-programmer $(MCU) reset + + +# Generate avr-gdb config/init file which does the following: +# define the reset signal, load the target file, connect to target, and set +# a breakpoint at main(). +gdb-config: + @$(REMOVE) $(GDBINIT_FILE) + @echo define reset >> $(GDBINIT_FILE) + @echo SIGNAL SIGHUP >> $(GDBINIT_FILE) + @echo end >> $(GDBINIT_FILE) + @echo file $(TARGET).elf >> $(GDBINIT_FILE) + @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE) +ifeq ($(DEBUG_BACKEND),simulavr) + @echo load >> $(GDBINIT_FILE) +endif + @echo break main >> $(GDBINIT_FILE) + +debug: gdb-config $(TARGET).elf +ifeq ($(DEBUG_BACKEND), avarice) + @echo Starting AVaRICE - Press enter when "waiting to connect" message displays. + @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \ + $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT) + @$(WINSHELL) /c pause + +else + @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \ + $(DEBUG_MFREQ) --port $(DEBUG_PORT) +endif + @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE) + + + + +# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +COFFCONVERT = $(OBJCOPY) --debugging +COFFCONVERT += --change-section-address .data-0x800000 +COFFCONVERT += --change-section-address .bss-0x800000 +COFFCONVERT += --change-section-address .noinit-0x800000 +COFFCONVERT += --change-section-address .eeprom-0x810000 + + + +coff: $(TARGET).elf + @echo + @echo $(MSG_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-avr $< $(TARGET).cof + + +extcoff: $(TARGET).elf + @echo + @echo $(MSG_EXTENDED_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof + + + +# Create final output files (.hex, .eep) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@ + +%.eep: %.elf + @echo + @echo $(MSG_EEPROM) $@ + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ + --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0 + +# Create extended listing file from ELF output file. +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S -z $< > $@ + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + + +# Create library from object files. +.SECONDARY : $(TARGET).a +.PRECIOUS : $(OBJ) +%.a: $(OBJ) + @echo + @echo $(MSG_CREATING_LIBRARY) $@ + $(AR) $@ $(OBJ) + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(OBJ) +%.elf: $(OBJ) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +$(OBJDIR)/%.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create object files from C++ source files. +$(OBJDIR)/%.o : %.cpp + @echo + @echo $(MSG_COMPILING_CPP) $< + $(CC) -c $(ALL_CPPFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +%.s : %.c + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C++ source files. +%.s : %.cpp + $(CC) -S $(ALL_CPPFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +$(OBJDIR)/%.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Create preprocessed source for use in sending a bug report. +%.i : %.c + $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ + + +# Target: clean project. +clean: begin clean_list end + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).eep + $(REMOVE) $(TARGET).cof + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lss + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) $(SRC:.c=.i) + $(REMOVEDIR) .dep + +doxygen: + @echo Generating Project Documentation \($(TARGET)\)... + @if ( doxygen Doxygen.conf 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then \ + exit 1; \ + fi; + @echo Documentation Generation Complete. + +clean_doxygen: + rm -rf Documentation + +checksource: + @for f in $(SRC) $(CPPSRC) $(ASRC); do \ + if [ -f $$f ]; then \ + echo "Found Source File: $$f" ; \ + else \ + echo "Source File Not Found: $$f" ; \ + fi; done + + +# Create object files directory +$(shell mkdir $(OBJDIR) 2>/dev/null) + + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff doxygen clean \ +clean_list clean_doxygen program dfu flip flip-ee dfu-ee \ +debug gdb-config checksource diff --git a/Projects/makefile b/Projects/makefile index 707188cf90..d8fe77a89a 100644 --- a/Projects/makefile +++ b/Projects/makefile @@ -41,6 +41,9 @@ all: $(MAKE) -C RelayBoard clean $(MAKE) -C RelayBoard all + $(MAKE) -C SerialToLCD clean + $(MAKE) -C SerialToLCD all + $(MAKE) -C TempDataLogger clean $(MAKE) -C TempDataLogger all @@ -63,6 +66,7 @@ all: $(MAKE) -C MIDIToneGenerator $@ $(MAKE) -C MissileLauncher $@ $(MAKE) -C RelayBoard $@ + $(MAKE) -C SerialToLCD $@ $(MAKE) -C TempDataLogger $@ $(MAKE) -C USBtoSerial $@ $(MAKE) -C Webserver $@ From bd3f6794dd95c8a8895b3cf25de3332bda603241 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 14 Apr 2012 21:47:02 +0000 Subject: [PATCH 03/37] Minor formatting updates to the SerialToLCD project. --- Projects/SerialToLCD/Lib/HD44780.c | 10 +++--- Projects/SerialToLCD/Lib/HD44780.h | 14 ++++---- Projects/SerialToLCD/SerialToLCD.c | 25 --------------- Projects/SerialToLCD/SerialToLCD.txt | 48 +++++++++++++++++++++++++++- 4 files changed, 59 insertions(+), 38 deletions(-) diff --git a/Projects/SerialToLCD/Lib/HD44780.c b/Projects/SerialToLCD/Lib/HD44780.c index d67dc6d408..7bf989d2cd 100644 --- a/Projects/SerialToLCD/Lib/HD44780.c +++ b/Projects/SerialToLCD/Lib/HD44780.c @@ -83,11 +83,11 @@ static void HD44780_WriteByte(const uint8_t c) static void HD44780_PowerUp4Bit(void) { - /* Wait for more than 40 ms after VCC rises to 2.7 V */ + /* Wait for more than 40 ms after VCC rises to 2.7 V */ _delay_ms(40); HD44780_WriteNibble(0x03); // FN_SET 8-bit - /* Wait for more than 4.1 ms */ + /* Wait for more than 4.1 ms */ _delay_ms(5); HD44780_WriteNibble(0x03); // FN_SET 8-bit @@ -95,12 +95,12 @@ static void HD44780_PowerUp4Bit(void) _delay_us(100); HD44780_WriteNibble(0x03); // FN_SET 8-bit - /* From now on we must allow 40us for each command */ + /* From now on we must allow 40us for each command */ _delay_us(50); HD44780_WriteNibble(0x02); // FN_SET 4-bit - /* The LCD is now in 4-bit mode so we can continue - using the 4-bit API */ + /* The LCD is now in 4-bit mode so we can continue + using the 4-bit API */ _delay_us(50); } diff --git a/Projects/SerialToLCD/Lib/HD44780.h b/Projects/SerialToLCD/Lib/HD44780.h index a800ae712d..680e69bcf6 100644 --- a/Projects/SerialToLCD/Lib/HD44780.h +++ b/Projects/SerialToLCD/Lib/HD44780.h @@ -43,16 +43,16 @@ #include /* Macros: */ - #define RS (0x10) // PD4 - #define ENABLE (0x80) // PD7 + #define RS (1 << 4) /* PD4 */ + #define ENABLE (1 << 7) /* PD7 */ - #define HI4_MASK (0xF0) - #define LO4_MASK (0x0F) // PD0..3 + #define HI4_MASK 0xF0 + #define LO4_MASK 0x0F /* PD0-PD3 */ - #define ALL_BITS (RS|ENABLE|LO4_MASK) + #define ALL_BITS (RS | ENABLE | LO4_MASK) - #define HI4( c ) (( c & HI4_MASK ) >> 4 ) - #define LO4( c ) (( c & LO4_MASK ) >> 0 ) + #define HI4(c) ((c & HI4_MASK) >> 4) + #define LO4(c) ((c & LO4_MASK) >> 0) #define CMD_DISPLAY_ON 0x0C diff --git a/Projects/SerialToLCD/SerialToLCD.c b/Projects/SerialToLCD/SerialToLCD.c index 7a289270b4..59522b3518 100644 --- a/Projects/SerialToLCD/SerialToLCD.c +++ b/Projects/SerialToLCD/SerialToLCD.c @@ -33,31 +33,6 @@ * * Main source file for the SerialToLCD program. This file contains the main tasks of * the project and is responsible for the initial application hardware configuration. - * - * \section Hardware Information - * - * LCD Datasheet: See http://www.sparkfun.com/datasheets/LCD/HD44780.pdf - * - * Also see the two articles from EPE which are linked from here: - * http://en.wikipedia.org/wiki/HD44780_Character_LCD - * - * Connections from the Minimus to the HD44780 as shown below. - * - * ========================================================= \n - * Minimus HD44780 Pin \n - * ========================================================= \n - * PD0 DB4 11 \n - * PD1 DB5 12 \n - * PD2 DB6 13 \n - * PD3 DB7 14 \n - * \n - * PD4 RS 4 \n - * RW 5 GND \n - * PD7 EN 6 \n - * \n - * 1 GND \n - * 2 USB +5V \n - * 3 2k -> GND \n */ #include "SerialToLCD.h" diff --git a/Projects/SerialToLCD/SerialToLCD.txt b/Projects/SerialToLCD/SerialToLCD.txt index 8bf2102a48..84237b45f8 100644 --- a/Projects/SerialToLCD/SerialToLCD.txt +++ b/Projects/SerialToLCD/SerialToLCD.txt @@ -47,5 +47,51 @@ * designed to use the Minimum USB AVR board, however it can be modified to suit other hardware * if desired. * - * See comments in the SerialToLCD.c source file for hardware pinouts of the Minimus board. + * LCD Datasheet: http://www.sparkfun.com/datasheets/LCD/HD44780.pdf \n + * More Information: http://en.wikipedia.org/wiki/HD44780_Character_LCD \n + * + * Below are the connections between the AVR Minimus board and LCD. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
AVR Pin:HD44780 LCD Pin:
VCCVCC
GNDGND
PD0DB4
PD1DB5
PD2DB6
PD3DB7
PD4/RS
GND/RW
PD7/E
*/ From e7670d06e0724fc03c743b8f24251e6d25e2b4d6 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 15 Apr 2012 10:00:14 +0000 Subject: [PATCH 04/37] Minor formatting updates to the SerialToLCD project - remove unused variable. --- Projects/SerialToLCD/SerialToLCD.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Projects/SerialToLCD/SerialToLCD.c b/Projects/SerialToLCD/SerialToLCD.c index 59522b3518..952e2d4f22 100644 --- a/Projects/SerialToLCD/SerialToLCD.c +++ b/Projects/SerialToLCD/SerialToLCD.c @@ -99,27 +99,28 @@ int main(void) while (RingBuffer_GetCount(&FromHost_Buffer) > 0) { - static uint8_t escape_pending = 0; + static uint8_t EscapePending = 0; int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer); if (HD44780Byte == COMMAND_ESCAPE) { - if (escape_pending) + if (EscapePending) { HD44780_WriteData(HD44780Byte); - escape_pending = 0; + EscapePending = 0; } else { - escape_pending = 1; + /* Next received character is the command byte */ + EscapePending = 1; } } else { - if (escape_pending) + if (EscapePending) { HD44780_WriteCommand(HD44780Byte); - escape_pending = 0; + EscapePending = 0; } else { @@ -157,9 +158,7 @@ void SetupHardware(void) /** Event handler for the library USB Configuration Changed event. */ void EVENT_USB_Device_ConfigurationChanged(void) { - bool ConfigSuccess = true; - - ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface); + CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface); } /** Event handler for the library USB Control Request reception event. */ From c0841d98c5daac365f47f36b626b85632a071812 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 15 Apr 2012 13:34:11 +0000 Subject: [PATCH 05/37] Fixed incorrect reponse to GET STATUS requests in device mode if NO_DEVICE_SELF_POWER or NO_DEVICE_REMOTE_WAKEUP tokens are defined (thanks to Georg Glock). --- LUFA/DoxygenPages/ChangeLog.txt | 1 + LUFA/Drivers/USB/Core/DeviceStandardReq.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 6bf1e82b55..d7fcd4a70d 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -46,6 +46,7 @@ * - Fixed compile error for the UC3 architecture when INTERRUPT_CONTROL_ENDPOINT is specified (thanks to Andrus Aaslaid) * - Fixed compile error if LEDs_Disable() is called and BOARD=NONE is set (thanks to Sam Lin) * - Fixed inverted LED logic in the OLIMEX162 board LED driver + * - Fixed incorrect reponse to GET STATUS requests in device mode if NO_DEVICE_SELF_POWER or NO_DEVICE_REMOTE_WAKEUP tokens are defined (thanks to Georg Glock) * - Library Applications: * - Fixed error in the AVRISP-MKII programmer when ISP mode is used at 64KHz (thanks to Ben R. Porter) * - Fixed AVRISP-MKII programmer project failing to compile for the U4 chips when VTARGET_ADC_CHANNEL is defined to an invalid channel and NO_VTARGET_DETECT is diff --git a/LUFA/Drivers/USB/Core/DeviceStandardReq.c b/LUFA/Drivers/USB/Core/DeviceStandardReq.c index 61082cfbb3..f5e1cca33b 100644 --- a/LUFA/Drivers/USB/Core/DeviceStandardReq.c +++ b/LUFA/Drivers/USB/Core/DeviceStandardReq.c @@ -289,7 +289,6 @@ static void USB_Device_GetStatus(void) switch (USB_ControlRequest.bmRequestType) { - #if !defined(NO_DEVICE_SELF_POWER) || !defined(NO_DEVICE_REMOTE_WAKEUP) case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE): #if !defined(NO_DEVICE_SELF_POWER) if (USB_Device_CurrentlySelfPowered) @@ -301,17 +300,16 @@ static void USB_Device_GetStatus(void) CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED; #endif break; - #endif - #if !defined(CONTROL_ONLY_DEVICE) case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT): + #if !defined(CONTROL_ONLY_DEVICE) Endpoint_SelectEndpoint((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); CurrentStatus = Endpoint_IsStalled(); Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + #endif break; - #endif default: return; } From 02120ebc38fb14580c1e984b2ad5697d8fff92d0 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 15 Apr 2012 13:51:11 +0000 Subject: [PATCH 06/37] Minor documentation improvements. --- Bootloaders/CDC/BootloaderCDC.txt | 6 +++--- Bootloaders/DFU/BootloaderDFU.txt | 6 +++--- Bootloaders/HID/BootloaderHID.txt | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Bootloaders/CDC/BootloaderCDC.txt b/Bootloaders/CDC/BootloaderCDC.txt index d6ab945164..276a0c9c46 100644 --- a/Bootloaders/CDC/BootloaderCDC.txt +++ b/Bootloaders/CDC/BootloaderCDC.txt @@ -47,9 +47,9 @@ * This bootloader enumerates to the host as a CDC Class device (virtual serial port), allowing for AVR109 * protocol compatible programming software to load firmware onto the AVR. * - * Out of the box this bootloader builds for the USB1287, and will fit into 4KB of bootloader space. If - * you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU - * values in the accompanying makefile. + * Out of the box this bootloader builds for the AT90USBUSB1287, and will fit into 4KB of bootloader space. + * If you wish to enlarge this space and/or change the AVR model, you will need to edit the MCU, FLASH_SIZE_KB + * and BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the * bootloader from the normal user application. diff --git a/Bootloaders/DFU/BootloaderDFU.txt b/Bootloaders/DFU/BootloaderDFU.txt index d0811b2aa0..e10beea36d 100644 --- a/Bootloaders/DFU/BootloaderDFU.txt +++ b/Bootloaders/DFU/BootloaderDFU.txt @@ -47,9 +47,9 @@ * This bootloader enumerates to the host as a DFU Class device, allowing for DFU-compatible programming * software to load firmware onto the AVR. * - * Out of the box this bootloader builds for the USB1287, and should fit into 4KB of bootloader space. If - * you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU - * values in the accompanying makefile. + * Out of the box this bootloader builds for the AT90USBUSB1287, and will fit into 4KB of bootloader space. + * If you wish to enlarge this space and/or change the AVR model, you will need to edit the MCU, FLASH_SIZE_KB + * and BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the * bootloader from the normal user application. diff --git a/Bootloaders/HID/BootloaderHID.txt b/Bootloaders/HID/BootloaderHID.txt index a774ab485b..d32efeeb71 100644 --- a/Bootloaders/HID/BootloaderHID.txt +++ b/Bootloaders/HID/BootloaderHID.txt @@ -51,10 +51,10 @@ * from PJRC (used with permission). This bootloader is deliberatley non-compatible with the properietary PJRC * HalfKay bootloader GUI; only the command line interface software accompanying this bootloader will work with it. * - * Out of the box this bootloader builds for the USB1287, and will fit into 2KB of bootloader space for the + * Out of the box this bootloader builds for the AT90USB1287, and will fit into 2KB of bootloader space for the * Series 2 USB AVRs (ATMEGAxxU2, AT90USBxx2) or 4KB of bootloader space for all other models. If you wish to - * enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU values in the - * accompanying makefile. + * enlarge this space and/or change the AVR model, you will need to edit the MCU, FLASH_SIZE_KB and + * BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * \section Sec_Installation Driver Installation * From 3703d50580c8b9ca3022e22be00b8b261d71bb3c Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 15 Apr 2012 19:06:04 +0000 Subject: [PATCH 07/37] Minor documentation improvements. --- LUFA/DoxygenPages/LibraryResources.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LUFA/DoxygenPages/LibraryResources.txt b/LUFA/DoxygenPages/LibraryResources.txt index 7137a56a0c..ac1915c532 100644 --- a/LUFA/DoxygenPages/LibraryResources.txt +++ b/LUFA/DoxygenPages/LibraryResources.txt @@ -9,6 +9,7 @@ * * \section Sec_UnofficialResources Unofficial Resources * Unofficial Russian LUFA documentation translation: http://microsin.ru/Download.cnt/doc/LUFA/ \n + * Tutorial for LUFA USB Control Transfers: http://www.avrbeginners.net/new/tutorials/usb-control-transfers-with-lufa/ * * \section Sec_ProjectPages LUFA Related Webpages * Project Homepage: http://www.lufa-lib.org \n @@ -22,8 +23,8 @@ * * \section Sec_InDevelopment Latest In-Development Source Code * Issue Tracker: http://www.lufa-lib.org/tracker \n - * SVN Access: http://www.lufa-lib.org/svn \n - * GIT Access: http://www.lufa-lib.org/git \n + * Public SVN Repository: http://www.lufa-lib.org/svn \n + * Public GIT Repository: http://www.lufa-lib.org/git \n * Latest Repository Source Archive: http://www.lufa-lib.org/latest-archive \n * Commit RSS Feed: http://www.lufa-lib.org/rss \n * From ce3db96d9a3d66fd517ccf395c0ba0a36f89f5cd Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 15 Apr 2012 19:15:35 +0000 Subject: [PATCH 08/37] Make sure CRC value is pre-zeroed before reading from the XMEGA target device, to prevent corrupt data from being returned to the host in the AVRISP-MKII Clone project. --- Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c index 97154ea1ed..b782475831 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c @@ -174,6 +174,8 @@ void XMEGANVM_DisablePDI(void) */ bool XMEGANVM_GetMemoryCRC(const uint8_t CRCCommand, uint32_t* const CRCDest) { + *CRCDest = 0; + /* Wait until the NVM controller is no longer busy */ if (!(XMEGANVM_WaitWhileNVMControllerBusy())) return false; From cf7859e2f226482d60178dbe8897f3f725a7146e Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 15 Apr 2012 19:23:00 +0000 Subject: [PATCH 09/37] Minor documentation improvements. --- Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h | 2 +- Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c | 2 +- Projects/XPLAINBridge/XPLAINBridge.txt | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h index 523fc15bd0..6056535886 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h @@ -51,7 +51,7 @@ #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) /* On the XPLAIN board, we only need PDI programming for the ATXMEGA128A1 - disable ISP to prevent hardware - damage. + damage and force-enable XPROG. */ #undef ENABLE_ISP_PROTOCOL diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c index b2f55520a6..5ea94043f2 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c @@ -78,7 +78,7 @@ void XPROGTarget_EnableTargetTPI(void) DDRD |= (1 << 5) | (1 << 3); DDRD &= ~(1 << 2); - /* Set up the synchronous USART for TINY communications - 8 data bits, even parity, 2 stop bits */ + /* Set up the synchronous USART for TPI communications - 8 data bits, even parity, 2 stop bits */ UBRR1 = ((F_CPU / 2 / XPROG_HARDWARE_SPEED) - 1); UCSR1B = (1 << TXEN1); UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1); diff --git a/Projects/XPLAINBridge/XPLAINBridge.txt b/Projects/XPLAINBridge/XPLAINBridge.txt index 9dead426eb..e71d06ad79 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.txt +++ b/Projects/XPLAINBridge/XPLAINBridge.txt @@ -79,11 +79,6 @@ * Description: * * - * BUFFER_SIZE - * LightweightRingBuff.h - * Defines the maximum number of bytes which can be buffered in each Ring Buffer when in serial bridge mode. - * - * * LIBUSB_DRIVER_COMPAT * Makefile LUFA_OPTS * Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making From e39f3378a21ae5076e8c49bc728c20e436e3a69f Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 16 Apr 2012 17:01:08 +0000 Subject: [PATCH 10/37] Remove non-functional maintenance link check. --- Maintenance/makefile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Maintenance/makefile b/Maintenance/makefile index 5cce2bf1cf..8daf9c1497 100644 --- a/Maintenance/makefile +++ b/Maintenance/makefile @@ -8,11 +8,12 @@ # Maintenance scripts not required by general LUFA users, used for project development purposes. + +# Path to the root of the LUFA tree LUFA_ROOT = ../ all: - # Update all Doxygen configuration files to the latest Doxygen version - force Markdown support to be disabled upgrade-doxygen: @echo Upgrading Doxygen.conf files... @@ -36,13 +37,6 @@ check-documentation-placeholders: fi; @echo Done. -# Test all generated documentation for any bad links -check-documentation-links: - @for html_file in `find $(LUFA_ROOT) -name *.html`; do \ - echo Checking $$html_file...; \ - cat $$html_file | grep -v "doxygen.org" | grep -v "fourwalledcubicle.com" | wget -nv --referer=www.lufa-lib.org --user-agent="lufa-link-check-script" -B $(dir $$html_file) --spider --force-html --input-file=-; \ - done; - # Validate the working branch - compile all documentation, demos/projects/examples and run build tests validate-branch: make -s -C $(LUFA_ROOT) doxygen From 56aed4b3e6f4172d34dd20dca3f5479d4c912104 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 16 Apr 2012 17:03:07 +0000 Subject: [PATCH 11/37] Fixed AVRISP-MKII programmer project reset line polarity inverted when the generated EEP file is loaded into the USB AVR's EEPROM and avr-dude is used. --- LUFA/DoxygenPages/ChangeLog.txt | 1 + Projects/AVRISP-MKII/Lib/V2ProtocolParams.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index d7fcd4a70d..150d5de399 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -51,6 +51,7 @@ * - Fixed error in the AVRISP-MKII programmer when ISP mode is used at 64KHz (thanks to Ben R. Porter) * - Fixed AVRISP-MKII programmer project failing to compile for the U4 chips when VTARGET_ADC_CHANNEL is defined to an invalid channel and NO_VTARGET_DETECT is * defined (thanks to Steven Morehouse) + * - Fixed AVRISP-MKII programmer project reset line polarity inverted when the generated EEP file is loaded into the USB AVR's EEPROM and avr-dude is used * - Fixed CDC and DFU bootloaders failing to compile when the bootloader section size is 8KB or more (thanks to Georg Glock) * * \section Sec_ChangeLog120219 Version 120219 diff --git a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c index 1ec2b042cb..2c5ac3f468 100644 --- a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c +++ b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c @@ -37,7 +37,7 @@ #include "V2ProtocolParams.h" /* Non-Volatile Parameter Values for EEPROM storage */ -static uint8_t EEMEM EEPROM_Reset_Polarity = 0x00; +static uint8_t EEMEM EEPROM_Reset_Polarity = 0x01; /* Volatile Parameter Values for RAM storage */ static ParameterItem_t ParameterTable[] = From b42642a5d6011f84422d338e38a2bfca46ed3ee8 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 16 Apr 2012 20:43:30 +0000 Subject: [PATCH 12/37] Fix up static analysis build test so that inline suppressions for missing header files are not required in the XPLAINBridge project. --- BuildTests/StaticAnalysisTest/makefile | 3 ++- Projects/XPLAINBridge/XPLAINBridge.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/BuildTests/StaticAnalysisTest/makefile b/BuildTests/StaticAnalysisTest/makefile index 817727ea34..70adf0f151 100644 --- a/BuildTests/StaticAnalysisTest/makefile +++ b/BuildTests/StaticAnalysisTest/makefile @@ -24,7 +24,8 @@ SUPPRESS_WARNINGS = variableScope \ missingInclude # Extra paths to search for include files -INCLUDE_PATHS = $(LUFA_ROOT_PATH)/LUFA/CodeTemplates/ +INCLUDE_PATHS = $(LUFA_ROOT_PATH)/LUFA/CodeTemplates/ \ + $(LUFA_ROOT_PATH)/Projects/AVRISP-MKII/ # Configuration options to pass to cppcheck CPPCHECK_OPTIONS = --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) --inline-suppr --force --error-exitcode=1 --std=c99 diff --git a/Projects/XPLAINBridge/XPLAINBridge.h b/Projects/XPLAINBridge/XPLAINBridge.h index 5570a1a0a6..33c66bf516 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.h +++ b/Projects/XPLAINBridge/XPLAINBridge.h @@ -46,9 +46,7 @@ #include "AVRISPDescriptors.h" #include "USARTDescriptors.h" - // cppcheck-suppress missingInclude #include "Lib/V2Protocol.h" - // cppcheck-suppress missingInclude #include "Lib/SoftUART.h" #include From 1ab76048c9c727a588a0cc0fab285222b5916df5 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 18 Apr 2012 18:59:40 +0000 Subject: [PATCH 13/37] Alter the bootloader section sizes to all be 8KB, to be in line with the default AT90USB1287 fuses, as that is the default target MCU. Add instructions to the documentation to clarify this for the user (thanks to Georg Glock). --- Bootloaders/CDC/BootloaderCDC.txt | 6 +++--- Bootloaders/CDC/makefile | 2 +- Bootloaders/DFU/BootloaderDFU.txt | 6 +++--- Bootloaders/DFU/makefile | 2 +- Bootloaders/HID/BootloaderHID.txt | 8 ++++---- Bootloaders/HID/makefile | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Bootloaders/CDC/BootloaderCDC.txt b/Bootloaders/CDC/BootloaderCDC.txt index 276a0c9c46..618b95d257 100644 --- a/Bootloaders/CDC/BootloaderCDC.txt +++ b/Bootloaders/CDC/BootloaderCDC.txt @@ -47,9 +47,9 @@ * This bootloader enumerates to the host as a CDC Class device (virtual serial port), allowing for AVR109 * protocol compatible programming software to load firmware onto the AVR. * - * Out of the box this bootloader builds for the AT90USBUSB1287, and will fit into 4KB of bootloader space. - * If you wish to enlarge this space and/or change the AVR model, you will need to edit the MCU, FLASH_SIZE_KB - * and BOOT_SECTION_SIZE_KB values in the accompanying makefile. + * Out of the box this bootloader builds for the AT90USB1287 with an 8KB bootloader section size, and will fit + * into 4KB of bootloader space. If you wish to alter this size and/or change the AVR model, you will need to + * edit the MCU, FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the * bootloader from the normal user application. diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile index 066fb8884d..a92172d543 100644 --- a/Bootloaders/CDC/makefile +++ b/Bootloaders/CDC/makefile @@ -95,7 +95,7 @@ F_USB = $(F_CPU) # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 4 +BOOT_SECTION_SIZE_KB = 8 # Formulas used to calculate the starting address of the Bootloader section, and the User Application diff --git a/Bootloaders/DFU/BootloaderDFU.txt b/Bootloaders/DFU/BootloaderDFU.txt index e10beea36d..2c9eaf1de5 100644 --- a/Bootloaders/DFU/BootloaderDFU.txt +++ b/Bootloaders/DFU/BootloaderDFU.txt @@ -47,9 +47,9 @@ * This bootloader enumerates to the host as a DFU Class device, allowing for DFU-compatible programming * software to load firmware onto the AVR. * - * Out of the box this bootloader builds for the AT90USBUSB1287, and will fit into 4KB of bootloader space. - * If you wish to enlarge this space and/or change the AVR model, you will need to edit the MCU, FLASH_SIZE_KB - * and BOOT_SECTION_SIZE_KB values in the accompanying makefile. + * Out of the box this bootloader builds for the AT90USB1287 with an 8KB bootloader section size, and will fit + * into 4KB of bootloader space. If you wish to alter this size and/or change the AVR model, you will need to + * edit the MCU, FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the * bootloader from the normal user application. diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile index 608564ebe7..f78ceb270e 100644 --- a/Bootloaders/DFU/makefile +++ b/Bootloaders/DFU/makefile @@ -95,7 +95,7 @@ F_USB = $(F_CPU) # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 4 +BOOT_SECTION_SIZE_KB = 8 # Formulas used to calculate the starting address of the Bootloader section, and the User Application diff --git a/Bootloaders/HID/BootloaderHID.txt b/Bootloaders/HID/BootloaderHID.txt index d32efeeb71..f6c084d65f 100644 --- a/Bootloaders/HID/BootloaderHID.txt +++ b/Bootloaders/HID/BootloaderHID.txt @@ -51,10 +51,10 @@ * from PJRC (used with permission). This bootloader is deliberatley non-compatible with the properietary PJRC * HalfKay bootloader GUI; only the command line interface software accompanying this bootloader will work with it. * - * Out of the box this bootloader builds for the AT90USB1287, and will fit into 2KB of bootloader space for the - * Series 2 USB AVRs (ATMEGAxxU2, AT90USBxx2) or 4KB of bootloader space for all other models. If you wish to - * enlarge this space and/or change the AVR model, you will need to edit the MCU, FLASH_SIZE_KB and - * BOOT_SECTION_SIZE_KB values in the accompanying makefile. + * Out of the box this bootloader builds for the AT90USB1287 with an 8KB bootloader section size, and will fit + * into 2KB of bootloader space for the Series 2 USB AVRs (ATMEGAxxU2, AT90USBxx2) or 4KB of bootloader space for + * all other models. If you wish to alter this size and/or change the AVR model, you will need to edit the MCU, + * FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * \section Sec_Installation Driver Installation * diff --git a/Bootloaders/HID/makefile b/Bootloaders/HID/makefile index efbb6a645b..bfefbf6954 100644 --- a/Bootloaders/HID/makefile +++ b/Bootloaders/HID/makefile @@ -95,7 +95,7 @@ F_USB = $(F_CPU) # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 4 +BOOT_SECTION_SIZE_KB = 8 # Formulas used to calculate the starting address of the Bootloader section. These formulas From c48da94605c12009dc30ab861a97a78c1d4d26de Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 18 Apr 2012 20:06:18 +0000 Subject: [PATCH 14/37] Add known issues to the documentation. --- LUFA.pnproj | 2 +- LUFA/DoxygenPages/FutureChanges.txt | 1 - LUFA/DoxygenPages/KnownIssues.txt | 38 +++++++++++++++++++++++++++++ LUFA/DoxygenPages/MainPage.txt | 1 + 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 LUFA/DoxygenPages/KnownIssues.txt diff --git a/LUFA.pnproj b/LUFA.pnproj index 86d3a641d8..2cb678239f 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/DoxygenPages/FutureChanges.txt b/LUFA/DoxygenPages/FutureChanges.txt index 3e7a217b9a..d0453a207a 100644 --- a/LUFA/DoxygenPages/FutureChanges.txt +++ b/LUFA/DoxygenPages/FutureChanges.txt @@ -26,7 +26,6 @@ * -# Make HOST_DEVICE_SETTLE_DELAY_MS a global variable that can be changed * -# Add MANDATORY_EVENT_FUNCTIONS compile time option * -# Add watchdog support to the library and apps/bootloaders - * -# Fix Still Image Host class driver - missing reqs, parameters * - Testing/Verification * -# Re-run USBIF test suite on all classes to formally verify operation * -# Implement automated functional testing of all demos diff --git a/LUFA/DoxygenPages/KnownIssues.txt b/LUFA/DoxygenPages/KnownIssues.txt new file mode 100644 index 0000000000..67da093c93 --- /dev/null +++ b/LUFA/DoxygenPages/KnownIssues.txt @@ -0,0 +1,38 @@ +/** \file + * + * This file contains special DoxyGen information for the generation of the main page and other special + * documentation pages. It is not a project source file. + */ + + /** \page Page_KnownIssues Known Issues + * The following are known issues present in each official LUFA release. This list should contain all known + * issues in the library. Most of these issues should be corrected in the future release - see + * \ref Page_FutureChanges for a list of planned changes in future releases. + * + * \section Sec_KnownIssuesXXXXXX Version XXXXXX + * - AVR8 Architecture + * - No known issues. + * - XMEGA Architecture + * - No demos, bootloaders or projects have been ported for the XMEGA devices in the current release, + * although the architecture is supported in the LUFA core library. + * - Endpoints of more than 64 bytes are not currently supported in this release. + * - Isochronous endpoints are not currently supported in this release. As a result, the audio class + * cannot be used on XMEGA devices. + * - Multiple-bank endpoints are not currently supported in this release. + * - Early revisions of the ATXMEGA128A1U are incompatible with LUFA, due to their various errata + * relating to the USB controller. + * - UC3 Architecture + * - No demos, bootloaders or projects have been ported for the UC3 devices in the current release, + * although the architecture is supported in the LUFA core library. + * - DMA transfers to and from the USB controller are not yet implemented for this release. + * - The UC3C, UC3D and UC3L sub-families of UC3 are not currently supported by the library due to their + * altered USB controller design. + * - Architecture Independant + * - The HID parser fails for array type elements that have a MIN and MAX usage applied; each element + * in the array will receive a unique incrementing usage from the MIN value, up to MAX. + * - The current application makefiles do not work if the output directory is not the same directory + * as the makefile itself. + * - The LUFA library is not watchdog aware, and thus timeouts are possible if short periods are used + * and a lengthy USB operation is initiated. + */ + diff --git a/LUFA/DoxygenPages/MainPage.txt b/LUFA/DoxygenPages/MainPage.txt index ed96d1a66c..e737c39b5a 100644 --- a/LUFA/DoxygenPages/MainPage.txt +++ b/LUFA/DoxygenPages/MainPage.txt @@ -42,6 +42,7 @@ * \li \subpage Page_Donating - Donating to support this project * \li \subpage Page_DeviceSupport - Current Device and Hardware Support * \li \subpage Page_ChangeLog - Project Changelog + * \li \subpage Page_KnownIssues - Known Issues * \li \subpage Page_FutureChanges - Planned Changes to the Library * \li \subpage Page_GettingStarted - Getting started with LUFA * \li \subpage Page_DevelopingWithLUFA - Developing with LUFA From cfa399a533e40b15a96a90e3e18390d4ae595306 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 19 Apr 2012 19:55:16 +0000 Subject: [PATCH 15/37] Remove an unused variable in the HID loader CLI application. Update known issues list. --- Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c | 4 ---- LUFA/DoxygenPages/KnownIssues.txt | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c b/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c index 6063e19811..c86b0da9c6 100644 --- a/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c +++ b/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c @@ -970,13 +970,9 @@ void parse_options(int argc, char **argv) } else if (strncmp(arg, "-mmcu=", 6) == 0) { arg += 6; - uint8_t valid_prefix = 0; - if (strncmp(arg, "at90usb", 7) == 0) { - valid_prefix = 1; arg += 7; } else if (strncmp(arg, "atmega", 6) == 0) { - valid_prefix = 1; arg += 6; } else { die("Unknown MCU type\n"); diff --git a/LUFA/DoxygenPages/KnownIssues.txt b/LUFA/DoxygenPages/KnownIssues.txt index 67da093c93..9b648144bb 100644 --- a/LUFA/DoxygenPages/KnownIssues.txt +++ b/LUFA/DoxygenPages/KnownIssues.txt @@ -27,6 +27,8 @@ * - DMA transfers to and from the USB controller are not yet implemented for this release. * - The UC3C, UC3D and UC3L sub-families of UC3 are not currently supported by the library due to their * altered USB controller design. + * - The various \c CreateStream() functions for creating standard \c compatible virtual file + * streams are not available on the UC3 architecture, due to a lack of suitable library support. * - Architecture Independant * - The HID parser fails for array type elements that have a MIN and MAX usage applied; each element * in the array will receive a unique incrementing usage from the MIN value, up to MAX. From c7bfcf2cbb5f87b0154e3a1e743bc7d0059cd1c9 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 23 Apr 2012 17:39:53 +0000 Subject: [PATCH 16/37] Fix documentation of the board LED driver (thanks to Karl Lunt). --- LUFA/Drivers/Board/LEDs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index 46589c28d3..9b8ebffb6b 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -80,11 +80,11 @@ * // Turn on each of the four LEDs in turn * LEDs_SetAllLEDs(LEDS_LED1); * Delay_MS(500); - * LEDs_SetAllLEDs(LEDS_LED1); + * LEDs_SetAllLEDs(LEDS_LED2); * Delay_MS(500); - * LEDs_SetAllLEDs(LEDS_LED1); + * LEDs_SetAllLEDs(LEDS_LED3); * Delay_MS(500); - * LEDs_SetAllLEDs(LEDS_LED1); + * LEDs_SetAllLEDs(LEDS_LED4); * Delay_MS(500); * * // Turn on all LEDs From 5b5b73ce582d2afa40218e44b45a97ec6c6ce9cf Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 25 Apr 2012 18:27:27 +0000 Subject: [PATCH 17/37] Add basic hardware mapping information for all supported boards. --- LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h | 5 +++++ LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h | 15 ++++++--------- LUFA/Drivers/Board/AVR8/BENITO/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/BENITO/LEDs.h | 6 ++++++ LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h | 7 +++++++ LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h | 8 +++++++- LUFA/Drivers/Board/AVR8/BUI/LEDs.h | 7 +++++++ LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h | 5 +++++ LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h | 8 ++++++++ LUFA/Drivers/Board/AVR8/CULV3/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/CULV3/LEDs.h | 5 +++++ LUFA/Drivers/Board/AVR8/EVK527/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h | 5 +++++ LUFA/Drivers/Board/AVR8/EVK527/Joystick.h | 5 +++++ LUFA/Drivers/Board/AVR8/EVK527/LEDs.h | 7 +++++++ LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h | 5 +++++ LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h | 6 ++++++ LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h | 12 ++++++++++++ LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h | 12 ++++++++++++ LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h | 5 +++++ LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h | 14 ++++++++++++-- LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h | 7 +++++++ LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h | 5 +++++ LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h | 8 ++++++++ LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h | 5 +++++ LUFA/Drivers/Board/AVR8/STK525/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/STK525/Dataflash.h | 5 +++++ LUFA/Drivers/Board/AVR8/STK525/Joystick.h | 7 ++++++- LUFA/Drivers/Board/AVR8/STK525/LEDs.h | 8 ++++++++ LUFA/Drivers/Board/AVR8/STK526/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/STK526/Dataflash.h | 5 +++++ LUFA/Drivers/Board/AVR8/STK526/Joystick.h | 5 +++++ LUFA/Drivers/Board/AVR8/STK526/LEDs.h | 8 ++++++++ LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h | 12 ++++++++++++ LUFA/Drivers/Board/AVR8/TUL/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/TUL/LEDs.h | 5 +++++ LUFA/Drivers/Board/AVR8/UDIP/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/UDIP/LEDs.h | 8 ++++++++ LUFA/Drivers/Board/AVR8/UNO/LEDs.h | 6 ++++++ LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h | 12 ++++++++++++ LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h | 5 +++++ LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h | 6 ++++++ LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h | 5 +++++ LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h | 8 ++++++++ LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h | 5 +++++ LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h | 7 +++++++ LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h | 13 +++++++++++++ LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h | 5 +++++ LUFA/Drivers/Board/UC3/EVK1100/Buttons.h | 7 +++++++ LUFA/Drivers/Board/UC3/EVK1100/Joystick.h | 5 +++++ LUFA/Drivers/Board/UC3/EVK1100/LEDs.h | 12 ++++++++++++ LUFA/Drivers/Board/UC3/EVK1101/Buttons.h | 6 ++++++ LUFA/Drivers/Board/UC3/EVK1101/Joystick.h | 5 +++++ LUFA/Drivers/Board/UC3/EVK1101/LEDs.h | 8 ++++++++ LUFA/Drivers/Board/UC3/EVK1104/Buttons.h | 5 +++++ LUFA/Drivers/Board/UC3/EVK1104/LEDs.h | 8 ++++++++ LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h | 7 +++++++ .../Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h | 5 +++++ LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h | 6 ++++++ LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h | 8 ++++++++ LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h | 5 +++++ LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h | 9 +++++++++ 71 files changed, 460 insertions(+), 13 deletions(-) diff --git a/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h b/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h index 3fca6562eb..f13b75624f 100644 --- a/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h @@ -42,6 +42,11 @@ * * Board specific LED driver header for the Adafruit U4 Breakout board (http://ladyada.net/products/atmega32u4breakout). * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTE.6
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h index adec49adf5..c7cce17c27 100644 --- a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Atmel ATAVRUSBRF01. * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h index 77fc05beeb..06dcada7de 100644 --- a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h @@ -42,6 +42,12 @@ * * Board specific LED driver header for the Atmel ATAVRUSBRF01. * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenRX LEDHighPORTD.0
LEDS_LED2RedTX LEDHighPORTD.1
+ * * @{ */ @@ -61,15 +67,6 @@ #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #endif - /* Private Interface - For use in library only: */ - #if !defined(__DOXYGEN__) - /* Macros: */ - #define LEDS_PORTD_LEDS (LEDS_LED1 | LEDS_LED2) - #define LEDS_PORTE_LEDS (LEDS_LED3 | LEDS_LED4) - - #define LEDS_PORTE_MASK_SHIFT 4 - #endif - /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ diff --git a/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h b/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h index a7ce1b5c7f..800fa15440 100644 --- a/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h b/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h index 6e7de07869..429f33e250 100644 --- a/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h @@ -42,6 +42,12 @@ * * Board specific LED driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito). * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenTX LEDLowPORTC.7
LEDS_LED2RedRX LEDLowPORTC.6
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h b/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h index 77b7d97ae8..4c749618a6 100644 --- a/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h @@ -42,6 +42,13 @@ * * Board specific LED driver header for the Bitwizard Big-Multio (http://www.bitwizard.nl/wiki/index.php/Usbbigmultio). * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1UnknownLED0HighPORTF.6
LEDS_LED2UnknownLED1HighPORTF.7
LEDS_LED3UnknownLED2HighPORTE.2
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h b/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h index 4313db5700..7bfef87dce 100644 --- a/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h @@ -40,7 +40,13 @@ * \defgroup Group_LEDs_BLACKCAT BLACKCAT * \brief Board specific LED driver header for the BLACKCAT USB JTAG. * - * Board specific LED driver header for the TCNISO Blackcat USB JTAG (http://www.embeddedcomputers.net/products/BlackcatUSB/. + * Board specific LED driver header for the TCNISO Blackcat USB JTAG (http://www.embeddedcomputers.net/products/BlackcatUSB). + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1UnknownLED0HighPORTD.6
LEDS_LED2UnknownLED1HighPORTD.3
* * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/BUI/LEDs.h b/LUFA/Drivers/Board/AVR8/BUI/LEDs.h index f49f51d135..043a2a72cd 100644 --- a/LUFA/Drivers/Board/AVR8/BUI/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BUI/LEDs.h @@ -42,6 +42,13 @@ * * Board specific LED driver header for the Busware BUI (http://www.busware.de/tiki-index.php?page=BUI). * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1RedRGB LEDHighPORTC.2
LEDS_LED2GreenRGB LEDHighPORTC.3
LEDS_LED3BlueRGB LEDHighPORTC.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h b/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h index 8fdd002023..a4d8169752 100644 --- a/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h @@ -44,6 +44,11 @@ * third-party board does not include any on-board peripherals, but does have an officially recommended external peripheral * layout for buttons, LEDs and a Joystick. * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h b/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h index f952536823..6b0df050b9 100644 --- a/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h @@ -44,6 +44,11 @@ * third-party board does not include any on-board peripherals, but does have an officially recommended external peripheral * layout for buttons, LEDs and a Joystick. * + * + * + * + *
Left Port PinUp Port PinRight Port PinDown Port PinPress Port Pin
PORTD.2PORTD.3PORTD.0PORTD.1PORTD.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h b/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h index 9f82cc1fff..24a1fb209e 100644 --- a/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h @@ -44,6 +44,14 @@ * third-party board does not include any on-board peripherals, but does have an officially recommended external * peripheral layout for buttons, LEDs and a Joystick. * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1N/AUser SuppliedHighPORTB.4
LEDS_LED2N/AUser SuppliedHighPORTB.5
LEDS_LED3N/AUser SuppliedHighPORTB.6
LEDS_LED4N/AUser SuppliedHighPORTB.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h b/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h index 19e09fe800..16feb7d23b 100644 --- a/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTE.2
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h b/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h index 3fb8c874bb..8888a0586b 100644 --- a/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h @@ -42,6 +42,11 @@ * * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowGeneral IndicatorHighPORTE.6
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h b/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h index 89ba2742e4..829f35650e 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Atmel EVK527. * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTE.2
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h b/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h index 595492fe20..0f7b6745de 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h @@ -42,6 +42,11 @@ * * Board specific Dataflash driver header for the Atmel EVK527. * + * + * + * + *
NameInfoSelect PinSPI Port
DATAFLASH_CHIP1AT45DB321C (4MB)PORTE.6SPI0
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h b/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h index 5315c2e078..b264f475fb 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h @@ -42,6 +42,11 @@ * * Board specific joystick driver header for the Atmel EVK527. * + * + * + * + *
Left Port PinUp Port PinRight Port PinDown Port PinPress Port Pin
PORTF.4PORTF.5PORTF.7PORTC.6PORTF.6
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h b/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h index 551bba6138..ade2b268a5 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h @@ -42,6 +42,13 @@ * * Board specific LED driver header for the Atmel EVK527. * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTD.5
LEDS_LED2GreenGeneral IndicatorHighPORTD.6
LEDS_LED3GreenGeneral IndicatorHighPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h b/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h index a3a246dd92..d36a115efe 100644 --- a/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h b/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h index 3361f58aca..6c49341937 100644 --- a/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h @@ -42,6 +42,11 @@ * * Board specific LED driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html). * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTD.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h index 45ca1243fb..460c94e09f 100644 --- a/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h @@ -42,6 +42,12 @@ * * Board specific LED driver header for the Maximus (http://www.avrusb.com/). * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenLGHighPORTB.6
LEDS_LED2RedLRHighPORTB.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h b/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h index 5c5825afbe..731d1b05bf 100644 --- a/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h @@ -100,6 +100,18 @@ * * Board specific Buttons driver header for the Micropendous 32U2 (https://code.google.com/p/micropendous/wiki/Micropendous_32U2). * + * BOARD_MICROPENDOUS_1 and BOARD_MICROPENDOUS_32U2: + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * + * Other Revisions: + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTE.2
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h index 649d961e9b..71a8049f60 100644 --- a/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h @@ -56,6 +56,18 @@ * * Board specific LED driver header for the Micropendous 32U2 (https://code.google.com/p/micropendous/wiki/Micropendous_32U2). * + * BOARD_MICROPENDOUS_32U2: + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTD.6
+ * + * Other Revisions: + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTB.1
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h b/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h index 27d75bfed3..3105ba8a15 100644 --- a/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Microsin AVR-USB162 board (http://microsin.ru/content/view/685/44/). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h b/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h index 36f610d048..8b28d30450 100644 --- a/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h @@ -42,6 +42,11 @@ * * Board specific LED driver header for the Microsin AVR-USB162 board (http://microsin.ru/content/view/685/44/). * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTD.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h b/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h index 016ea2d371..f8666cf13f 100644 --- a/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the MINIMUS. * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h index 11ab648ba4..c689a31540 100644 --- a/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h @@ -42,6 +42,13 @@ * * Board specific LED driver header for the Minimus USB (http://www.minimususb.com/). * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1RedGeneral IndicatorLowPORTD.5
LEDS_LED2GreenGeneral IndicatorLowPORTD.6
LEDS_LED3BlueGeneral IndicatorLowPORTD.7
+ * * @{ */ @@ -69,11 +76,14 @@ /** LED mask for the second LED on the board. */ #define LEDS_LED2 (1 << 6) + /** LED mask for the third LED on the board. */ + #define LEDS_LED3 (1 << 7) + /** LED mask for all the LEDs on the board. */ - #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3) /** LED mask for the none of the board LEDs. */ - #define LEDS_NO_LEDS 1 + #define LEDS_NO_LEDS 0 /* Inline Functions: */ #if !defined(__DOXYGEN__) diff --git a/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h b/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h index af2f7b3778..c5f07b9acf 100644 --- a/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h @@ -42,6 +42,13 @@ * * Board specific LED driver header for the Bitwizard Multio (http://www.bitwizard.nl/wiki/index.php/USB-multio). * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTD.0
LEDS_LED2GreenGeneral IndicatorHighPORTC.2
LEDS_LED3GreenGeneral IndicatorHighPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h b/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h index b6d75bed08..1b7c2910f2 100644 --- a/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Olimex AVR-USB-162 Development Board (http://www.olimex.com/dev/avr-usb-162.html). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h b/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h index c9bd3f1354..cc34daac39 100644 --- a/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h @@ -42,6 +42,11 @@ * * Board specific LED driver header for the Olimex AVR-USB-162 (http://www.olimex.com/dev/avr-usb-162.html). * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowGeneral IndicatorHighPORTD.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h b/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h index c85d8ad082..3bc45b9e7d 100644 --- a/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h @@ -42,6 +42,14 @@ * * Board specific LED driver header for the Atmel RZUSBSTICK. * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1BlueGeneral IndicatorHighPORTD.7
LEDS_LED1RedGeneral IndicatorLowPORTD.5
LEDS_LED1GreenGeneral IndicatorLowPORTE.6
LEDS_LED1YellowGeneral IndicatorLowPORTE.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h b/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h index 8985306518..a838bed534 100644 --- a/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h @@ -42,6 +42,11 @@ * * Board specific LED driver header for the Sparkfun ATMEGA8U2 breakout board (http://www.sparkfun.com/products/10277). * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTB.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/STK525/Buttons.h b/LUFA/Drivers/Board/AVR8/STK525/Buttons.h index 13abb83259..a08fa5df5d 100644 --- a/LUFA/Drivers/Board/AVR8/STK525/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/STK525/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Atmel STK525. * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTE.2
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h b/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h index 67742977ce..60375f99a0 100644 --- a/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h +++ b/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h @@ -42,6 +42,11 @@ * * Board specific Dataflash driver header for the Atmel STK525. * + * + * + * + *
NameInfoSelect PinSPI Port
DATAFLASH_CHIP1AT45DB321C (4MB)PORTB.4SPI0
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/STK525/Joystick.h b/LUFA/Drivers/Board/AVR8/STK525/Joystick.h index 8cc5653515..fb6c857a91 100644 --- a/LUFA/Drivers/Board/AVR8/STK525/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/STK525/Joystick.h @@ -42,6 +42,11 @@ * * Board specific joystick driver header for the Atmel STK525. * + * + * + * + *
Left Port PinUp Port PinRight Port PinDown Port PinPress Port Pin
PORTB.6PORTB.7PORTE.4PORTE.5PORTB.5
+ * * @{ */ @@ -76,7 +81,7 @@ #define JOY_LEFT (1 << 6) /** Mask for the joystick being pushed in the right direction. */ - #define JOY_RIGHT ((1 << 4) >> 1) + #define JOY_RIGHT ((1 << 4) >> JOY_PORTE_MASK_SHIFT) /** Mask for the joystick being pushed in the upward direction. */ #define JOY_UP (1 << 7) diff --git a/LUFA/Drivers/Board/AVR8/STK525/LEDs.h b/LUFA/Drivers/Board/AVR8/STK525/LEDs.h index c0111a2636..881010c62d 100644 --- a/LUFA/Drivers/Board/AVR8/STK525/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/STK525/LEDs.h @@ -42,6 +42,14 @@ * * Board specific LED driver header for the Atmel STK525. * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTD.4
LEDS_LED2GreenGeneral IndicatorHighPORTD.5
LEDS_LED3GreenGeneral IndicatorHighPORTD.6
LEDS_LED4GreenGeneral IndicatorHighPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/STK526/Buttons.h b/LUFA/Drivers/Board/AVR8/STK526/Buttons.h index 2c6b928071..13ec376010 100644 --- a/LUFA/Drivers/Board/AVR8/STK526/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/STK526/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Atmel STK526. * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h b/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h index ce20ff1e78..d58ad057c4 100644 --- a/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h +++ b/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h @@ -42,6 +42,11 @@ * * Board specific Dataflash driver header for the Atmel STK525. * + * + * + * + *
NameInfoSelect PinSPI Port
DATAFLASH_CHIP1AT45DB642D (8MB)PORTC.2SPI0
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/STK526/Joystick.h b/LUFA/Drivers/Board/AVR8/STK526/Joystick.h index 3ab6e8427c..823fbf1af4 100644 --- a/LUFA/Drivers/Board/AVR8/STK526/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/STK526/Joystick.h @@ -42,6 +42,11 @@ * * Board specific joystick driver header for the Atmel STK526. * + * + * + * + *
Left Port PinUp Port PinRight Port PinDown Port PinPress Port Pin
PORTB.4PORTB.5PORTB.6PORTB.7PORTB.0
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/STK526/LEDs.h b/LUFA/Drivers/Board/AVR8/STK526/LEDs.h index ed83356af6..b19abdc6be 100644 --- a/LUFA/Drivers/Board/AVR8/STK526/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/STK526/LEDs.h @@ -42,6 +42,14 @@ * * Board specific LED driver header for the Atmel STK526. * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTD.1
LEDS_LED2GreenGeneral IndicatorHighPORTD.0
LEDS_LED3GreenGeneral IndicatorHighPORTD.5
LEDS_LED4GreenGeneral IndicatorHighPORTD.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h b/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h index 9a71cf5d58..f3a577a76b 100644 --- a/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h @@ -51,6 +51,18 @@ * * Board specific LED driver header for the PJRC Teensy boards (http://www.pjrc.com/teensy/index.html). * + * TEENSY: + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTD.6
+ * + * TEENSY2: + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTD.6
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/TUL/Buttons.h b/LUFA/Drivers/Board/AVR8/TUL/Buttons.h index 3eed13a498..76c9d858a4 100644 --- a/LUFA/Drivers/Board/AVR8/TUL/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/TUL/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Busware TUL (http://www.busware.de/tiki-index.php?page=TUL). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTE.2
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/TUL/LEDs.h b/LUFA/Drivers/Board/AVR8/TUL/LEDs.h index 121f3f4833..82ccb0ff4c 100644 --- a/LUFA/Drivers/Board/AVR8/TUL/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/TUL/LEDs.h @@ -42,6 +42,11 @@ * * Board specific LED driver header for the Busware TUL (http://www.busware.de/tiki-index.php?page=TUL). * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorHighPORTF.0
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h b/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h index b07836418d..3df6bacd9b 100644 --- a/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Linnix UDIP (http://linnix.com/udip/). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h b/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h index 30eb9ad79b..83cb1fbeb0 100644 --- a/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h @@ -42,6 +42,14 @@ * * Board specific LED driver header for the Linnix UDIP (http://linnix.com/udip/). * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenBicolor Indicator 1HighPORTB.6
LEDS_LED2RedBicolor Indicator 1HighPORTB.5
LEDS_LED3GreenBicolor Indicator 2HighPORTD.5
LEDS_LED4RedBicolor Indicator 2HighPORTD.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/UNO/LEDs.h b/LUFA/Drivers/Board/AVR8/UNO/LEDs.h index 1fddba7da9..5ffafdd5eb 100644 --- a/LUFA/Drivers/Board/AVR8/UNO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/UNO/LEDs.h @@ -42,6 +42,12 @@ * * Board specific LED driver header for the Arduino Uno (http://arduino.cc/en/Main/ArduinoBoardUno). * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowRXLowPORTD.4
LEDS_LED2YellowTXLowPORTD.5
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h b/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h index 9b83acf9ab..73d05a5b39 100644 --- a/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h @@ -51,6 +51,11 @@ * * Board specific Buttons driver header for the Paranoid Studio USB2AX (http://paranoidstudio.assembla.com/wiki/show/paranoidstudio/USB2AX). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h b/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h index c34715e58a..cec18c498d 100644 --- a/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h @@ -51,6 +51,18 @@ * * Board specific LED driver header for the Paranoid Studio USB2AX (http://paranoidstudio.assembla.com/wiki/show/paranoidstudio/USB2AX). * + * USB2AX: + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTC.6
+ * + * USB2AX_V3: + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTD.1
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h b/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h index d03918ced7..111f7ecf53 100644 --- a/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Kernel Concepts USBFOO (http://shop.kernelconcepts.de/product_info.php?products_id=102). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h b/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h index f838983c7c..810be72ed9 100644 --- a/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h @@ -42,6 +42,11 @@ * * Board specific LED driver header for the Kernel Concepts USBFOO (http://shop.kernelconcepts.de/product_info.php?products_id=102). * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTD.4
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h b/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h index 3180725b89..9399f4fa89 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Atmel USBKEY. * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTE.2
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h b/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h index 5b71d7d887..32f7ff905b 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h @@ -42,6 +42,12 @@ * * Board specific Dataflash driver header for the Atmel USBKEY board. * + * + * + * + * + *
NameInfoSelect PinSPI Port
DATAFLASH_CHIP1AT45DB642D (8MB)PORTE.0SPI0
DATAFLASH_CHIP2AT45DB642D (8MB)PORTE.1SPI0
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h b/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h index 8b6935b39e..4136f7959b 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h @@ -42,6 +42,11 @@ * * Board specific joystick driver header for the Atmel USBKEY. * + * + * + * + *
Left Port PinUp Port PinRight Port PinDown Port PinPress Port Pin
PORTB.6PORTB.7PORTE.4PORTE.5PORTB.5
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h b/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h index 4ca7691af7..62c0d76dbe 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h @@ -42,6 +42,14 @@ * * Board specific LED driver header for the Atmel USBKEY. * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1RedBicolor Indicator 1LowPORTD.4
LEDS_LED2GreenBicolor Indicator 1LowPORTD.5
LEDS_LED3RedBicolor Indicator 2LowPORTD.6
LEDS_LED4GreenBicolor Indicator 2LowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h b/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h index 6a6d78c1dc..7313db2298 100644 --- a/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/). * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTD.7
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h b/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h index 0fcbf0746a..9322ab90ce 100644 --- a/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h @@ -42,6 +42,13 @@ * * Board specific LED driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/). * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1RedBicolor Indicator 1HighPORTB.6
LEDS_LED2GreenBicolor Indicator 1HighPORTB.7
LEDS_LED3RedTarget PowerHighPORTB.5
+ * * @{ */ diff --git a/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h b/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h index c9bdbdc3a1..9647cc1a32 100644 --- a/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h +++ b/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h @@ -51,6 +51,18 @@ * * Board specific Dataflash driver header for the Atmel XPLAIN. * + * Revision 1 Boards: + * + * + * + *
NameInfoSelect PinSPI Port
DATAFLASH_CHIP1AT45DB041D (512KB)PORTB.5SPI0
+ * + * Other Board Revisions: + * + * + * + *
NameInfoSelect PinSPI Port
DATAFLASH_CHIP1AT45DB642D (8MB)PORTB.5SPI0
+ * * @{ */ @@ -59,6 +71,7 @@ /* Includes: */ #include "../../../../Common/Common.h" + #include "../../../Misc/AT45DB642D.h" #include "../../../Peripheral/SPI.h" diff --git a/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h b/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h index 938154878e..ef36e1767e 100644 --- a/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h @@ -49,6 +49,11 @@ * * Board specific LED driver header for the Atmel XPLAIN. * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTB.6
+ * * @{ */ diff --git a/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h b/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h index e1b34b18d9..a5a0fd62b8 100644 --- a/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h +++ b/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h @@ -42,6 +42,13 @@ * * Board specific Buttons driver header for the Atmel EVK1100. * + * + * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1SW0 ButtonLowGPIO88
BUTTONS_BUTTON2SW1 ButtonLowGPIO85
BUTTONS_BUTTON3SW2 ButtonLowGPIO82
+ * * @{ */ diff --git a/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h b/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h index b9dbfbc000..256da60eec 100644 --- a/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h +++ b/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h @@ -42,6 +42,11 @@ * * Board specific joystick driver header for the Atmel EVK1100. * + * + * + * + *
Left Port PinUp Port PinRight Port PinDown Port PinPress Port Pin
GPIO25GPIO26GPIO28GPIO27GPIO20
+ * * @{ */ diff --git a/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h b/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h index 43c3ecb47c..4663baf214 100644 --- a/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h +++ b/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h @@ -42,6 +42,18 @@ * * Board specific LED driver header for the Atmel EVK1100. * + * + * + * + * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenLED0 LEDLowGPIO51
LEDS_LED2GreenLED1 LEDLowGPIO52
LEDS_LED3GreenLED2 LEDLowGPIO53
LEDS_LED4GreenLED3 LEDLowGPIO54
LEDS_LED5GreenLED4 LEDLowGPIO59
LEDS_LED6GreenLED5 LEDLowGPIO60
LEDS_LED7GreenLED6 LEDLowGPIO61
LEDS_LED8GreenLED7 LEDLowGPIO62
+ * * @{ */ diff --git a/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h b/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h index 2e89af4531..8971479022 100644 --- a/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h +++ b/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h @@ -42,6 +42,12 @@ * * Board specific Buttons driver header for the Atmel EVK1101. * + * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1SW0 ButtonLowGPIO34
BUTTONS_BUTTON2SW1 ButtonLowGPIO35
+ * * @{ */ diff --git a/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h b/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h index 9983374c16..7850bfb15f 100644 --- a/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h +++ b/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h @@ -42,6 +42,11 @@ * * Board specific joystick driver header for the Atmel EVK1101. * + * + * + * + *
Left Port PinUp Port PinRight Port PinDown Port PinPress Port Pin
GPIO38GPIO39GPIO41GPIO40GPIO13
+ * * @{ */ diff --git a/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h b/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h index 43f3949d06..79a95b7a79 100644 --- a/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h +++ b/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h @@ -42,6 +42,14 @@ * * Board specific LED driver header for the Atmel EVK1101. * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenLED0 LEDLowGPIO7
LEDS_LED2GreenLED1 LEDLowGPIO8
LEDS_LED3GreenLED2 LEDLowGPIO21
LEDS_LED4GreenLED3 LEDLowGPIO22
+ * * @{ */ diff --git a/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h b/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h index af8246d5f5..d255c0ac07 100644 --- a/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h +++ b/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h @@ -42,6 +42,11 @@ * * Board specific Buttons driver header for the Atmel EVK1104. * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1SW0 ButtonLowGPIO42
+ * * @{ */ diff --git a/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h b/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h index 1f5863b048..e1caf19388 100644 --- a/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h +++ b/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h @@ -42,6 +42,14 @@ * * Board specific LED driver header for the Atmel EVK1104. * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenLED0 LEDLowGPIO67
LEDS_LED2GreenLED1 LEDLowGPIO101
LEDS_LED3GreenLED2 LEDLowGPIO102
LEDS_LED4GreenLED3 LEDLowGPIO105
+ * * @{ */ diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h index d4e2084078..8146ee36ba 100644 --- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h +++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h @@ -42,6 +42,13 @@ * * Board specific Buttons driver header for the Atmel XMEGA A3BU Xplained. * + * + * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1SW0 ButtonLowPORTE.5
BUTTONS_BUTTON2SW1 ButtonLowPORTF.1
BUTTONS_BUTTON3SW2 ButtonLowPORTF.2
+ * * @{ */ diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h index df357611bd..672d4eb074 100644 --- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h +++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h @@ -42,6 +42,11 @@ * * Board specific Dataflash driver header for the Atmel XMEGA B1 Xplained board. * + * + * + * + *
NameInfoSelect PinSPI Port
DATAFLASH_CHIP1AT45DB642D (8MB)PORTF.4USARTD0 (In SPI Mode)
+ * * @{ */ diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h index 6212c9aed9..b47199bbb3 100644 --- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h +++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h @@ -42,6 +42,12 @@ * * Board specific LED driver header for the Atmel XMEGA A3BU Xplained. * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowLED0 LEDLowPORTR.0
LEDS_LED2YellowLED1 LEDLowPORTR.1
+ * * @{ */ diff --git a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h index 2a08ed5655..0e098326ea 100644 --- a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h +++ b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h @@ -42,6 +42,14 @@ * * Board specific Buttons driver header for the Atmel XMEGA B1 Xplained. * + * + * + * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1Touch CS0 ButtonLowPORTE.0
BUTTONS_BUTTON2Touch CS1 ButtonLowPORTE.1
BUTTONS_BUTTON3Touch CS2 ButtonLowPORTE.2
BUTTONS_BUTTON4Touch CS3 ButtonLowPORTE.3
+ * * @{ */ diff --git a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h index 0b8a2617e8..d7ad64a5c1 100644 --- a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h +++ b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h @@ -42,6 +42,11 @@ * * Board specific Dataflash driver header for the Atmel XMEGA A3BU Xplained board. * + * + * + * + *
NameInfoSelect PinSPI Port
DATAFLASH_CHIP1AT45DB642D (8MB)PORTD.2USARTC0 (In SPI Mode, Remapped)
+ * * @{ */ diff --git a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h index 184978727c..54a678eef5 100644 --- a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h +++ b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h @@ -42,6 +42,15 @@ * * Board specific LED driver header for the Atmel XMEGA B1 Xplained. * + * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowLED0 LEDHighPORTB.4
LEDS_LED2YellowLED1 LEDHighPORTB.5
LEDS_LED3YellowLED2 LEDHighPORTB.6
LEDS_LED4YellowLED3 LEDHighPORTB.7
LEDS_LED5GreenUSB LEDLowPORTE.4
+ * * @{ */ From e875d7cf9f31fe9ac586718850a433f2851b5e19 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 25 Apr 2012 18:28:56 +0000 Subject: [PATCH 18/37] Changed MIDI event structure MIDI_EventPacket_t to use a single field for the combined virtual cable index and command ID, to prevent bitfield packing issues on some architectures (thanks to Darren Gibbs). --- Demos/Device/ClassDriver/MIDI/MIDI.c | 5 ++--- Demos/Device/LowLevel/MIDI/MIDI.c | 5 ++--- Demos/Host/ClassDriver/MIDIHost/MIDIHost.c | 7 +++---- Demos/Host/LowLevel/MIDIHost/MIDIHost.c | 7 +++---- LUFA/DoxygenPages/ChangeLog.txt | 2 ++ LUFA/DoxygenPages/MigrationInformation.txt | 6 ++++++ LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h | 15 +++++++++++++-- 7 files changed, 31 insertions(+), 16 deletions(-) diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.c b/Demos/Device/ClassDriver/MIDI/MIDI.c index a55c6a70ed..6a117ab4b2 100644 --- a/Demos/Device/ClassDriver/MIDI/MIDI.c +++ b/Demos/Device/ClassDriver/MIDI/MIDI.c @@ -78,7 +78,7 @@ int main(void) MIDI_EventPacket_t ReceivedMIDIEvent; while (MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &ReceivedMIDIEvent)) { - if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4)) && (ReceivedMIDIEvent.Data3 > 0)) + if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)) && (ReceivedMIDIEvent.Data3 > 0)) LEDs_SetAllLEDs(ReceivedMIDIEvent.Data2 > 64 ? LEDS_LED1 : LEDS_LED2); else LEDs_SetAllLEDs(LEDS_NO_LEDS); @@ -155,8 +155,7 @@ void CheckJoystickMovement(void) { MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) { - .CableNumber = 0, - .Command = (MIDICommand >> 4), + .Event = MIDI_EVENT(0, MIDICommand), .Data1 = MIDICommand | Channel, .Data2 = MIDIPitch, diff --git a/Demos/Device/LowLevel/MIDI/MIDI.c b/Demos/Device/LowLevel/MIDI/MIDI.c index f8bc4e9179..335c7143e3 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.c +++ b/Demos/Device/LowLevel/MIDI/MIDI.c @@ -160,8 +160,7 @@ void MIDI_Task(void) { MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) { - .CableNumber = 0, - .Command = (MIDICommand >> 4), + .Event = MIDI_EVENT(0, MIDICommand), .Data1 = MIDICommand | Channel, .Data2 = MIDIPitch, @@ -191,7 +190,7 @@ void MIDI_Task(void) Endpoint_Read_Stream_LE(&MIDIEvent, sizeof(MIDIEvent), NULL); /* Check to see if the sent command is a note on message with a non-zero velocity */ - if ((MIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4)) && (MIDIEvent.Data3 > 0)) + if ((MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)) && (MIDIEvent.Data3 > 0)) { /* Change LEDs depending on the pitch of the sent note */ LEDs_SetAllLEDs(MIDIEvent.Data2 > 64 ? LEDS_LED1 : LEDS_LED2); diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c index 129bd3d628..472d19aee7 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c @@ -111,8 +111,8 @@ void JoystickHost_Task(void) MIDI_EventPacket_t MIDIEvent; while (MIDI_Host_ReceiveEventPacket(&Keyboard_MIDI_Interface, &MIDIEvent)) { - bool NoteOnEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_ON >> 4)); - bool NoteOffEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_OFF >> 4)); + bool NoteOnEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)); + bool NoteOffEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_OFF)); /* Display note events from the host */ if (NoteOnEvent || NoteOffEvent) @@ -173,8 +173,7 @@ void CheckJoystickMovement(void) { MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) { - .CableNumber = 0, - .Command = (MIDICommand >> 4), + .Event = MIDI_EVENT(0, MIDICommand), .Data1 = MIDICommand | Channel, .Data2 = MIDIPitch, diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c index 060761f587..f4a52accd4 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c @@ -177,8 +177,8 @@ void MIDIHost_Task(void) if (!(Pipe_BytesInPipe())) Pipe_ClearIN(); - bool NoteOnEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_ON >> 4)); - bool NoteOffEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_OFF >> 4)); + bool NoteOnEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)); + bool NoteOffEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_OFF)); if (NoteOnEvent || NoteOffEvent) { @@ -237,8 +237,7 @@ void MIDIHost_Task(void) { MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) { - .CableNumber = 0, - .Command = (MIDICommand >> 4), + .Event = MIDI_EVENT(0, MIDICommand), .Data1 = MIDICommand | Channel, .Data2 = MIDIPitch, diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 150d5de399..df504763c7 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -33,6 +33,8 @@ * - 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 + * - Changed MIDI event structure MIDI_EventPacket_t to use a single field for the combined virtual cable index and command ID, to prevent bitfield packing issues + * on some architectures (thanks to Darren Gibbs). * - 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/MigrationInformation.txt b/LUFA/DoxygenPages/MigrationInformation.txt index fe04732843..f0fd9b2109 100644 --- a/LUFA/DoxygenPages/MigrationInformation.txt +++ b/LUFA/DoxygenPages/MigrationInformation.txt @@ -27,6 +27,9 @@ * 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. + * - The MIDI class driver \ref MIDI_EventPacket_t event packet no longer contains seperate \c CableIndex and \c Command entries; these have been combined + * into a single \c Event element which can be contructed using the new macro \ref MIDI_EVENT(). Existing applications should use the new macro and structure + * element name. * * Host Mode * - The Android Accessory Host class driver property strings are now a array of \c char* rather than a struct of named pointers. Existing applications @@ -38,6 +41,9 @@ * 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). + * - The MIDI class driver \ref MIDI_EventPacket_t event packet no longer contains seperate \c CableIndex and \c Command entries; these have been combined + * into a single \c Event element which can be contructed using the new macro \ref MIDI_EVENT(). Existing applications should use the new macro and structure + * element name. * * \section Sec_Migration120219 Migrating from 111009 to 120219 * USB Core diff --git a/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h b/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h index 60b0908f3e..25b80b7d40 100644 --- a/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h @@ -84,8 +84,20 @@ * addresses are zero-indexed. This converts a natural MIDI channel number into the logical channel address. * * \param[in] channel MIDI channel number to address. + * + * \return Constructed MIDI channel ID. */ #define MIDI_CHANNEL(channel) ((channel) - 1) + + /** Constructs a MIDI event ID from a given MIDI command and a virtual MIDI cable index. This can then be + * used to create and decode \ref MIDI_EventPacket_t MIDI event packets. + * + * \param[in] virtualcable Index of the virtual MIDI cable the event relates to + * \param[in] command MIDI command to send through the virtual MIDI cable + * + * \return Constructed MIDI event ID. + */ + #define MIDI_EVENT(virtualcable, command) ((virtualcable << 4) | (command >> 4)) /* Enums: */ /** Enum for the possible MIDI jack types in a MIDI device jack descriptor. */ @@ -290,8 +302,7 @@ */ typedef struct { - unsigned Command : 4; /**< Upper nibble of the MIDI command being sent or received in the event packet. */ - unsigned CableNumber : 4; /**< Virtual cable number of the event being sent or received in the given MIDI interface. */ + uint8_t Event; /**< MIDI event type, constructed with the \ref MIDI_EVENT() macro. */ uint8_t Data1; /**< First byte of data in the MIDI event. */ uint8_t Data2; /**< Second byte of data in the MIDI event. */ From bd6123e2c17bc5f36d4812300474ed2277cdf70d Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 25 Apr 2012 18:32:55 +0000 Subject: [PATCH 19/37] Fixed inverted LED logic in the USB2AX board LED driver (thanks to Nicolas Saugnier). --- LUFA/DoxygenPages/ChangeLog.txt | 1 + LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h | 32 +++++++++++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index df504763c7..fa7607d8fd 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -49,6 +49,7 @@ * - Fixed compile error if LEDs_Disable() is called and BOARD=NONE is set (thanks to Sam Lin) * - Fixed inverted LED logic in the OLIMEX162 board LED driver * - Fixed incorrect reponse to GET STATUS requests in device mode if NO_DEVICE_SELF_POWER or NO_DEVICE_REMOTE_WAKEUP tokens are defined (thanks to Georg Glock) + * - Fixed inverted LED logic in the USB2AX board LED driver * - Library Applications: * - Fixed error in the AVRISP-MKII programmer when ISP mode is used at 64KHz (thanks to Ben R. Porter) * - Fixed AVRISP-MKII programmer project failing to compile for the U4 chips when VTARGET_ADC_CHANNEL is defined to an invalid channel and NO_VTARGET_DETECT is diff --git a/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h b/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h index cec18c498d..e66698715e 100644 --- a/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h @@ -54,13 +54,13 @@ * USB2AX: * * - * + * *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTC.6
LEDS_LED1GreenGeneral IndicatorHighPORTC.6
* * USB2AX_V3: * * - * + * *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTD.1
LEDS_LED1GreenGeneral IndicatorHighPORTD.1
* * @{ @@ -108,11 +108,11 @@ static inline void LEDs_Init(void) { #if (BOARD == BOARD_USB2AX) - DDRC |= LEDS_ALL_LEDS; - PORTC |= LEDS_ALL_LEDS; + DDRC |= LEDS_ALL_LEDS; + PORTC &= ~LEDS_ALL_LEDS; #else - DDRD |= LEDS_ALL_LEDS; - PORTD |= LEDS_ALL_LEDS; + DDRD |= LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; #endif } @@ -130,27 +130,27 @@ static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { #if (BOARD == BOARD_USB2AX) - PORTC &= ~LEDMask; + PORTC |= LEDMask; #else - PORTD &= ~LEDMask; + PORTD |= LEDMask; #endif } static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) { #if (BOARD == BOARD_USB2AX) - PORTC |= LEDMask; + PORTC &= ~LEDMask; #else - PORTD |= LEDMask; + PORTD &= ~LEDMask; #endif } static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) { #if (BOARD == BOARD_USB2AX) - PORTC = ((PORTC | LEDS_ALL_LEDS) & ~LEDMask); + PORTC = ((PORTC & ~LEDS_ALL_LEDS) | LEDMask); #else - PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask); + PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask); #endif } @@ -158,9 +158,9 @@ const uint8_t ActiveMask) { #if (BOARD == BOARD_USB2AX) - PORTC = ((PORTC | LEDMask) & ~ActiveMask); + PORTC = ((PORTC & ~LEDMask) | ActiveMask); #else - PORTD = ((PORTD | LEDMask) & ~ActiveMask); + PORTD = ((PORTD & ~LEDMask) | ActiveMask); #endif } @@ -177,9 +177,9 @@ static inline uint8_t LEDs_GetLEDs(void) { #if (BOARD == BOARD_USB2AX) - return (~PORTC & LEDS_ALL_LEDS); + return (PORTC & LEDS_ALL_LEDS); #else - return (~PORTD & LEDS_ALL_LEDS); + return (PORTD & LEDS_ALL_LEDS); #endif } #endif From 69ecaae732b8394d78e9eaff5caf9b6f677b75e7 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 25 Apr 2012 18:42:33 +0000 Subject: [PATCH 20/37] Added support for the DorkbotPDX Duce board. --- LUFA/Common/BoardTypes.h | 3 + LUFA/DoxygenPages/ChangeLog.txt | 1 + LUFA/DoxygenPages/DeviceSupport.txt | 1 + LUFA/Drivers/Board/AVR8/DUCE/LEDs.h | 147 ++++++++++++++++++++++++++++ LUFA/Drivers/Board/LEDs.h | 2 + 5 files changed, 154 insertions(+) create mode 100644 LUFA/Drivers/Board/AVR8/DUCE/LEDs.h diff --git a/LUFA/Common/BoardTypes.h b/LUFA/Common/BoardTypes.h index 1a3fccb28f..55a5a15ab3 100644 --- a/LUFA/Common/BoardTypes.h +++ b/LUFA/Common/BoardTypes.h @@ -204,6 +204,9 @@ /** Selects the Bitwizard Big-Multio specific board drivers, including the driver for the board LEDs. */ #define BOARD_BIGMULTIO 46 + /** Selects the DorkbotPDX Duce specific board drivers, including the driver for the board LEDs. */ + #define BOARD_DUCE 47 + #if !defined(__DOXYGEN__) #define BOARD_ BOARD_NONE diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index fa7607d8fd..35e9938db8 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -10,6 +10,7 @@ * New: * - Core: * - Added support for the BitWizard Multio and Big-Multio boards + * - Added support for the DorkbotPDX Duce board * - Added new Endpoint_ConfigureEndpointTable() function * - Added new Pipe_ConfigurePipeTable() function * - Library Applications: diff --git a/LUFA/DoxygenPages/DeviceSupport.txt b/LUFA/DoxygenPages/DeviceSupport.txt index 214938fbbf..5381af0c8d 100644 --- a/LUFA/DoxygenPages/DeviceSupport.txt +++ b/LUFA/DoxygenPages/DeviceSupport.txt @@ -106,6 +106,7 @@ * - Busware BUI * - Busware CUL V3 * - Busware TUL + * - DorkbotPDX Duce * - Fletchtronics Bumble-B (using manufacturer recommended peripheral layout) * - Kernel Concepts USBFOO * - Linnix UDIP diff --git a/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h b/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h new file mode 100644 index 0000000000..4c86ed4780 --- /dev/null +++ b/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h @@ -0,0 +1,147 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the DorkbotPDX Duce. + * \copydetails Group_LEDs_DUCE + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_DUCE DUCE + * \brief Board specific LED driver header for the DorkbotPDX Duce. + * + * Board specific LED driver header for the DorkbotPDX Duce (http://dorkbotpdx.org/wiki/duce). + * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1RedBicolor Indicator 1HighPORTC.4
LEDS_LED2GreenBicolor Indicator 1HighPORTC.5
LEDS_LED3RedBicolor Indicator 2HighPORTC.6
LEDS_LED4GreenBicolor Indicator 2HighPORTC.7
+ * + * @{ + */ + +#ifndef __LEDS_DUCE_H__ +#define __LEDS_DUCE_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 4) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 5) + + /** LED mask for the third LED on the board. */ + #define LEDS_LED3 (1 << 6) + + /** LED mask for the fourth LED on the board. */ + #define LEDS_LED4 (1 << 7) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4) + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRC |= LEDS_ALL_LEDS; + PORTC &= ~LEDS_ALL_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRC &= ~LEDS_ALL_LEDS; + PORTC &= ~LEDS_ALL_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTC |= LEDMask; + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTC &= ~LEDMask; + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTC = ((PORTC & ~LEDS_ALL_LEDS) | LEDMask); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTC = ((PORTC & ~LEDMask) | ActiveMask); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PORTC ^= LEDMask; + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return (PORTC & LEDS_ALL_LEDS); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index 9b8ebffb6b..7e7ab2e416 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -185,6 +185,8 @@ #include "AVR8/MULTIO/LEDs.h" #elif (BOARD == BOARD_BIGMULTIO) #include "AVR8/BIGMULTIO/LEDs.h" + #elif (BOARD == BOARD_DUCE) + #include "AVR8/DUCE/LEDs.h" #else #include "Board/LEDs.h" #endif From cc959c945b8002ece6c47e86af012112dd2535b3 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 25 Apr 2012 18:50:00 +0000 Subject: [PATCH 21/37] Oops - fix broken MIDIToneGenerator project due to MIDI class API changes. --- Projects/MIDIToneGenerator/MIDIToneGenerator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/MIDIToneGenerator/MIDIToneGenerator.c b/Projects/MIDIToneGenerator/MIDIToneGenerator.c index 2a9d5c3c07..5f17fdd1c6 100644 --- a/Projects/MIDIToneGenerator/MIDIToneGenerator.c +++ b/Projects/MIDIToneGenerator/MIDIToneGenerator.c @@ -100,7 +100,7 @@ int main(void) MIDI_EventPacket_t ReceivedMIDIEvent; if (MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &ReceivedMIDIEvent)) { - if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0)) + if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0)) { DDSNoteData* LRUNoteStruct = &NoteData[0]; @@ -134,7 +134,7 @@ int main(void) /* Turn on indicator LED to indicate note generation activity */ LEDs_SetAllLEDs(LEDS_LED1); } - else if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_OFF >> 4)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0)) + else if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_OFF)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0)) { bool FoundActiveNote = false; From 04740d680eb5f5bb665e87155e8d88023ef74214 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 29 Apr 2012 17:15:06 +0000 Subject: [PATCH 22/37] The library bootloaders will now correctly start the user application after a watchdog-based application start, even if the /HWB line is held low externally during the reset phase. --- Bootloaders/CDC/BootloaderCDC.c | 24 ++++++++++++++++++++++++ Bootloaders/CDC/BootloaderCDC.h | 5 +++++ Bootloaders/DFU/BootloaderDFU.c | 24 ++++++++++++++++++++++++ Bootloaders/DFU/BootloaderDFU.h | 5 +++++ Bootloaders/HID/BootloaderHID.c | 25 +++++++++++++++++++++++++ Bootloaders/HID/BootloaderHID.h | 5 +++++ LUFA.pnproj | 2 +- LUFA/DoxygenPages/ChangeLog.txt | 4 +++- 8 files changed, 92 insertions(+), 2 deletions(-) diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index a7fc883cf3..d057349c72 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -56,6 +56,27 @@ static uint32_t CurrAddress; */ static bool RunBootloader = true; +/** Magic lock for forced application start. If the HWBE fuse is programmed and BOOTRST is unprogrammed, the bootloader + * will start if the /HWB line of the AVR is held low and the system is reset. However, if the /HWB line is still held + * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value + * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start. + */ +uint32_t MagicBootKey ATTR_NO_INIT; + + +/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application + * start key has been loaded into \ref MagicBootKey. If the bootloader started via the watchdog and the key is valid, + * this will force the user application to start via a software jump. + */ +void Application_Jump_Check(void) +{ + // If the reset source was the bootloader and the key is correct, clear it and jump to the application + if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) + { + MagicBootKey = 0; + ((void (*)(void))0x0000)(); + } +} /** Main program entry point. This routine configures the hardware required by the bootloader, then continuously * runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start @@ -80,6 +101,9 @@ int main(void) /* Disconnect from the host - USB interface will be reset later along with the AVR */ USB_Detach(); + + /* Unlock the forced application start mode of the bootloader if it is restarted */ + MagicBootKey = MAGIC_BOOT_KEY; /* Enable the watchdog and force a timeout to reset the AVR */ wdt_enable(WDTO_250MS); diff --git a/Bootloaders/CDC/BootloaderCDC.h b/Bootloaders/CDC/BootloaderCDC.h index 4b9e7d6d84..257e884e6b 100644 --- a/Bootloaders/CDC/BootloaderCDC.h +++ b/Bootloaders/CDC/BootloaderCDC.h @@ -67,6 +67,9 @@ /** Eight character bootloader firmware identifier reported to the host when requested */ #define SOFTWARE_IDENTIFIER "LUFACDC" + /** Magic bootloader key to unlock forced application start mode. */ + #define MAGIC_BOOT_KEY 0xDC42CACA + /* Type Defines: */ /** Type define for a non-returning pointer to the start of the loaded application in flash memory. */ typedef void (*AppPtr_t)(void) ATTR_NO_RETURN; @@ -75,6 +78,8 @@ static void CDC_Task(void); static void SetupHardware(void); + void Application_Jump_Check(void) ATTR_INIT_SECTION(3); + void EVENT_USB_Device_ConfigurationChanged(void); #if defined(INCLUDE_FROM_BOOTLOADERCDC_C) || defined(__DOXYGEN__) diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index 3ce2a62858..233e145ae0 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -92,6 +92,27 @@ static uint16_t StartAddr = 0x0000; */ static uint16_t EndAddr = 0x0000; +/** Magic lock for forced application start. If the HWBE fuse is programmed and BOOTRST is unprogrammed, the bootloader + * will start if the /HWB line of the AVR is held low and the system is reset. However, if the /HWB line is still held + * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value + * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start. + */ +uint32_t MagicBootKey ATTR_NO_INIT; + + +/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application + * start key has been loaded into \ref MagicBootKey. If the bootloader started via the watchdog and the key is valid, + * this will force the user application to start via a software jump. + */ +void Application_Jump_Check(void) +{ + // If the reset source was the bootloader and the key is correct, clear it and jump to the application + if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) + { + MagicBootKey = 0; + AppStartPtr(); + } +} /** Main program entry point. This routine configures the hardware required by the bootloader, then continuously * runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start @@ -695,6 +716,9 @@ static void ProcessWriteCommand(void) { if (SentCommand.Data[1] == 0x00) // Start via watchdog { + /* Unlock the forced application start mode of the bootloader if it is restarted */ + MagicBootKey = MAGIC_BOOT_KEY; + /* Start the watchdog to reset the AVR once the communications are finalized */ wdt_enable(WDTO_250MS); } diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h index a80775348a..46b70c0e98 100644 --- a/Bootloaders/DFU/BootloaderDFU.h +++ b/Bootloaders/DFU/BootloaderDFU.h @@ -66,6 +66,9 @@ /** Minor bootloader version number. */ #define BOOTLOADER_VERSION_REV 0 + + /** Magic bootloader key to unlock forced application start mode. */ + #define MAGIC_BOOT_KEY 0xDC42CACA /** Complete bootloader version number expressed as a packed byte, constructed from the * two individual bootloader version macros. @@ -206,6 +209,8 @@ static void ProcessWriteCommand(void); static void ProcessReadCommand(void); #endif + + void Application_Jump_Check(void) ATTR_INIT_SECTION(3); #endif diff --git a/Bootloaders/HID/BootloaderHID.c b/Bootloaders/HID/BootloaderHID.c index d8f0186afd..2255f0ffaf 100644 --- a/Bootloaders/HID/BootloaderHID.c +++ b/Bootloaders/HID/BootloaderHID.c @@ -41,6 +41,28 @@ */ static bool RunBootloader = true; +/** Magic lock for forced application start. If the HWBE fuse is programmed and BOOTRST is unprogrammed, the bootloader + * will start if the /HWB line of the AVR is held low and the system is reset. However, if the /HWB line is still held + * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value + * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start. + */ +uint32_t MagicBootKey ATTR_NO_INIT; + + +/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application + * start key has been loaded into \ref MagicBootKey. If the bootloader started via the watchdog and the key is valid, + * this will force the user application to start via a software jump. + */ +void Application_Jump_Check(void) +{ + // If the reset source was the bootloader and the key is correct, clear it and jump to the application + if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) + { + MagicBootKey = 0; + ((void (*)(void))0x0000)(); + } +} + /** Main program entry point. This routine configures the hardware required by the bootloader, then continuously * runs the bootloader processing routine until instructed to soft-exit. */ @@ -58,6 +80,9 @@ int main(void) /* Disconnect from the host - USB interface will be reset later along with the AVR */ USB_Detach(); + /* Unlock the forced application start mode of the bootloader if it is restarted */ + MagicBootKey = MAGIC_BOOT_KEY; + /* Enable the watchdog and force a timeout to reset the AVR */ wdt_enable(WDTO_250MS); diff --git a/Bootloaders/HID/BootloaderHID.h b/Bootloaders/HID/BootloaderHID.h index ab5752d3cd..af2812a7d6 100644 --- a/Bootloaders/HID/BootloaderHID.h +++ b/Bootloaders/HID/BootloaderHID.h @@ -52,9 +52,14 @@ /** Bootloader special address to start the user application */ #define COMMAND_STARTAPPLICATION 0xFFFF + /** Magic bootloader key to unlock forced application start mode. */ + #define MAGIC_BOOT_KEY 0xDC42CACA + /* Function Prototypes: */ static void SetupHardware(void); + void Application_Jump_Check(void) ATTR_INIT_SECTION(3); + void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_UnhandledControlRequest(void); diff --git a/LUFA.pnproj b/LUFA.pnproj index 2cb678239f..125d0cd76a 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 35e9938db8..2076b4b656 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -35,11 +35,13 @@ * - 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 * - Changed MIDI event structure MIDI_EventPacket_t to use a single field for the combined virtual cable index and command ID, to prevent bitfield packing issues - * on some architectures (thanks to Darren Gibbs). + * on some architectures (thanks to Darren Gibbs) * - 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 * - Reverted AVRISP-MKII clone project watchdog based command timeout patch in favour of a hardware timer, to allow for use in devices with WDTRST fuse programmed + * - The library bootloaders will now correctly start the user application after a watchdog-based application start, even if the /HWB line is held low externally + * during the reset phase * * Fixed: * - Core: From 46d511c021011d051c7f19ab4129a8591735327a Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 5 May 2012 15:25:27 +0000 Subject: [PATCH 23/37] Fixed incorrect DFU version number reported to the host in the DFU bootloader descriptors. Fixed incorrect version hundredths value encoding in VERSION_BCD() macro (thanks to Georg Glock). --- Bootloaders/DFU/Descriptors.c | 2 +- LUFA/DoxygenPages/ChangeLog.txt | 2 ++ LUFA/Drivers/USB/Core/StdDescriptors.h | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Bootloaders/DFU/Descriptors.c b/Bootloaders/DFU/Descriptors.c index d55159060e..ff33b6b64f 100644 --- a/Bootloaders/DFU/Descriptors.c +++ b/Bootloaders/DFU/Descriptors.c @@ -111,7 +111,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = .DetachTimeout = 0x0000, .TransferSize = 0x0C00, - .DFUSpecification = VERSION_BCD(01.01) + .DFUSpecification = VERSION_BCD(01.10) } }; diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 2076b4b656..5770208d67 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -59,6 +59,8 @@ * defined (thanks to Steven Morehouse) * - Fixed AVRISP-MKII programmer project reset line polarity inverted when the generated EEP file is loaded into the USB AVR's EEPROM and avr-dude is used * - Fixed CDC and DFU bootloaders failing to compile when the bootloader section size is 8KB or more (thanks to Georg Glock) + * - Fixed incorrect DFU version number reported to the host in the DFU bootloader descriptors (thanks to Georg Glock) + * - Fixed incorrect version hundredths value encoding in VERSION_BCD() macro (thanks to Georg Glock) * * \section Sec_ChangeLog120219 Version 120219 * New: diff --git a/LUFA/Drivers/USB/Core/StdDescriptors.h b/LUFA/Drivers/USB/Core/StdDescriptors.h index cee2d5ec04..c46129c48f 100644 --- a/LUFA/Drivers/USB/Core/StdDescriptors.h +++ b/LUFA/Drivers/USB/Core/StdDescriptors.h @@ -94,8 +94,8 @@ * * \param[in] x Version number to encode as a 16-bit little-endian number, as a floating point number. */ - #define VERSION_BCD(x) CPU_TO_LE16((((VERSION_TENS(x) << 4) | VERSION_ONES(x)) << 8) | \ - ((VERSION_TENTHS(x) << 4) | VERSION_HUNDREDTHS(x))) + #define VERSION_BCD(x) CPU_TO_LE16((VERSION_TENS(x) << 12) | (VERSION_ONES(x) << 8) | \ + (VERSION_TENTHS(x) << 4) | (VERSION_HUNDREDTHS(x) << 0) ) /** String language ID for the English language. Should be used in \ref USB_Descriptor_String_t descriptors * to indicate that the English language is supported by the device in its string descriptors. @@ -722,10 +722,10 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */ - #define VERSION_TENS(x) (int)((x) / 10) - #define VERSION_ONES(x) (int)((x) - (10 * VERSION_TENS(x))) - #define VERSION_TENTHS(x) (int)(((x) - (int)(x)) * 10) - #define VERSION_HUNDREDTHS(x) (int)((((x) - (int)(x)) * 100) - (10 * VERSION_TENTHS(x))) + #define VERSION_TENS(x) (int)((int)(x) / 10) + #define VERSION_ONES(x) (int)((int)(x) % 10) + #define VERSION_TENTHS(x) (int)(((x * 1) - ((int)(x * 1))) * 10) + #define VERSION_HUNDREDTHS(x) (int)(((x * 10) - ((int)(x * 10))) * 10) #endif /* Disable C linkage for C++ Compilers: */ From 2d98e5499b42ca4feda390d5bd867aa956bf7f11 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 5 May 2012 19:43:06 +0000 Subject: [PATCH 24/37] Fixed possible deadlock in the CDC device driver if the USB connection is dropped while the CDC_REQ_SetLineEncoding control request is being processed by the stack (thanks to Jonathan Hudgins). --- LUFA/DoxygenPages/ChangeLog.txt | 2 ++ LUFA/Drivers/USB/Class/Device/CDCClassDevice.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 5770208d67..e92a0fc4f9 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -53,6 +53,8 @@ * - Fixed inverted LED logic in the OLIMEX162 board LED driver * - Fixed incorrect reponse to GET STATUS requests in device mode if NO_DEVICE_SELF_POWER or NO_DEVICE_REMOTE_WAKEUP tokens are defined (thanks to Georg Glock) * - Fixed inverted LED logic in the USB2AX board LED driver + * - Fixed possible deadlock in the CDC device driver if the USB connection is dropped while the CDC_REQ_SetLineEncoding control request is being processed by + * the stack (thanks to Jonathan Hudgins) * - Library Applications: * - Fixed error in the AVRISP-MKII programmer when ISP mode is used at 64KHz (thanks to Ben R. Porter) * - Fixed AVRISP-MKII programmer project failing to compile for the U4 chips when VTARGET_ADC_CHANNEL is defined to an invalid channel and NO_VTARGET_DETECT is diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c index a16949cfd2..ff0f9bb552 100644 --- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c @@ -69,8 +69,12 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter { Endpoint_ClearSETUP(); - while (!(Endpoint_IsOUTReceived())); - + while (!(Endpoint_IsOUTReceived())) + { + if (USB_DeviceState == DEVICE_STATE_Unattached) + return; + } + CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE(); CDCInterfaceInfo->State.LineEncoding.CharFormat = Endpoint_Read_8(); CDCInterfaceInfo->State.LineEncoding.ParityType = Endpoint_Read_8(); From 0e434c8f8fc1e33230a9b9c54583d59a232553e5 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 5 May 2012 19:46:20 +0000 Subject: [PATCH 25/37] Add additional preprocessor sanity checks for the XMEGA platform based on the USB controller input clock speed. --- LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h | 10 ++++++---- LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c | 6 +++++- LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h index 268fe95c03..4d75cc2a24 100644 --- a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h +++ b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h @@ -92,10 +92,12 @@ */ #define USB_DEVICE_OPT_LOWSPEED (1 << 0) - /** Mask for the Options parameter of the \ref USB_Init() function. This indicates that the - * USB interface should be initialized in full speed (12Mb/s) mode. - */ - #define USB_DEVICE_OPT_FULLSPEED (0 << 0) + #if (F_USB > 6000000) + /** Mask for the Options parameter of the \ref USB_Init() function. This indicates that the + * USB interface should be initialized in full speed (12Mb/s) mode. + */ + #define USB_DEVICE_OPT_FULLSPEED (0 << 0) + #endif //@} #if (!defined(NO_INTERNAL_SERIAL) || defined(__DOXYGEN__)) diff --git a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c index ffdca3adfb..844ef650f0 100644 --- a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c +++ b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c @@ -105,11 +105,15 @@ void USB_Disable(void) void USB_ResetInterface(void) { + #if defined(USB_DEVICE_OPT_FULLSPEED) if (USB_Options & USB_DEVICE_OPT_LOWSPEED) CLK.USBCTRL = (((F_USB / 6000000) - 1) << CLK_USBPSDIV_gp); else CLK.USBCTRL = (((F_USB / 48000000) - 1) << CLK_USBPSDIV_gp); - + #else + CLK.USBCTRL = (((F_USB / 6000000) - 1) << CLK_USBPSDIV_gp); + #endif + if (USB_Options & USB_OPT_PLLCLKSRC) CLK.USBCTRL |= (CLK_USBSRC_PLL_gc | CLK_USBSEN_bm); else diff --git a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h index 1cdb6f03ce..25402e8553 100644 --- a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h +++ b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h @@ -95,7 +95,7 @@ #error F_USB is not defined. You must define F_USB to the frequency of the unprescaled USB controller clock in your project makefile. #endif - #if (F_USB % 6000000) + #if ((F_USB % 6000000) || (F_USB < 6000000)) #error Invalid F_USB specified. F_USB must be a multiple of 6MHz for USB Low Speed operation, and a multiple of 48MHz for Full Speed operation. #endif From 430973263bcf11e56c3362d2c714cc8f8c95c354 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 5 May 2012 21:27:07 +0000 Subject: [PATCH 26/37] Fix bootloaders to make the StaticAnalysis build test happy. --- Bootloaders/CDC/BootloaderCDC.c | 3 ++- Bootloaders/HID/BootloaderHID.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index d057349c72..211b054e3d 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -70,10 +70,11 @@ uint32_t MagicBootKey ATTR_NO_INIT; */ void Application_Jump_Check(void) { - // If the reset source was the bootloader and the key is correct, clear it and jump to the application + /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */ if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) { MagicBootKey = 0; + // cppcheck-suppress constStatement ((void (*)(void))0x0000)(); } } diff --git a/Bootloaders/HID/BootloaderHID.c b/Bootloaders/HID/BootloaderHID.c index 2255f0ffaf..acc351a302 100644 --- a/Bootloaders/HID/BootloaderHID.c +++ b/Bootloaders/HID/BootloaderHID.c @@ -55,10 +55,11 @@ uint32_t MagicBootKey ATTR_NO_INIT; */ void Application_Jump_Check(void) { - // If the reset source was the bootloader and the key is correct, clear it and jump to the application + /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */ if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) { MagicBootKey = 0; + // cppcheck-suppress constStatement ((void (*)(void))0x0000)(); } } From 590d9b5ff882182e04dd05209ec46703c29c1e96 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 6 May 2012 11:10:25 +0000 Subject: [PATCH 27/37] Increased endpoint polling interval for all demos and projects to 5ms, as 1ms was causing some enumeration issues on some machines (thanks to Riku Salminen). --- Bootloaders/CDC/Descriptors.c | 4 ++-- Bootloaders/HID/Descriptors.c | 2 +- Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c | 8 ++++---- Demos/Device/ClassDriver/GenericHID/Descriptors.c | 2 +- Demos/Device/ClassDriver/Joystick/Descriptors.c | 2 +- Demos/Device/ClassDriver/Keyboard/Descriptors.c | 2 +- Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c | 4 ++-- .../ClassDriver/KeyboardMouseMultiReport/Descriptors.c | 2 +- Demos/Device/ClassDriver/MIDI/Descriptors.c | 4 ++-- Demos/Device/ClassDriver/MassStorage/Descriptors.c | 4 ++-- .../Device/ClassDriver/MassStorageKeyboard/Descriptors.c | 6 +++--- Demos/Device/ClassDriver/Mouse/Descriptors.c | 2 +- Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c | 4 ++-- Demos/Device/ClassDriver/VirtualSerial/Descriptors.c | 4 ++-- .../ClassDriver/VirtualSerialMassStorage/Descriptors.c | 8 ++++---- Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c | 6 +++--- Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c | 4 ++-- Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c | 8 ++++---- Demos/Device/LowLevel/GenericHID/Descriptors.c | 4 ++-- Demos/Device/LowLevel/Joystick/Descriptors.c | 2 +- Demos/Device/LowLevel/Keyboard/Descriptors.c | 4 ++-- Demos/Device/LowLevel/KeyboardMouse/Descriptors.c | 6 +++--- Demos/Device/LowLevel/MIDI/Descriptors.c | 4 ++-- Demos/Device/LowLevel/MassStorage/Descriptors.c | 4 ++-- Demos/Device/LowLevel/Mouse/Descriptors.c | 2 +- Demos/Device/LowLevel/RNDISEthernet/Descriptors.c | 4 ++-- Demos/Device/LowLevel/VirtualSerial/Descriptors.c | 4 ++-- Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c | 2 +- LUFA/DoxygenPages/ChangeLog.txt | 1 + Projects/Benito/Descriptors.c | 4 ++-- Projects/Incomplete/StandaloneProgrammer/Descriptors.c | 4 ++-- Projects/LEDNotifier/Descriptors.c | 4 ++-- Projects/MIDIToneGenerator/Descriptors.c | 4 ++-- Projects/Magstripe/Descriptors.c | 2 +- Projects/MediaController/Descriptors.c | 2 +- Projects/SerialToLCD/Descriptors.c | 4 ++-- Projects/TempDataLogger/Descriptors.c | 6 +++--- Projects/USBtoSerial/Descriptors.c | 4 ++-- Projects/Webserver/Descriptors.c | 8 ++++---- Projects/XPLAINBridge/USARTDescriptors.c | 4 ++-- 40 files changed, 80 insertions(+), 79 deletions(-) diff --git a/Bootloaders/CDC/Descriptors.c b/Bootloaders/CDC/Descriptors.c index 4b769c223a..9c892f835b 100644 --- a/Bootloaders/CDC/Descriptors.c +++ b/Bootloaders/CDC/Descriptors.c @@ -160,7 +160,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -170,7 +170,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Bootloaders/HID/Descriptors.c b/Bootloaders/HID/Descriptors.c index a531015556..c1ea8e30e9 100644 --- a/Bootloaders/HID/Descriptors.c +++ b/Bootloaders/HID/Descriptors.c @@ -140,7 +140,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = .EndpointAddress = HID_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_IN_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c index 7542ab9af1..1a4860ad3b 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c @@ -186,7 +186,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC1_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC1_DataInEndpoint = @@ -196,7 +196,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC1_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC2_IAD = @@ -287,7 +287,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC2_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC2_DataInEndpoint = @@ -297,7 +297,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC2_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.c b/Demos/Device/ClassDriver/GenericHID/Descriptors.c index f8bb128f9d..a9ca6be1c7 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.c +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.c @@ -138,7 +138,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = GENERIC_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = GENERIC_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c index d0a469f6b0..903e35c634 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.c +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c @@ -138,7 +138,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = JOYSTICK_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = JOYSTICK_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.c b/Demos/Device/ClassDriver/Keyboard/Descriptors.c index 84ec47a984..c74368bb0b 100644 --- a/Demos/Device/ClassDriver/Keyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.c @@ -134,7 +134,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = KEYBOARD_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c index 207e7829bc..448fe0537d 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c @@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = KEYBOARD_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID2_MouseInterface = @@ -187,7 +187,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MOUSE_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c index fc2eafccd5..f80678f193 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c @@ -197,7 +197,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = HID_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.c b/Demos/Device/ClassDriver/MIDI/Descriptors.c index 84898acf62..44db1eee5d 100644 --- a/Demos/Device/ClassDriver/MIDI/Descriptors.c +++ b/Demos/Device/ClassDriver/MIDI/Descriptors.c @@ -202,7 +202,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MIDI_STREAM_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, @@ -227,7 +227,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MIDI_STREAM_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.c b/Demos/Device/ClassDriver/MassStorage/Descriptors.c index 0ab09b6a58..5c62f7fb18 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.c @@ -121,7 +121,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = @@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c index e7c9486b87..6818a7acb0 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c @@ -136,7 +136,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = @@ -146,7 +146,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_KeyboardInterface = @@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = KEYBOARD_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.c b/Demos/Device/ClassDriver/Mouse/Descriptors.c index 93bd02d619..174d238574 100644 --- a/Demos/Device/ClassDriver/Mouse/Descriptors.c +++ b/Demos/Device/ClassDriver/Mouse/Descriptors.c @@ -139,7 +139,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MOUSE_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index 86cc420c70..d1ca1df04a 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -160,7 +160,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .RNDIS_DataInEndpoint = @@ -170,7 +170,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c index 0858bc47ce..9dcf4e4d4f 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c @@ -172,7 +172,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -182,7 +182,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c index a3738651e5..cfccac02ba 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c @@ -186,7 +186,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -196,7 +196,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_Interface = @@ -222,7 +222,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = @@ -232,7 +232,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c index 0a40b4fa88..999712185e 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c @@ -205,7 +205,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -215,7 +215,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_Interface = @@ -252,7 +252,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MOUSE_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c index 2a60a741cf..bf16ab08a8 100644 --- a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c +++ b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c @@ -122,7 +122,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = TMC_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = TMC_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .TM_DataInEndpoint = @@ -132,7 +132,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = TMC_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = TMC_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .TM_NotificationEndpoint = diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c index 7542ab9af1..1a4860ad3b 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c @@ -186,7 +186,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC1_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC1_DataInEndpoint = @@ -196,7 +196,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC1_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC2_IAD = @@ -287,7 +287,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC2_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC2_DataInEndpoint = @@ -297,7 +297,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC2_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.c b/Demos/Device/LowLevel/GenericHID/Descriptors.c index 1d8765b546..3a6f135260 100644 --- a/Demos/Device/LowLevel/GenericHID/Descriptors.c +++ b/Demos/Device/LowLevel/GenericHID/Descriptors.c @@ -146,7 +146,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = GENERIC_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = GENERIC_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_ReportOUTEndpoint = @@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = GENERIC_OUT_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = GENERIC_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.c b/Demos/Device/LowLevel/Joystick/Descriptors.c index 74f388c659..bcadacda5c 100644 --- a/Demos/Device/LowLevel/Joystick/Descriptors.c +++ b/Demos/Device/LowLevel/Joystick/Descriptors.c @@ -158,7 +158,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = JOYSTICK_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = JOYSTICK_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/Keyboard/Descriptors.c b/Demos/Device/LowLevel/Keyboard/Descriptors.c index 2de04d3480..f4e2942395 100644 --- a/Demos/Device/LowLevel/Keyboard/Descriptors.c +++ b/Demos/Device/LowLevel/Keyboard/Descriptors.c @@ -163,7 +163,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = KEYBOARD_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_ReportOUTEndpoint = @@ -173,7 +173,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = KEYBOARD_OUT_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c index 9d592f7d44..a058373fa4 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c +++ b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c @@ -198,7 +198,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = KEYBOARD_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID1_ReportOUTEndpoint = @@ -208,7 +208,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = KEYBOARD_OUT_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID2_MouseInterface = @@ -245,7 +245,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MOUSE_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.c b/Demos/Device/LowLevel/MIDI/Descriptors.c index 84898acf62..44db1eee5d 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.c +++ b/Demos/Device/LowLevel/MIDI/Descriptors.c @@ -202,7 +202,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MIDI_STREAM_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, @@ -227,7 +227,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MIDI_STREAM_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.c b/Demos/Device/LowLevel/MassStorage/Descriptors.c index 0ab09b6a58..5c62f7fb18 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.c +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.c @@ -121,7 +121,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = @@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.c b/Demos/Device/LowLevel/Mouse/Descriptors.c index bd0cb61651..03ea0e71fa 100644 --- a/Demos/Device/LowLevel/Mouse/Descriptors.c +++ b/Demos/Device/LowLevel/Mouse/Descriptors.c @@ -158,7 +158,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MOUSE_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c index 86cc420c70..d1ca1df04a 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c @@ -160,7 +160,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .RNDIS_DataInEndpoint = @@ -170,7 +170,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c index 0858bc47ce..9dcf4e4d4f 100644 --- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c +++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c @@ -172,7 +172,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -182,7 +182,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c index 33a825d9a0..71643be29e 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c @@ -139,7 +139,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MOUSE_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index e92a0fc4f9..78867daaf1 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -42,6 +42,7 @@ * - Reverted AVRISP-MKII clone project watchdog based command timeout patch in favour of a hardware timer, to allow for use in devices with WDTRST fuse programmed * - The library bootloaders will now correctly start the user application after a watchdog-based application start, even if the /HWB line is held low externally * during the reset phase + * - Increased endpoint polling interval for all demos and projects to 5ms, as 1ms was causing some enumeration issues on some machines (thanks to Riku Salminen) * * Fixed: * - Core: diff --git a/Projects/Benito/Descriptors.c b/Projects/Benito/Descriptors.c index 2990848ebd..ea73dfe015 100644 --- a/Projects/Benito/Descriptors.c +++ b/Projects/Benito/Descriptors.c @@ -160,7 +160,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -170,7 +170,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c index e674c93e02..61176e6074 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c +++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c @@ -123,7 +123,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = @@ -133,7 +133,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Projects/LEDNotifier/Descriptors.c b/Projects/LEDNotifier/Descriptors.c index 9dda9e6998..d5bc6faed4 100644 --- a/Projects/LEDNotifier/Descriptors.c +++ b/Projects/LEDNotifier/Descriptors.c @@ -172,7 +172,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -182,7 +182,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Projects/MIDIToneGenerator/Descriptors.c b/Projects/MIDIToneGenerator/Descriptors.c index 84898acf62..44db1eee5d 100644 --- a/Projects/MIDIToneGenerator/Descriptors.c +++ b/Projects/MIDIToneGenerator/Descriptors.c @@ -202,7 +202,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MIDI_STREAM_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, @@ -227,7 +227,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MIDI_STREAM_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, diff --git a/Projects/Magstripe/Descriptors.c b/Projects/Magstripe/Descriptors.c index b031d54032..3784609d75 100644 --- a/Projects/Magstripe/Descriptors.c +++ b/Projects/Magstripe/Descriptors.c @@ -135,7 +135,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = KEYBOARD_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Projects/MediaController/Descriptors.c b/Projects/MediaController/Descriptors.c index 7ba467c280..b2b583c287 100644 --- a/Projects/MediaController/Descriptors.c +++ b/Projects/MediaController/Descriptors.c @@ -152,7 +152,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MEDIACONTROL_HID_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MEDIACONTROL_HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Projects/SerialToLCD/Descriptors.c b/Projects/SerialToLCD/Descriptors.c index 74f8e608ba..ea8ce8c943 100644 --- a/Projects/SerialToLCD/Descriptors.c +++ b/Projects/SerialToLCD/Descriptors.c @@ -173,7 +173,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Projects/TempDataLogger/Descriptors.c b/Projects/TempDataLogger/Descriptors.c index f75d78823e..ffd312df8e 100644 --- a/Projects/TempDataLogger/Descriptors.c +++ b/Projects/TempDataLogger/Descriptors.c @@ -139,7 +139,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = @@ -149,7 +149,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_Interface = @@ -186,7 +186,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = GENERIC_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = GENERIC_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Projects/USBtoSerial/Descriptors.c b/Projects/USBtoSerial/Descriptors.c index 66f81b8143..b7aa48cb4a 100644 --- a/Projects/USBtoSerial/Descriptors.c +++ b/Projects/USBtoSerial/Descriptors.c @@ -172,7 +172,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -182,7 +182,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Projects/Webserver/Descriptors.c b/Projects/Webserver/Descriptors.c index fb19a081a2..57519c864c 100644 --- a/Projects/Webserver/Descriptors.c +++ b/Projects/Webserver/Descriptors.c @@ -186,7 +186,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .RNDIS_DataInEndpoint = @@ -196,7 +196,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_Interface = @@ -222,7 +222,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = @@ -232,7 +232,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Projects/XPLAINBridge/USARTDescriptors.c b/Projects/XPLAINBridge/USARTDescriptors.c index d058aeabf8..6c131afd4c 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.c +++ b/Projects/XPLAINBridge/USARTDescriptors.c @@ -172,7 +172,7 @@ const USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = @@ -182,7 +182,7 @@ const USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; From 1007317c5fd9842036cd1641ffd60eda65034800 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 6 May 2012 11:11:33 +0000 Subject: [PATCH 28/37] Fixed broken MIDI host driver MIDI_Host_ReceiveEventPacket() function due to not unfreezing the MIDI data IN pipe before use (thanks to Michael Brown). --- LUFA/DoxygenPages/ChangeLog.txt | 1 + LUFA/Drivers/USB/Class/Host/MIDIClassHost.c | 25 ++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 78867daaf1..f78a00bfbc 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -56,6 +56,7 @@ * - Fixed inverted LED logic in the USB2AX board LED driver * - Fixed possible deadlock in the CDC device driver if the USB connection is dropped while the CDC_REQ_SetLineEncoding control request is being processed by * the stack (thanks to Jonathan Hudgins) + * - Fixed broken MIDI host driver MIDI_Host_ReceiveEventPacket() function due to not unfreezing the MIDI data IN pipe before use (thanks to Michael Brown) * - Library Applications: * - Fixed error in the AVRISP-MKII programmer when ISP mode is used at 64KHz (thanks to Ben R. Porter) * - Fixed AVRISP-MKII programmer project failing to compile for the U4 chips when VTARGET_ADC_CHANNEL is defined to an invalid channel and NO_VTARGET_DETECT is diff --git a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c index 0d33bfec4f..1300577fc6 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c @@ -192,18 +192,27 @@ bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface { if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive)) return HOST_SENDCONTROL_DeviceDisconnected; + + bool DataReady = false; Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataINPipe.Address); + Pipe_Unfreeze(); - if (!(Pipe_IsReadWriteAllowed())) - return false; - - Pipe_Read_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL); - - if (!(Pipe_IsReadWriteAllowed())) - Pipe_ClearIN(); + if (Pipe_IsINReceived()) + { + if (Pipe_BytesInPipe()) + { + Pipe_Read_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL); + DataReady = true; + } - return true; + if (!(Pipe_BytesInPipe())) + Pipe_ClearIN(); + } + + Pipe_Freeze(); + + return DataReady; } #endif From 395e4287a1eacb617360c932beaf8aa0288ce8a6 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 6 May 2012 12:10:30 +0000 Subject: [PATCH 29/37] Added support for the Olimex AVR-USB-32U4 and Olimex AVR-USB-T32U4 boards. --- LUFA.pnproj | 2 +- LUFA/Common/BoardTypes.h | 7 + LUFA/DoxygenPages/ChangeLog.txt | 2 + LUFA/DoxygenPages/DeviceSupport.txt | 2 + LUFA/DoxygenPages/LUFAPoweredProjects.txt | 1 + LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h | 103 ++++++++++ LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h | 179 ++++++++++++++++++ LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h | 103 ++++++++++ LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h | 169 +++++++++++++++++ LUFA/Drivers/Board/Buttons.h | 4 + LUFA/Drivers/Board/LEDs.h | 4 + 11 files changed, 575 insertions(+), 1 deletion(-) create mode 100644 LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h create mode 100644 LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h create mode 100644 LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h create mode 100644 LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h diff --git a/LUFA.pnproj b/LUFA.pnproj index 125d0cd76a..3ba9430065 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/Common/BoardTypes.h b/LUFA/Common/BoardTypes.h index 55a5a15ab3..0a40b19101 100644 --- a/LUFA/Common/BoardTypes.h +++ b/LUFA/Common/BoardTypes.h @@ -206,6 +206,13 @@ /** Selects the DorkbotPDX Duce specific board drivers, including the driver for the board LEDs. */ #define BOARD_DUCE 47 + + /** Selects the Olimex AVR-USB-32U4 specific board drivers, including the Button and LED drivers. */ + #define BOARD_OLIMEX32U4 48 + + /** Selects the Olimex AVR-USB-T32U4 specific board drivers, including the Button and LED drivers. */ + #define BOARD_OLIMEXT32U4 49 + #if !defined(__DOXYGEN__) #define BOARD_ BOARD_NONE diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index f78a00bfbc..4621e8ed39 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -11,6 +11,8 @@ * - Core: * - Added support for the BitWizard Multio and Big-Multio boards * - Added support for the DorkbotPDX Duce board + * - Added support for the Olimex AVR-USB-32U4 board + * - Added support for the Olimex AVR-USB-T32U4 board * - Added new Endpoint_ConfigureEndpointTable() function * - Added new Pipe_ConfigurePipeTable() function * - Library Applications: diff --git a/LUFA/DoxygenPages/DeviceSupport.txt b/LUFA/DoxygenPages/DeviceSupport.txt index 5381af0c8d..98678985d1 100644 --- a/LUFA/DoxygenPages/DeviceSupport.txt +++ b/LUFA/DoxygenPages/DeviceSupport.txt @@ -116,6 +116,8 @@ * - Microsin AVR-USB162 * - Minimus USB * - Olimex AVR-USB-162 + * - Olimex AVR-USB-32U4 + * - Olimex AVR-USB-T32U4 * - Paranoid Studio's US2AX (V1, V2 and V3 hardware revisions) * - PJRC Teensy (1.x and 2.x versions) * - Sparkfun U2 Breakout Board diff --git a/LUFA/DoxygenPages/LUFAPoweredProjects.txt b/LUFA/DoxygenPages/LUFAPoweredProjects.txt index 5179850e12..842d98fd96 100644 --- a/LUFA/DoxygenPages/LUFAPoweredProjects.txt +++ b/LUFA/DoxygenPages/LUFAPoweredProjects.txt @@ -20,6 +20,7 @@ * * \li AVR-USB-162, a USBKEY-like development board for the AT90USB162: http://olimex.com/dev/avr-usb-162.html * \li Benito #7, a no-frills USB board: http://www.dorkbotpdx.org/wiki/benito + * \li Duce, the sucessor to the Benito #7: http://dorkbotpdx.org/wiki/duce * \li JM-DB-U2, an ATMEGA32U2 development board: http://u2.mattair.net/index.html * \li Micropendous, an open design/source set of AVR USB development boards: http://micropendous.org/ * \li Microsin AVR-USB162 breakout board, a DIY AT90USB162 development board: http://microsin.ru/content/view/685/44/ diff --git a/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h b/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h new file mode 100644 index 0000000000..d42c43474b --- /dev/null +++ b/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h @@ -0,0 +1,103 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific Buttons driver header for the Olimex AVR-USB-32U4 Development Board. + * \copydetails Group_Buttons_OLIMEX32U4 + * + * \note This file should not be included directly. It is automatically included as needed by the Buttons driver + * dispatch header located in LUFA/Drivers/Board/Buttons.h. + */ + +/** \ingroup Group_Buttons + * \defgroup Group_Buttons_OLIMEX32U4 OLIMEX32U4 + * \brief Board specific Buttons driver header for the Olimex AVR-USB-32U4 Development Board. + * + * Board specific Buttons driver header for the Olimex AVR-USB-32U4 Development Board (http://www.olimex.com/dev/olimexino-32u4.html). + * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTE.2
+ * + * @{ + */ + +#ifndef __BUTTONS_OLIMEX32U4_H__ +#define __BUTTONS_OLIMEX32U4_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BUTTONS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Button mask for the first button on the board. */ + #define BUTTONS_BUTTON1 (1 << 2) + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE |= BUTTONS_BUTTON1; + } + + static inline void Buttons_Disable(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE &= ~BUTTONS_BUTTON1; + } + + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Buttons_GetStatus(void) + { + return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h b/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h new file mode 100644 index 0000000000..fd468c79ff --- /dev/null +++ b/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h @@ -0,0 +1,179 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the Olimex AVR-USB-32U4. + * \copydetails Group_LEDs_OLIMEX32U4 + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_OLIMEX32U4 OLIMEX32U4 + * \brief Board specific LED driver header for the Olimex AVR-USB-32U4. + * + * Board specific LED driver header for the Olimex AVR-USB-32U4 (http://www.olimex.com/dev/olimexino-32u4.html). + * + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenTXHighPORTD.5
LEDS_LED2YellowRXHighPORTB.0
LEDS_LED3GreenGeneral Indicator (Default Unconnected)HighPORTE.6
LEDS_LED4YellowGeneral Indicator (Default Unconnected)HighPORTB.5
+ * + * @{ + */ + +#ifndef __LEDS_OLIMEX32U4_H__ +#define __LEDS_OLIMEX32U4_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define LEDS_PORTB_LEDS (LEDS_LED2 | LEDS_LED4) + #define LEDS_PORTD_LEDS (LEDS_LED1) + #define LEDS_PORTE_LEDS (LEDS_LED3) + + #define LEDS_PORTD_MASK_SHIFT 1 + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 ((1 << 5) >> LEDS_PORTD_MASK_SHIFT) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 0) + + /** LED mask for the third LED on the board. */ + #define LEDS_LED3 (1 << 5) + + /** LED mask for the fourth LED on the board. */ + #define LEDS_LED4 (1 << 6) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4) + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRB |= LEDS_PORTB_LEDS; + PORTB &= ~LEDS_PORTB_LEDS; + DDRD |= (LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT); + PORTD &= ~(LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT); + DDRE |= LEDS_PORTE_LEDS; + PORTE &= ~LEDS_PORTE_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRB &= LEDS_PORTB_LEDS; + PORTB &= ~LEDS_PORTB_LEDS; + DDRD &= (LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT); + PORTD &= ~(LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT); + DDRE &= LEDS_PORTE_LEDS; + PORTE &= ~LEDS_PORTE_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTB |= (LEDMask & LEDS_PORTB_LEDS); + PORTD |= ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT); + PORTE |= (LEDMask & LEDS_PORTE_LEDS); + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTB &= ~(LEDMask & LEDS_PORTB_LEDS); + PORTD &= ~((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT); + PORTE &= ~(LEDMask & LEDS_PORTE_LEDS); + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTB = ((PORTB & ~LEDS_PORTB_LEDS) | (LEDMask & LEDS_PORTB_LEDS)); + PORTD = ((PORTD & ~(LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT)) | + ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT)); + PORTE = ((PORTE & ~LEDS_PORTE_LEDS) | (LEDMask & LEDS_PORTE_LEDS)); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTB = ((PORTB & ~(LEDMask & LEDS_PORTB_LEDS)) | (ActiveMask & LEDS_PORTB_LEDS)); + PORTD = ((PORTD & ~((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT)) | + ((ActiveMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT)); + PORTE = ((PORTE & ~(LEDMask & LEDS_PORTE_LEDS)) | (ActiveMask & LEDS_PORTE_LEDS)); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PORTB ^= (LEDMask & LEDS_PORTB_LEDS); + PORTD ^= ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT); + PORTE ^= (LEDMask & LEDS_PORTE_LEDS); + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return ((PORTB & LEDS_PORTB_LEDS) | + ((PORTD & (LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT)) >> LEDS_PORTD_MASK_SHIFT) | + (PORTE & LEDS_PORTE_LEDS)); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h b/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h new file mode 100644 index 0000000000..106687a0dc --- /dev/null +++ b/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h @@ -0,0 +1,103 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific Buttons driver header for the Olimex AVR-USB-T32U4 Development Board. + * \copydetails Group_Buttons_OLIMEXT32U4 + * + * \note This file should not be included directly. It is automatically included as needed by the Buttons driver + * dispatch header located in LUFA/Drivers/Board/Buttons.h. + */ + +/** \ingroup Group_Buttons + * \defgroup Group_Buttons_OLIMEXT32U4 OLIMEXT32U4 + * \brief Board specific Buttons driver header for the Olimex AVR-USB-32U4 Development Board. + * + * Board specific Buttons driver header for the Olimex AVR-USB-T32U4 Development Board (http://www.olimex.com/dev/avr-t32u4.html). + * + * + * + * + *
NameInfoActive LevelPort Pin
BUTTONS_BUTTON1HWB ButtonLowPORTE.2
+ * + * @{ + */ + +#ifndef __BUTTONS_OLIMEXT32U4_H__ +#define __BUTTONS_OLIMEXT32U4_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BUTTONS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Button mask for the first button on the board. */ + #define BUTTONS_BUTTON1 (1 << 2) + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE |= BUTTONS_BUTTON1; + } + + static inline void Buttons_Disable(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE &= ~BUTTONS_BUTTON1; + } + + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Buttons_GetStatus(void) + { + return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h b/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h new file mode 100644 index 0000000000..029707e4c4 --- /dev/null +++ b/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h @@ -0,0 +1,169 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the Olimex AVR-USB-T32U4. + * \copydetails Group_LEDs_OLIMEXT32U4 + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_OLIMEXT32U4 OLIMEXT32U4 + * \brief Board specific LED driver header for the Olimex AVR-USB-T32U4. + * + * Board specific LED driver header for the Olimex AVR-USB-T32U4 (http://www.olimex.com/dev/avr-t32u4.html). + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenTXHighPORTD.5
LEDS_LED2YellowRXHighPORTB.0
LEDS_LED3N/AGeneral Indicator (Not Mounted)HighPORTE.6
+ * + * @{ + */ + +#ifndef __LEDS_OLIMEXT32U4_H__ +#define __LEDS_OLIMEXT32U4_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define LEDS_PORTB_LEDS (LEDS_LED2) + #define LEDS_PORTD_LEDS (LEDS_LED1) + #define LEDS_PORTE_LEDS (LEDS_LED3) + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 5) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 0) + + /** LED mask for the third LED on the board. */ + #define LEDS_LED3 (1 << 6) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3) + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRB |= LEDS_PORTB_LEDS; + PORTB &= ~LEDS_PORTB_LEDS; + DDRD |= LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRE |= LEDS_PORTE_LEDS; + PORTE &= ~LEDS_PORTE_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRB &= LEDS_PORTB_LEDS; + PORTB &= ~LEDS_PORTB_LEDS; + DDRD &= LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRE &= LEDS_PORTE_LEDS; + PORTE &= ~LEDS_PORTE_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTB |= (LEDMask & LEDS_PORTB_LEDS); + PORTD |= (LEDMask & LEDS_PORTD_LEDS); + PORTE |= (LEDMask & LEDS_PORTE_LEDS); + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTB &= ~(LEDMask & LEDS_PORTB_LEDS); + PORTD &= ~(LEDMask & LEDS_PORTD_LEDS); + PORTE &= ~(LEDMask & LEDS_PORTE_LEDS); + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTB = ((PORTB & ~LEDS_PORTB_LEDS) | (LEDMask & LEDS_PORTB_LEDS)); + PORTD = ((PORTD & ~LEDS_PORTD_LEDS) | (LEDMask & LEDS_PORTD_LEDS)); + PORTE = ((PORTE & ~LEDS_PORTE_LEDS) | (LEDMask & LEDS_PORTE_LEDS)); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTB = ((PORTB & ~(LEDMask & LEDS_PORTB_LEDS)) | (ActiveMask & LEDS_PORTB_LEDS)); + PORTD = ((PORTD & ~(LEDMask & LEDS_PORTD_LEDS)) | (ActiveMask & LEDS_PORTD_LEDS)); + PORTE = ((PORTE & ~(LEDMask & LEDS_PORTE_LEDS)) | (ActiveMask & LEDS_PORTE_LEDS)); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PORTB ^= (LEDMask & LEDS_PORTB_LEDS); + PORTD ^= (LEDMask & LEDS_PORTD_LEDS); + PORTE ^= (LEDMask & LEDS_PORTE_LEDS); + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return ((PORTB & LEDS_PORTB_LEDS) | (PORTD & LEDS_PORTD_LEDS) | (PORTE & LEDS_PORTE_LEDS)); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h index bf85246855..c3d6c0d00f 100644 --- a/LUFA/Drivers/Board/Buttons.h +++ b/LUFA/Drivers/Board/Buttons.h @@ -143,6 +143,10 @@ #include "AVR8/MICROPENDOUS/Buttons.h" #elif (BOARD == BOARD_B1_XPLAINED) #include "XMEGA/B1_XPLAINED/Buttons.h" + #elif (BOARD == BOARD_OLIMEX32U4) + #include "AVR8/OLIMEX32U4/Buttons.h" + #elif (BOARD == BOARD_OLIMEXT32U4) + #include "AVR8/OLIMEXT32U4/Buttons.h" #else #include "Board/Buttons.h" #endif diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index 7e7ab2e416..f6f9d82ff4 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -187,6 +187,10 @@ #include "AVR8/BIGMULTIO/LEDs.h" #elif (BOARD == BOARD_DUCE) #include "AVR8/DUCE/LEDs.h" + #elif (BOARD == BOARD_OLIMEX32U4) + #include "AVR8/OLIMEX32U4/LEDs.h" + #elif (BOARD == BOARD_OLIMEXT32U4) + #include "AVR8/OLIMEXT32U4/LEDs.h" #else #include "Board/LEDs.h" #endif From 9207e8b2fde713e39cd42a417decf5421d856b95 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 6 May 2012 12:19:03 +0000 Subject: [PATCH 30/37] Changed board LED driver implementations of LEDs_ToggleLEDs() for the AVR8 architecture to use the fast PIN register toggle alternative function for speed. --- LUFA/DoxygenPages/ChangeLog.txt | 1 + LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/BENITO/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h | 4 ++-- LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/BUI/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/CULV3/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/DUCE/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/EVK527/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h | 3 ++- LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h | 4 ++-- LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h | 6 +++--- LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h | 6 +++--- LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h | 4 ++-- LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/STK525/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/STK526/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/TUL/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/UDIP/LEDs.h | 4 ++-- LUFA/Drivers/Board/AVR8/UNO/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h | 4 ++-- LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h | 2 +- LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h | 2 +- 33 files changed, 43 insertions(+), 41 deletions(-) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 4621e8ed39..f8e1b8f48e 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -38,6 +38,7 @@ * - Added support for various assert and debugging macros for the UC3 devices * - Changed MIDI event structure MIDI_EventPacket_t to use a single field for the combined virtual cable index and command ID, to prevent bitfield packing issues * on some architectures (thanks to Darren Gibbs) + * - Changed board LED driver implementations of LEDs_ToggleLEDs() for the AVR8 architecture to use the fast PIN register toggle alternative function for speed * - 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/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h b/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h index f13b75624f..661749bebe 100644 --- a/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h @@ -114,7 +114,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTE ^= LEDMask; + PINE = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h index 06dcada7de..2cc953b030 100644 --- a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h @@ -118,7 +118,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h b/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h index 429f33e250..875130fbf5 100644 --- a/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h @@ -118,7 +118,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTC ^= LEDMask; + PINC = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h b/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h index 4c749618a6..89516dca0e 100644 --- a/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h @@ -139,8 +139,8 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTF ^= (LEDMask & LEDS_PORTF_LEDS); - PORTE ^= (LEDMask & LEDS_PORTE_LEDS); + PINF = (LEDMask & LEDS_PORTF_LEDS); + PINE = (LEDMask & LEDS_PORTE_LEDS); } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h b/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h index 7bfef87dce..12124209d0 100644 --- a/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h @@ -118,7 +118,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/BUI/LEDs.h b/LUFA/Drivers/Board/AVR8/BUI/LEDs.h index 043a2a72cd..039e9efa71 100644 --- a/LUFA/Drivers/Board/AVR8/BUI/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BUI/LEDs.h @@ -122,7 +122,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTC ^= LEDMask; + PINC = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h b/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h index 24a1fb209e..a09ab96989 100644 --- a/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h @@ -128,7 +128,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTB ^= LEDMask; + PINB = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h b/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h index 8888a0586b..617291204d 100644 --- a/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h @@ -114,7 +114,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTE ^= LEDMask; + PINE = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h b/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h index 4c86ed4780..1063d752d8 100644 --- a/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h @@ -126,7 +126,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTC ^= LEDMask; + PINC = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h b/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h index ade2b268a5..7e3dc4f5b1 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h @@ -122,7 +122,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h b/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h index 6c49341937..adca2dee41 100644 --- a/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h @@ -114,7 +114,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h index 460c94e09f..815fc29b2c 100644 --- a/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h @@ -118,7 +118,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTB ^= LEDMask; + PINB = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h index 71a8049f60..963c15ae42 100644 --- a/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h @@ -104,6 +104,7 @@ #define _BOARD_LED_CONCAT(Reg, Letter) _BOARD_LED_CONCAT2(Reg, Letter) #define _BOARD_LED_PORT _BOARD_LED_CONCAT(PORT, _BOARD_LED_PORTLETTER) + #define _BOARD_LED_PIN _BOARD_LED_CONCAT(PIN, _BOARD_LED_PORTLETTER) #define _BOARD_LED_DDR _BOARD_LED_CONCAT(DDR, _BOARD_LED_PORTLETTER) #endif @@ -155,7 +156,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - _BOARD_LED_PORT ^= LEDMask; + _BOARD_LED_PIN = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h b/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h index 8b28d30450..31aaa67079 100644 --- a/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h @@ -114,7 +114,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h index c689a31540..f23317d1c1 100644 --- a/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h @@ -122,7 +122,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h b/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h index c5f07b9acf..64f68a53da 100644 --- a/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h @@ -139,8 +139,8 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= (LEDMask & LEDS_PORTD_LEDS); - PORTC ^= (LEDMask & LEDS_PORTC_LEDS); + PIND = (LEDMask & LEDS_PORTD_LEDS); + PINC = (LEDMask & LEDS_PORTC_LEDS); } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h b/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h index cc34daac39..21fb500cc4 100644 --- a/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h @@ -114,7 +114,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h b/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h index fd468c79ff..62b7c78295 100644 --- a/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h @@ -154,9 +154,9 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTB ^= (LEDMask & LEDS_PORTB_LEDS); - PORTD ^= ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT); - PORTE ^= (LEDMask & LEDS_PORTE_LEDS); + PINB = (LEDMask & LEDS_PORTB_LEDS); + PIND = ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT); + PINE = (LEDMask & LEDS_PORTE_LEDS); } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h b/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h index 029707e4c4..1602af8429 100644 --- a/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h @@ -146,9 +146,9 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTB ^= (LEDMask & LEDS_PORTB_LEDS); - PORTD ^= (LEDMask & LEDS_PORTD_LEDS); - PORTE ^= (LEDMask & LEDS_PORTE_LEDS); + PINB = (LEDMask & LEDS_PORTB_LEDS); + PIND = (LEDMask & LEDS_PORTD_LEDS); + PINE = (LEDMask & LEDS_PORTE_LEDS); } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h b/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h index 3bc45b9e7d..7be9b378f2 100644 --- a/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h @@ -152,8 +152,8 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= (LEDMask & LEDS_PORTD_LEDS); - PORTE ^= ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT); + PIND = (LEDMask & LEDS_PORTD_LEDS); + PINE = ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT); } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h b/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h index a838bed534..6998fd3f30 100644 --- a/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h @@ -114,7 +114,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTB ^= LEDMask; + PINB = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/STK525/LEDs.h b/LUFA/Drivers/Board/AVR8/STK525/LEDs.h index 881010c62d..04d566204e 100644 --- a/LUFA/Drivers/Board/AVR8/STK525/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/STK525/LEDs.h @@ -126,7 +126,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/STK526/LEDs.h b/LUFA/Drivers/Board/AVR8/STK526/LEDs.h index b19abdc6be..d254a69b40 100644 --- a/LUFA/Drivers/Board/AVR8/STK526/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/STK526/LEDs.h @@ -126,7 +126,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h b/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h index f3a577a76b..7149923ea1 100644 --- a/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h @@ -151,7 +151,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/TUL/LEDs.h b/LUFA/Drivers/Board/AVR8/TUL/LEDs.h index 82ccb0ff4c..e659a9a9ca 100644 --- a/LUFA/Drivers/Board/AVR8/TUL/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/TUL/LEDs.h @@ -114,7 +114,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTF ^= LEDMask; + PINF = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h b/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h index 83cb1fbeb0..7ad6c44b3b 100644 --- a/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h @@ -141,8 +141,8 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTB ^= (LEDMask & LEDS_PORTB_LEDS); - PORTD ^= ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT); + PINB = (LEDMask & LEDS_PORTB_LEDS); + PIND = ((LEDMask & LEDS_PORTD_LEDS) << LEDS_PORTD_MASK_SHIFT); } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/UNO/LEDs.h b/LUFA/Drivers/Board/AVR8/UNO/LEDs.h index 5ffafdd5eb..2a6178caa8 100644 --- a/LUFA/Drivers/Board/AVR8/UNO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/UNO/LEDs.h @@ -118,7 +118,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h b/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h index e66698715e..12fa73cd17 100644 --- a/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h @@ -167,9 +167,9 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { #if (BOARD == BOARD_USB2AX) - PORTC ^= LEDMask; + PINC = LEDMask; #else - PORTD ^= LEDMask; + PIND = LEDMask; #endif } diff --git a/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h b/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h index 810be72ed9..2d68caf021 100644 --- a/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h @@ -114,7 +114,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h b/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h index 62c0d76dbe..25a90a74e4 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h @@ -126,7 +126,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTD ^= LEDMask; + PIND = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h b/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h index 9322ab90ce..96acd6212b 100644 --- a/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h @@ -122,7 +122,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTB ^= LEDMask; + PINB = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h b/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h index ef36e1767e..879d656c13 100644 --- a/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h @@ -121,7 +121,7 @@ static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { - PORTB ^= LEDMask; + PINB = LEDMask; } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; From 44f348e7ffdcd899d87a0ae4a8aacabf67672e9f Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 6 May 2012 14:26:18 +0000 Subject: [PATCH 31/37] Add partially complete BoardDriverTest build test. --- BuildTests/BoardDriverTest/Board/Buttons.h | 90 +++ BuildTests/BoardDriverTest/Board/Dataflash.h | 195 +++++ BuildTests/BoardDriverTest/Board/Joystick.h | 102 +++ BuildTests/BoardDriverTest/Board/LEDs.h | 130 ++++ BuildTests/BoardDriverTest/BoardDeviceMap.cfg | 3 + BuildTests/BoardDriverTest/Test.c | 48 ++ BuildTests/BoardDriverTest/makefile | 58 ++ BuildTests/BoardDriverTest/makefile.avr8 | 722 ++++++++++++++++++ BuildTests/BoardDriverTest/makefile.uc3 | 485 ++++++++++++ BuildTests/BoardDriverTest/makefile.xmega | 704 +++++++++++++++++ BuildTests/makefile | 2 + LUFA.pnproj | 2 +- 12 files changed, 2540 insertions(+), 1 deletion(-) create mode 100644 BuildTests/BoardDriverTest/Board/Buttons.h create mode 100644 BuildTests/BoardDriverTest/Board/Dataflash.h create mode 100644 BuildTests/BoardDriverTest/Board/Joystick.h create mode 100644 BuildTests/BoardDriverTest/Board/LEDs.h create mode 100644 BuildTests/BoardDriverTest/BoardDeviceMap.cfg create mode 100644 BuildTests/BoardDriverTest/Test.c create mode 100644 BuildTests/BoardDriverTest/makefile create mode 100644 BuildTests/BoardDriverTest/makefile.avr8 create mode 100644 BuildTests/BoardDriverTest/makefile.uc3 create mode 100644 BuildTests/BoardDriverTest/makefile.xmega diff --git a/BuildTests/BoardDriverTest/Board/Buttons.h b/BuildTests/BoardDriverTest/Board/Buttons.h new file mode 100644 index 0000000000..8754721efe --- /dev/null +++ b/BuildTests/BoardDriverTest/Board/Buttons.h @@ -0,0 +1,90 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief LUFA Custom Board Button Hardware Driver (Template) + * + * This is a stub driver header file, for implementing custom board + * layout hardware with compatible LUFA board specific drivers. If + * the library is configured to use the BOARD_USER board mode, this + * driver file should be completed and copied into the "/Board/" folder + * inside the application's folder. + * + * This stub is for the board-specific component of the LUFA Buttons driver, + * for the control of physical board-mounted GPIO pushbuttons. + */ + +#ifndef __BUTTONS_USER_H__ +#define __BUTTONS_USER_H__ + + /* Includes: */ + // TODO: Add any required includes here + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BUTTONS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Button mask for the first button on the board. */ + #define BUTTONS_BUTTON1 (1 << 0) + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(void) + { + + } + + static inline void Buttons_Disable(void) + { + + } + + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Buttons_GetStatus(void) + { + return 0; + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + diff --git a/BuildTests/BoardDriverTest/Board/Dataflash.h b/BuildTests/BoardDriverTest/Board/Dataflash.h new file mode 100644 index 0000000000..72561e55b2 --- /dev/null +++ b/BuildTests/BoardDriverTest/Board/Dataflash.h @@ -0,0 +1,195 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief LUFA Custom Board Dataflash Hardware Driver (Template) + * + * This is a stub driver header file, for implementing custom board + * layout hardware with compatible LUFA board specific drivers. If + * the library is configured to use the BOARD_USER board mode, this + * driver file should be completed and copied into the "/Board/" folder + * inside the application's folder. + * + * This stub is for the board-specific component of the LUFA Dataflash + * driver. +*/ + +#ifndef __DATAFLASH_USER_H__ +#define __DATAFLASH_USER_H__ + + /* Includes: */ + // TODO: Add any required includes here + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_DATAFLASH_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define DATAFLASH_CHIPCS_MASK // TODO: Replace this with a mask of all the /CS pins of all Dataflashes + #define DATAFLASH_CHIPCS_DDR // TODO: Replace with the DDR register name for the board's Dataflash ICs + #define DATAFLASH_CHIPCS_PORT // TODO: Replace with the PORT register name for the board's Dataflash ICs + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Constant indicating the total number of dataflash ICs mounted on the selected board. */ + #define DATAFLASH_TOTALCHIPS 1 // TODO: Replace with the number of Dataflashes on the board, max 2 + + /** Mask for no dataflash chip selected. */ + #define DATAFLASH_NO_CHIP DATAFLASH_CHIPCS_MASK + + /** Mask for the first dataflash chip selected. */ + #define DATAFLASH_CHIP1 // TODO: Replace with mask to hold /CS of first Dataflash low, and all others high + + /** Mask for the second dataflash chip selected. */ + #define DATAFLASH_CHIP2 // TODO: Replace with mask to hold /CS of second Dataflash low, and all others high + + /** Internal main memory page size for the board's dataflash ICs. */ + #define DATAFLASH_PAGE_SIZE // TODO: Replace with the page size for the Dataflash ICs + + /** Total number of pages inside each of the board's dataflash ICs. */ + #define DATAFLASH_PAGES // TODO: Replace with the total number of pages inside one of the Dataflash ICs + + /* Inline Functions: */ + /** Initializes the dataflash driver so that commands and data may be sent to an attached dataflash IC. + * The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used. + */ + static inline void Dataflash_Init(void) + { + + } + + /** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. + * + * \param[in] Byte Byte of data to send to the dataflash + * + * \return Last response byte from the dataflash + */ + static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; + static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) + { + return 0; + } + + /** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash. + * + * \param[in] Byte Byte of data to send to the dataflash + */ + static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; + static inline void Dataflash_SendByte(const uint8_t Byte) + { + + } + + /** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash. + * + * \return Last response byte from the dataflash + */ + static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Dataflash_ReceiveByte(void) + { + return 0; + } + + /** Determines the currently selected dataflash chip. + * + * \return Mask of the currently selected Dataflash chip, either \ref DATAFLASH_NO_CHIP if no chip is selected + * or a DATAFLASH_CHIPn mask (where n is the chip number). + */ + static inline uint8_t Dataflash_GetSelectedChip(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Dataflash_GetSelectedChip(void) + { + return 0; + } + + /** Selects the given dataflash chip. + * + * \param[in] ChipMask Mask of the Dataflash IC to select, in the form of DATAFLASH_CHIPn mask (where n is + * the chip number). + */ + static inline void Dataflash_SelectChip(const uint8_t ChipMask) ATTR_ALWAYS_INLINE; + static inline void Dataflash_SelectChip(const uint8_t ChipMask) + { + + } + + /** Deselects the current dataflash chip, so that no dataflash is selected. */ + static inline void Dataflash_DeselectChip(void) ATTR_ALWAYS_INLINE; + static inline void Dataflash_DeselectChip(void) + { + + } + + /** Selects a dataflash IC from the given page number, which should range from 0 to + * ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1). For boards containing only one + * dataflash IC, this will select DATAFLASH_CHIP1. If the given page number is outside + * the total number of pages contained in the boards dataflash ICs, all dataflash ICs + * are deselected. + * + * \param[in] PageAddress Address of the page to manipulate, ranging from + * 0 to ((DATAFLASH_PAGES * DATAFLASH_TOTALCHIPS) - 1). + */ + static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress) + { + + } + + /** Toggles the select line of the currently selected dataflash IC, so that it is ready to receive + * a new command. + */ + static inline void Dataflash_ToggleSelectedChipCS(void) + { + + } + + /** Spin-loops while the currently selected dataflash is busy executing a command, such as a main + * memory page program or main memory to buffer transfer. + */ + static inline void Dataflash_WaitWhileBusy(void) + { + + } + + /** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with + * dataflash commands which require a complete 24-bit address. + * + * \param[in] PageAddress Page address within the selected dataflash IC + * \param[in] BufferByte Address within the dataflash's buffer + */ + static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte) + { + + } + +#endif + diff --git a/BuildTests/BoardDriverTest/Board/Joystick.h b/BuildTests/BoardDriverTest/Board/Joystick.h new file mode 100644 index 0000000000..f4328389ed --- /dev/null +++ b/BuildTests/BoardDriverTest/Board/Joystick.h @@ -0,0 +1,102 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief LUFA Custom Board Joystick Hardware Driver (Template) + * + * This is a stub driver header file, for implementing custom board + * layout hardware with compatible LUFA board specific drivers. If + * the library is configured to use the BOARD_USER board mode, this + * driver file should be completed and copied into the "/Board/" folder + * inside the application's folder. + * + * This stub is for the board-specific component of the LUFA Joystick + * driver, for a digital four-way (plus button) joystick. +*/ + +#ifndef __JOYSTICK_USER_H__ +#define __JOYSTICK_USER_H__ + + /* Includes: */ + // TODO: Add any required includes here + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_JOYSTICK_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Mask for the joystick being pushed in the left direction. */ + #define JOY_LEFT // TODO: Add mask to indicate joystick left position here + + /** Mask for the joystick being pushed in the right direction. */ + #define JOY_RIGHT // TODO: Add mask to indicate joystick right position here + + /** Mask for the joystick being pushed in the upward direction. */ + #define JOY_UP // TODO: Add mask to indicate joystick up position here + + /** Mask for the joystick being pushed in the downward direction. */ + #define JOY_DOWN // TODO: Add mask to indicate joystick down position here + + /** Mask for the joystick being pushed inward. */ + #define JOY_PRESS // TODO: Add mask to indicate joystick pressed position here + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Joystick_Init(void) + { + + } + + static inline void Joystick_Disable(void) + { + + } + + static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Joystick_GetStatus(void) + { + return 0; + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + diff --git a/BuildTests/BoardDriverTest/Board/LEDs.h b/BuildTests/BoardDriverTest/Board/LEDs.h new file mode 100644 index 0000000000..a0346b258a --- /dev/null +++ b/BuildTests/BoardDriverTest/Board/LEDs.h @@ -0,0 +1,130 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief LUFA Custom Board LED Hardware Driver (Template) + * + * This is a stub driver header file, for implementing custom board + * layout hardware with compatible LUFA board specific drivers. If + * the library is configured to use the BOARD_USER board mode, this + * driver file should be completed and copied into the "/Board/" folder + * inside the application's folder. + * + * This stub is for the board-specific component of the LUFA LEDs driver, + * for the LEDs (up to four) mounted on most development boards. +*/ + +#ifndef __LEDS_USER_H__ +#define __LEDS_USER_H__ + + /* Includes: */ + // TODO: Add any required includes here + +/* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 0) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 1) + + /** LED mask for the third LED on the board. */ + #define LEDS_LED3 (1 << 2) + + /** LED mask for the fourth LED on the board. */ + #define LEDS_LED4 (1 << 3) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4) + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + + } + + static inline void LEDs_Disable(void) + { + + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) + { + + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return 0; + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + diff --git a/BuildTests/BoardDriverTest/BoardDeviceMap.cfg b/BuildTests/BoardDriverTest/BoardDeviceMap.cfg new file mode 100644 index 0000000000..15a5f451ad --- /dev/null +++ b/BuildTests/BoardDriverTest/BoardDeviceMap.cfg @@ -0,0 +1,3 @@ +# BOARD DEFINE = {ARCH} : {MCU} +BOARD_USER = avr8 : at90usb1287 +BOARD_USBKEY = avr8 : at90usb1287 \ No newline at end of file diff --git a/BuildTests/BoardDriverTest/Test.c b/BuildTests/BoardDriverTest/Test.c new file mode 100644 index 0000000000..796dd84b5c --- /dev/null +++ b/BuildTests/BoardDriverTest/Test.c @@ -0,0 +1,48 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +#include +#include +#include +#include +#include + +int main(void) +{ + LEDs_SetAllLEDs(LEDS_ALL_LEDS); + LEDs_SetAllLEDs(LEDS_NO_LEDS); + LEDs_SetAllLEDs(LEDS_LED1); + LEDs_SetAllLEDs(LEDS_LED2); + LEDs_SetAllLEDs(LEDS_LED3); + LEDs_SetAllLEDs(LEDS_LED4); + LEDs_ToggleLEDs(LEDS_ALL_LEDS); +} + + diff --git a/BuildTests/BoardDriverTest/makefile b/BuildTests/BoardDriverTest/makefile new file mode 100644 index 0000000000..aca8d5109f --- /dev/null +++ b/BuildTests/BoardDriverTest/makefile @@ -0,0 +1,58 @@ +# +# LUFA Library +# Copyright (C) Dean Camera, 2011. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# + +# Makefile for the board driver build test. This +# test attempts to build a dummy project with all +# possible board targets using their respective +# compiler. + +# Path to the root of the LUFA tree to scan +LUFA_ROOT_PATH = ../.. + + +all: begin makeboardlist testboards clean end + +begin: + @echo Executing build test "BoardDriverTest". + @echo + +end: + @echo Build test "BoardDriverTest" complete. + @echo + +makeboardlist: + @grep "BOARD_" $(LUFA_ROOT_PATH)/LUFA/Common/BoardTypes.h | cut -d'#' -f2 | cut -d' ' -f2 | grep "BOARD_" > BoardList.txt + +testboards: + echo "%:" > BuildMakefile + @while read line; \ + do \ + build_cfg=`grep "$$line " BoardDeviceMap.cfg | cut -d'=' -f2-`; \ + \ + build_board=$$line; \ + build_arch=`echo $$build_cfg | cut -d':' -f1 | cut -d' ' -f1`; \ + build_mcu=`echo $$build_cfg | cut -d':' -f2 | cut -d' ' -f2`; \ + \ + if ( test -z "$$build_cfg" ); then \ + echo "No matching information set for board $$line"; \ + else \ + printf "\tmake -f makefile.$$build_arch clean\n" >> BuildMakefile; \ + printf "\tmake -f makefile.$$build_arch MCU=$$build_mcu BOARD=$$build_board\n" >> BuildMakefile; \ + fi; \ + done < BoardList.txt + $(MAKE) -f BuildMakefile all + +clean: + rm -f BuildMakefile + rm -f BoardList.txt + $(MAKE) -f makefile.avr8 clean + $(MAKE) -f makefile.xmega clean + $(MAKE) -f makefile.uc3 clean + +%: + \ No newline at end of file diff --git a/BuildTests/BoardDriverTest/makefile.avr8 b/BuildTests/BoardDriverTest/makefile.avr8 new file mode 100644 index 0000000000..1f0d7596f5 --- /dev/null +++ b/BuildTests/BoardDriverTest/makefile.avr8 @@ -0,0 +1,722 @@ +# Hey Emacs, this is a -*- makefile -*- +#---------------------------------------------------------------------------- +# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al. +# >> Modified for use with the LUFA project. << +# +# Released to the Public Domain +# +# Additional material for this makefile was written by: +# Peter Fleury +# Tim Henigan +# Colin O'Flynn +# Reiner Patommel +# Markus Pfaff +# Sander Pool +# Frederik Rouleau +# Carlos Lamas +# Dean Camera +# Opendous Inc. +# Denver Gingerich +# +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device, using avrdude. +# Please customize the avrdude settings below first! +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make doxygen = Generate DoxyGen documentation for the project (must have +# DoxyGen installed) +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + + +# MCU name +MCU = at90usb1287 + + +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + +# Target board (see library "Board Types" documentation, NONE for projects not requiring +# LUFA board drivers). If USER is selected, put custom board drivers in a directory called +# "Board" inside the application directory. +BOARD = NONE + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + + +# Output format. (can be srec, ihex, binary) +FORMAT = ihex + + +# Target file name (without extension). +TARGET = Test + + +# Object files directory +# To put object files in current directory, use a dot (.), do NOT make +# this an empty or blank macro! +OBJDIR = . + + +# Path to the LUFA library +LUFA_PATH = ../.. + + +# LUFA library compile-time options and predefined tokens +LUFA_OPTS = + + +# Create the LUFA source path variables by including the LUFA root makefile +include $(LUFA_PATH)/LUFA/makefile + + +# List C source files here. (C dependencies are automatically generated.) +SRC = Test.c + + + +# List C++ source files here. (C dependencies are automatically generated.) +CPPSRC = + + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = + + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = s + + +# Debugging format. +# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. +# AVR Studio 4.10 requires dwarf-2. +# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. +DEBUG = dwarf-2 + + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRAINCDIRS = $(LUFA_PATH)/ + + +# Compiler flag to set the C Standard level. +# c89 = "ANSI" C +# gnu89 = c89 plus GCC extensions +# c99 = ISO C99 standard (not yet fully implemented) +# gnu99 = c99 plus GCC extensions +CSTANDARD = -std=c99 + + +# Place -D or -U options here for C sources +CDEFS = -DF_CPU=$(F_CPU)UL +CDEFS += -DF_USB=$(F_USB)UL +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) +CDEFS += $(LUFA_OPTS) + + +# Place -D or -U options here for ASM sources +ADEFS = -DF_CPU=$(F_CPU) +ADEFS += -DF_USB=$(F_USB)UL +ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += $(LUFA_OPTS) + +# Place -D or -U options here for C++ sources +CPPDEFS = -DF_CPU=$(F_CPU)UL +CPPDEFS += -DF_USB=$(F_USB)UL +CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += $(LUFA_OPTS) +#CPPDEFS += -D__STDC_LIMIT_MACROS +#CPPDEFS += -D__STDC_CONSTANT_MACROS + + + +#---------------- Compiler Options C ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CFLAGS = -g$(DEBUG) +CFLAGS += $(CDEFS) +CFLAGS += -O$(OPT) +CFLAGS += -funsigned-char +CFLAGS += -funsigned-bitfields +CFLAGS += -ffunction-sections +CFLAGS += -fno-inline-small-functions +CFLAGS += -fpack-struct +CFLAGS += -fshort-enums +CFLAGS += -fno-strict-aliasing +CFLAGS += -fno-split-wide-types +CFLAGS += -Wall +CFLAGS += -Wstrict-prototypes +#CFLAGS += -mshort-calls +#CFLAGS += -fno-unit-at-a-time +#CFLAGS += -Wundef +#CFLAGS += -Wunreachable-code +#CFLAGS += -Wsign-compare +CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +CFLAGS += $(CSTANDARD) + + +#---------------- Compiler Options C++ ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CPPFLAGS = -g$(DEBUG) +CPPFLAGS += $(CPPDEFS) +CPPFLAGS += -O$(OPT) +CPPFLAGS += -funsigned-char +CPPFLAGS += -funsigned-bitfields +CPPFLAGS += -fpack-struct +CPPFLAGS += -fshort-enums +CPPFLAGS += -fno-exceptions +CPPFLAGS += -Wall +CPPFLAGS += -Wundef +#CPPFLAGS += -mshort-calls +#CPPFLAGS += -fno-unit-at-a-time +#CPPFLAGS += -Wstrict-prototypes +#CPPFLAGS += -Wunreachable-code +#CPPFLAGS += -Wsign-compare +CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) +CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +#CPPFLAGS += $(CSTANDARD) + + +#---------------- Assembler Options ---------------- +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns: create listing +# -gstabs: have the assembler create line number information; note that +# for use in COFF files, additional information about filenames +# and function names needs to be present in the assembler source +# files -- see avr-libc docs [FIXME: not yet described there] +# -listing-cont-lines: Sets the maximum number of continuation lines of hex +# dump that will be displayed for a given single line of source input. +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 + + +#---------------- Library Options ---------------- +# Minimalistic printf version +PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min + +# Floating point printf version (requires MATH_LIB = -lm below) +PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt + +# If this is left blank, then it will use the Standard printf version. +PRINTF_LIB = +#PRINTF_LIB = $(PRINTF_LIB_MIN) +#PRINTF_LIB = $(PRINTF_LIB_FLOAT) + + +# Minimalistic scanf version +SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min + +# Floating point + %[ scanf version (requires MATH_LIB = -lm below) +SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt + +# If this is left blank, then it will use the Standard scanf version. +SCANF_LIB = +#SCANF_LIB = $(SCANF_LIB_MIN) +#SCANF_LIB = $(SCANF_LIB_FLOAT) + + +MATH_LIB = -lm + + +# List any extra directories to look for libraries here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRALIBDIRS = + + + +#---------------- External Memory Options ---------------- + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# used for variables (.data/.bss) and heap (malloc()). +#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# only used for heap (malloc()). +#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff + +EXTMEMOPTS = + + + +#---------------- Linker Options ---------------- +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += -Wl,--relax +LDFLAGS += -Wl,--gc-sections +LDFLAGS += $(EXTMEMOPTS) +LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) +LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) +#LDFLAGS += -T linker_script.x + + + +#---------------- Programming Options (avrdude) ---------------- + +# Programming hardware +# Type: avrdude -c ? +# to get a full listing. +# +AVRDUDE_PROGRAMMER = jtagmkII + +# com1 = serial port. Use lpt1 to connect to parallel port. +AVRDUDE_PORT = usb + +AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex +#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep + + +# Uncomment the following if you want avrdude's erase cycle counter. +# Note that this counter needs to be initialized first using -Yn, +# see avrdude manual. +#AVRDUDE_ERASE_COUNTER = -y + +# Uncomment the following if you do /not/ wish a verification to be +# performed after programming the device. +#AVRDUDE_NO_VERIFY = -V + +# Increase verbosity level. Please use this when submitting bug +# reports about avrdude. See +# to submit bug reports. +#AVRDUDE_VERBOSE = -v -v + +AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) +AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) +AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) + + + +#---------------- Debugging Options ---------------- + +# For simulavr only - target MCU frequency. +DEBUG_MFREQ = $(F_CPU) + +# Set the DEBUG_UI to either gdb or insight. +# DEBUG_UI = gdb +DEBUG_UI = insight + +# Set the debugging back-end to either avarice, simulavr. +DEBUG_BACKEND = avarice +#DEBUG_BACKEND = simulavr + +# GDB Init Filename. +GDBINIT_FILE = __avr_gdbinit + +# When using avarice settings for the JTAG +JTAG_DEV = /dev/com1 + +# Debugging port used to communicate between GDB / avarice / simulavr. +DEBUG_PORT = 4242 + +# Debugging host used to communicate between GDB / avarice / simulavr, normally +# just set to localhost unless doing some sort of crazy debugging when +# avarice is running on a different computer. +DEBUG_HOST = localhost + + + +#============================================================================ + + +# Define programs and commands. +SHELL = sh +CC = avr-gcc +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump +SIZE = avr-size +AR = avr-ar rcs +NM = avr-nm +AVRDUDE = avrdude +REMOVE = rm -f +REMOVEDIR = rm -rf +COPY = cp +WINSHELL = cmd + + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = -------- begin -------- +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_COFF = Converting to AVR COFF: +MSG_EXTENDED_COFF = Converting to AVR Extended COFF: +MSG_FLASH = Creating load file for Flash: +MSG_EEPROM = Creating load file for EEPROM: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling C: +MSG_COMPILING_CPP = Compiling C++: +MSG_ASSEMBLING = Assembling: +MSG_CLEANING = Cleaning project: +MSG_CREATING_LIBRARY = Creating library: + + + + +# Define all object files. +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + +# Define all listing files. +LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + + +# Compiler flags to generate dependency files. +GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d + + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + + + + +# Default target. +all: begin gccversion sizebefore build sizeafter end + +# Change the build target to build a HEX file or a library. +build: elf hex eep lss sym +#build: lib + + +elf: $(TARGET).elf +hex: $(TARGET).hex +eep: $(TARGET).eep +lss: $(TARGET).lss +sym: $(TARGET).sym +LIBNAME=lib$(TARGET).a +lib: $(LIBNAME) + + + +# Eye candy. +# AVR Studio 3.x does not check make's exit code but relies on +# the following magic strings to be generated by the compile job. +begin: + @echo + @echo $(MSG_BEGIN) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf +MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) +FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) + + +sizebefore: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ + 2>/dev/null; echo; fi + +sizeafter: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ + 2>/dev/null; echo; fi + + + +# Display compiler version information. +gccversion : + @$(CC) --version + + +# Program the device. +program: $(TARGET).hex $(TARGET).eep + $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) + +flip: $(TARGET).hex + batchisp -hardware usb -device $(MCU) -operation erase f + batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program + batchisp -hardware usb -device $(MCU) -operation start reset 0 + +dfu: $(TARGET).hex + dfu-programmer $(MCU) erase + dfu-programmer $(MCU) flash $(TARGET).hex + dfu-programmer $(MCU) reset + +flip-ee: $(TARGET).hex $(TARGET).eep + $(COPY) $(TARGET).eep $(TARGET)eep.hex + batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase + batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program + batchisp -hardware usb -device $(MCU) -operation start reset 0 + $(REMOVE) $(TARGET)eep.hex + +dfu-ee: $(TARGET).hex $(TARGET).eep + dfu-programmer $(MCU) eeprom-flash $(TARGET).eep + dfu-programmer $(MCU) reset + + +# Generate avr-gdb config/init file which does the following: +# define the reset signal, load the target file, connect to target, and set +# a breakpoint at main(). +gdb-config: + @$(REMOVE) $(GDBINIT_FILE) + @echo define reset >> $(GDBINIT_FILE) + @echo SIGNAL SIGHUP >> $(GDBINIT_FILE) + @echo end >> $(GDBINIT_FILE) + @echo file $(TARGET).elf >> $(GDBINIT_FILE) + @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE) +ifeq ($(DEBUG_BACKEND),simulavr) + @echo load >> $(GDBINIT_FILE) +endif + @echo break main >> $(GDBINIT_FILE) + +debug: gdb-config $(TARGET).elf +ifeq ($(DEBUG_BACKEND), avarice) + @echo Starting AVaRICE - Press enter when "waiting to connect" message displays. + @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \ + $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT) + @$(WINSHELL) /c pause + +else + @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \ + $(DEBUG_MFREQ) --port $(DEBUG_PORT) +endif + @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE) + + + + +# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +COFFCONVERT = $(OBJCOPY) --debugging +COFFCONVERT += --change-section-address .data-0x800000 +COFFCONVERT += --change-section-address .bss-0x800000 +COFFCONVERT += --change-section-address .noinit-0x800000 +COFFCONVERT += --change-section-address .eeprom-0x810000 + + + +coff: $(TARGET).elf + @echo + @echo $(MSG_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-avr $< $(TARGET).cof + + +extcoff: $(TARGET).elf + @echo + @echo $(MSG_EXTENDED_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof + + + +# Create final output files (.hex, .eep) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@ + +%.eep: %.elf + @echo + @echo $(MSG_EEPROM) $@ + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ + --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0 + +# Create extended listing file from ELF output file. +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S -z $< > $@ + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + + +# Create library from object files. +.SECONDARY : $(TARGET).a +.PRECIOUS : $(OBJ) +%.a: $(OBJ) + @echo + @echo $(MSG_CREATING_LIBRARY) $@ + $(AR) $@ $(OBJ) + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(OBJ) +%.elf: $(OBJ) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +$(OBJDIR)/%.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create object files from C++ source files. +$(OBJDIR)/%.o : %.cpp + @echo + @echo $(MSG_COMPILING_CPP) $< + $(CC) -c $(ALL_CPPFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +%.s : %.c + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C++ source files. +%.s : %.cpp + $(CC) -S $(ALL_CPPFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +$(OBJDIR)/%.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Create preprocessed source for use in sending a bug report. +%.i : %.c + $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ + + +# Target: clean project. +clean: begin clean_list end + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).eep + $(REMOVE) $(TARGET).cof + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lss + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) $(SRC:.c=.i) + $(REMOVEDIR) .dep + +doxygen: + @echo Generating Project Documentation \($(TARGET)\)... + @if ( doxygen Doxygen.conf 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then \ + exit 1; \ + fi; + @echo Documentation Generation Complete. + +clean_doxygen: + rm -rf Documentation + +checksource: + @for f in $(SRC) $(CPPSRC) $(ASRC); do \ + if [ -f $$f ]; then \ + echo "Found Source File: $$f" ; \ + else \ + echo "Source File Not Found: $$f" ; \ + fi; done + + +# Create object files directory +$(shell mkdir $(OBJDIR) 2>/dev/null) + + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff doxygen clean \ +clean_list clean_doxygen program dfu flip flip-ee dfu-ee \ +debug gdb-config checksource diff --git a/BuildTests/BoardDriverTest/makefile.uc3 b/BuildTests/BoardDriverTest/makefile.uc3 new file mode 100644 index 0000000000..7e75b5479d --- /dev/null +++ b/BuildTests/BoardDriverTest/makefile.uc3 @@ -0,0 +1,485 @@ +# Hey Emacs, this is a -*- makefile -*- +#---------------------------------------------------------------------------- +# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al. +# >> Modified for use with the LUFA project. << +# +# Released to the Public Domain +# +# Additional material for this makefile was written by: +# Peter Fleury +# Tim Henigan +# Colin O'Flynn +# Reiner Patommel +# Markus Pfaff +# Sander Pool +# Frederik Rouleau +# Carlos Lamas +# Dean Camera +# Opendous Inc. +# Denver Gingerich +# +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make doxygen = Generate DoxyGen documentation for the project (must have +# DoxyGen installed) +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + + +# MCU name +MCU = uc3a3256 + + +# Targeted chip architecture (see library "Architectures" documentation) +ARCH = UC3 + + +# Target board (see library "Board Types" documentation, NONE for projects not requiring +# LUFA board drivers). If USER is selected, put custom board drivers in a directory called +# "Board" inside the application directory. +BOARD = NONE + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This should be the frequency the system core runs at, after the system clock +# has been set up correctly and started. +F_CPU = 12000000 + + +# USB controller master clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency of the USB controller's clock generator in Hz. +# +# For the UC3 chips, this should be equal to 48MHz or 96MHz. +F_USB = 48000000 + + +# Output format. (can be srec, ihex, binary) +FORMAT = ihex + + +# Target file name (without extension). +TARGET = Test + + +# Object files directory +# To put object files in current directory, use a dot (.), do NOT make +# this an empty or blank macro! +OBJDIR = . + + +# Path to the LUFA library +LUFA_PATH = ../.. + + +# LUFA library compile-time options and predefined tokens (add '-D' before each token) +LUFA_OPTS = + + +# Create the LUFA source path variables by including the LUFA root makefile +include $(LUFA_PATH)/LUFA/makefile + + +# List C source files here. (C dependencies are automatically generated.) +SRC = Test.c + + +# List C++ source files here. (C dependencies are automatically generated.) +CPPSRC = + + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = + + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = s + + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRAINCDIRS = $(LUFA_PATH)/ + + +# Compiler flag to set the C Standard level. +# c89 = "ANSI" C +# gnu89 = c89 plus GCC extensions +# c99 = ISO C99 standard (not yet fully implemented) +# gnu99 = c99 plus GCC extensions +CSTANDARD = -std=gnu99 + + +# Place -D or -U options here for C sources +CDEFS = -DF_CPU=$(F_CPU)UL +CDEFS += -DF_USB=$(F_USB)UL +CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DARCH=ARCH_$(ARCH) +CDEFS += $(LUFA_OPTS) + + +# Place -D or -U options here for ASM sources +ADEFS = -DF_CPU=$(F_CPU) +ADEFS += -DF_USB=$(F_USB)UL +ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DARCH=ARCH_$(ARCH) +ADEFS += $(LUFA_OPTS) + +# Place -D or -U options here for C++ sources +CPPDEFS = -DF_CPU=$(F_CPU)UL +CPPDEFS += -DF_USB=$(F_USB)UL +CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DARCH=ARCH_$(ARCH) +CPPDEFS += $(LUFA_OPTS) + + +# Debugging level. +DEBUG = 3 + + +#---------------- Compiler Options C ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CFLAGS = -g$(DEBUG) +CFLAGS += $(CDEFS) +CFLAGS += -O$(OPT) +CFLAGS += -funsigned-char +CFLAGS += -funsigned-bitfields +CFLAGS += -ffunction-sections +CFLAGS += -fno-strict-aliasing +CFLAGS += -Wall +CFLAGS += -Wstrict-prototypes +CFLAGS += -masm-addr-pseudos +CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +CFLAGS += $(CSTANDARD) + + +#---------------- Compiler Options C++ ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CPPFLAGS = -g$(DEBUG) +CPPFLAGS += $(CPPDEFS) +CPPFLAGS += -O$(OPT) +CPPFLAGS += -funsigned-char +CPPFLAGS += -funsigned-bitfields +CPPFLAGS += -ffunction-sections +CPPFLAGS += -fno-strict-aliasing +CPPFLAGS += -fno-exceptions +CPPFLAGS += -masm-addr-pseudos +CPPFLAGS += -Wall +CPPFLAGS += -Wundef +CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) +CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +#CPPFLAGS += $(CSTANDARD) + + +#---------------- Assembler Options ---------------- +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns: create listing +# -gstabs: have the assembler create line number information; note that +# for use in COFF files, additional information about filenames +# and function names needs to be present in the assembler source +# files -- see avr-libc docs [FIXME: not yet described there] +# -listing-cont-lines: Sets the maximum number of continuation lines of hex +# dump that will be displayed for a given single line of source input. +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 + + +#---------------- Linker Options ---------------- +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += -Wl,--gc-sections --rodata-writable +LDFLAGS += -Wl,--direct-data +#LDFLAGS += -T linker_script.x + + +#============================================================================ + + +# Define programs and commands. +SHELL = sh +CC = avr32-gcc +OBJCOPY = avr32-objcopy +OBJDUMP = avr32-objdump +SIZE = avr32-size +AR = avr32-ar rcs +NM = avr32-nm +REMOVE = rm -f +REMOVEDIR = rm -rf +COPY = cp +WINSHELL = cmd + + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = -------- begin -------- +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_COFF = Converting to AVR COFF: +MSG_FLASH = Creating load file for Flash: +MSG_EEPROM = Creating load file for EEPROM: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling C: +MSG_COMPILING_CPP = Compiling C++: +MSG_ASSEMBLING = Assembling: +MSG_CLEANING = Cleaning project: +MSG_CREATING_LIBRARY = Creating library: + + + + +# Define all object files. +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + +# Define all listing files. +LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + + +# Compiler flags to generate dependency files. +GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d + + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mpart=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_CPPFLAGS = -mpart=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mpart=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + + + + +# Default target. +all: begin gccversion sizebefore build sizeafter end + +# Change the build target to build a HEX file or a library. +build: elf hex lss sym +#build: lib + + +elf: $(TARGET).elf +hex: $(TARGET).hex +lss: $(TARGET).lss +sym: $(TARGET).sym +LIBNAME=lib$(TARGET).a +lib: $(LIBNAME) + + + +# Eye candy. +# AVR Studio 3.x does not check make's exit code but relies on +# the following magic strings to be generated by the compile job. +begin: + @echo + @echo $(MSG_BEGIN) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf +MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) +FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) + + +sizebefore: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ + 2>/dev/null; echo; fi + +sizeafter: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ + 2>/dev/null; echo; fi + + + +# Display compiler version information. +gccversion : + @$(CC) --version + + +# Program the device. +flip: $(TARGET).hex + batchisp -hardware usb -device $(MCU) -operation erase f + batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program + batchisp -hardware usb -device $(MCU) -operation start reset 0 + +dfu: $(TARGET).hex + dfu-programmer $(MCU) erase + dfu-programmer $(MCU) flash $(TARGET).hex + dfu-programmer $(MCU) reset + + +# Create final output files (.hex, .eep) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@ + +# Create extended listing file from ELF output file. +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S -z $< > $@ + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + + +# Create library from object files. +.SECONDARY : $(TARGET).a +.PRECIOUS : $(OBJ) +%.a: $(OBJ) + @echo + @echo $(MSG_CREATING_LIBRARY) $@ + $(AR) $@ $(OBJ) + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(OBJ) +%.elf: $(OBJ) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +$(OBJDIR)/%.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create object files from C++ source files. +$(OBJDIR)/%.o : %.cpp + @echo + @echo $(MSG_COMPILING_CPP) $< + $(CC) -c $(ALL_CPPFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +%.s : %.c + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C++ source files. +%.s : %.cpp + $(CC) -S $(ALL_CPPFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +$(OBJDIR)/%.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Create preprocessed source for use in sending a bug report. +%.i : %.c + $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ + + +# Target: clean project. +clean: begin clean_list end + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).cof + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lss + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) $(SRC:.c=.i) + $(REMOVEDIR) .dep + +doxygen: + @echo Generating Project Documentation \($(TARGET)\)... + @if ( doxygen Doxygen.conf 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then \ + exit 1; \ + fi; + @echo Documentation Generation Complete. + +clean_doxygen: + rm -rf Documentation + +checksource: + @for f in $(SRC) $(CPPSRC) $(ASRC); do \ + if [ -f $$f ]; then \ + echo "Found Source File: $$f" ; \ + else \ + echo "Source File Not Found: $$f" ; \ + fi; done + + +# Create object files directory +$(shell mkdir $(OBJDIR) 2>/dev/null) + + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex lss sym doxygen clean clean_list clean_doxygen \ +dfu flip checksource + diff --git a/BuildTests/BoardDriverTest/makefile.xmega b/BuildTests/BoardDriverTest/makefile.xmega new file mode 100644 index 0000000000..5a048b8e39 --- /dev/null +++ b/BuildTests/BoardDriverTest/makefile.xmega @@ -0,0 +1,704 @@ +# Hey Emacs, this is a -*- makefile -*- +#---------------------------------------------------------------------------- +# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al. +# >> Modified for use with the LUFA project. << +# +# Released to the Public Domain +# +# Additional material for this makefile was written by: +# Peter Fleury +# Tim Henigan +# Colin O'Flynn +# Reiner Patommel +# Markus Pfaff +# Sander Pool +# Frederik Rouleau +# Carlos Lamas +# Dean Camera +# Opendous Inc. +# Denver Gingerich +# +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device, using avrdude. +# Please customize the avrdude settings below first! +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make doxygen = Generate DoxyGen documentation for the project (must have +# DoxyGen installed) +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + + +# MCU name +MCU = atxmega128a1u + + +# Targeted chip architecture (see library "Architectures" documentation) +ARCH = XMEGA + + +# Target board (see library "Board Types" documentation, NONE for projects not requiring +# LUFA board drivers). If USER is selected, put custom board drivers in a directory called +# "Board" inside the application directory. +BOARD = NONE + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This should be the frequency the system core runs at, after the system clock +# has been set up correctly and started. +F_CPU = 24000000 + + +# USB controller master clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency of the USB controller's clock generator in Hz. +# +# For the XMEGA chips, this should be equal to a multiple of 6MHz for Low +# Speed USB mode, or a multiple of 48MHz for Full Speed USB mode. +F_USB = 48000000 + + +# Output format. (can be srec, ihex, binary) +FORMAT = ihex + + +# Target file name (without extension). +TARGET = Test + + +# Object files directory +# To put object files in current directory, use a dot (.), do NOT make +# this an empty or blank macro! +OBJDIR = . + + +# Path to the LUFA library +LUFA_PATH = ../.. + + +# LUFA library compile-time options and predefined tokens +LUFA_OPTS = + + +# Create the LUFA source path variables by including the LUFA root makefile +include $(LUFA_PATH)/LUFA/makefile + + +# List C source files here. (C dependencies are automatically generated.) +SRC = Test.c + + +# List C++ source files here. (C dependencies are automatically generated.) +CPPSRC = + + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = + + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = s + + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRAINCDIRS = $(LUFA_PATH)/ + + +# Compiler flag to set the C Standard level. +# c89 = "ANSI" C +# gnu89 = c89 plus GCC extensions +# c99 = ISO C99 standard (not yet fully implemented) +# gnu99 = c99 plus GCC extensions +CSTANDARD = -std=gnu99 + + +# Place -D or -U options here for C sources +CDEFS = -DF_CPU=$(F_CPU)UL +CDEFS += -DF_USB=$(F_USB)UL +CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DARCH=ARCH_$(ARCH) +CDEFS += $(LUFA_OPTS) + + +# Place -D or -U options here for ASM sources +ADEFS = -DF_CPU=$(F_CPU) +ADEFS += -DF_USB=$(F_USB)UL +ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DARCH=ARCH_$(ARCH) +ADEFS += $(LUFA_OPTS) + +# Place -D or -U options here for C++ sources +CPPDEFS = -DF_CPU=$(F_CPU)UL +CPPDEFS += -DF_USB=$(F_USB)UL +CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DARCH=ARCH_$(ARCH) +CPPDEFS += $(LUFA_OPTS) + + +# Debugging format. +# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. +# AVR Studio 4.10 requires dwarf-2. +# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. +DEBUG = dwarf-2 + + +#---------------- Compiler Options C ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CFLAGS = -g$(DEBUG) +CFLAGS += $(CDEFS) +CFLAGS += -O$(OPT) +CFLAGS += -funsigned-char +CFLAGS += -funsigned-bitfields +CFLAGS += -ffunction-sections +CFLAGS += -fno-inline-small-functions +CFLAGS += -fpack-struct +CFLAGS += -fshort-enums +CFLAGS += -fno-strict-aliasing +CFLAGS += -Wall +CFLAGS += -Wstrict-prototypes +CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +CFLAGS += $(CSTANDARD) + + +#---------------- Compiler Options C++ ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CPPFLAGS = -g$(DEBUG) +CPPFLAGS += $(CPPDEFS) +CPPFLAGS += -O$(OPT) +CPPFLAGS += -funsigned-char +CPPFLAGS += -funsigned-bitfields +CPPFLAGS += -fpack-struct +CPPFLAGS += -fshort-enums +CPPFLAGS += -ffunction-sections +CPPFLAGS += -fno-strict-aliasing +CPPFLAGS += -fno-exceptions +CPPFLAGS += -Wall +CPPFLAGS += -Wundef +CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) +CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +#CPPFLAGS += $(CSTANDARD) + + +#---------------- Assembler Options ---------------- +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns: create listing +# -gstabs: have the assembler create line number information; note that +# for use in COFF files, additional information about filenames +# and function names needs to be present in the assembler source +# files -- see avr-libc docs [FIXME: not yet described there] +# -listing-cont-lines: Sets the maximum number of continuation lines of hex +# dump that will be displayed for a given single line of source input. +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 + + +#---------------- Library Options ---------------- +# Minimalistic printf version +PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min + +# Floating point printf version (requires MATH_LIB = -lm below) +PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt + +# If this is left blank, then it will use the Standard printf version. +PRINTF_LIB = +#PRINTF_LIB = $(PRINTF_LIB_MIN) +#PRINTF_LIB = $(PRINTF_LIB_FLOAT) + + +# Minimalistic scanf version +SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min + +# Floating point + %[ scanf version (requires MATH_LIB = -lm below) +SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt + +# If this is left blank, then it will use the Standard scanf version. +SCANF_LIB = +#SCANF_LIB = $(SCANF_LIB_MIN) +#SCANF_LIB = $(SCANF_LIB_FLOAT) + + +MATH_LIB = -lm + + +# List any extra directories to look for libraries here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRALIBDIRS = + + + +#---------------- External Memory Options ---------------- + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# used for variables (.data/.bss) and heap (malloc()). +#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# only used for heap (malloc()). +#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff + +EXTMEMOPTS = + + + +#---------------- Linker Options ---------------- +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += -Wl,--relax +LDFLAGS += -Wl,--gc-sections +LDFLAGS += $(EXTMEMOPTS) +LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) +LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) +#LDFLAGS += -T linker_script.x + + + +#---------------- Programming Options (avrdude) ---------------- + +# Programming hardware +# Type: avrdude -c ? +# to get a full listing. +# +AVRDUDE_PROGRAMMER = jtagmkII + +# com1 = serial port. Use lpt1 to connect to parallel port. +AVRDUDE_PORT = usb + +AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex +#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep + + +# Uncomment the following if you want avrdude's erase cycle counter. +# Note that this counter needs to be initialized first using -Yn, +# see avrdude manual. +#AVRDUDE_ERASE_COUNTER = -y + +# Uncomment the following if you do /not/ wish a verification to be +# performed after programming the device. +#AVRDUDE_NO_VERIFY = -V + +# Increase verbosity level. Please use this when submitting bug +# reports about avrdude. See +# to submit bug reports. +#AVRDUDE_VERBOSE = -v -v + +AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) +AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) +AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) + + + +#---------------- Debugging Options ---------------- + +# For simulavr only - target MCU frequency. +DEBUG_MFREQ = $(F_CPU) + +# Set the DEBUG_UI to either gdb or insight. +# DEBUG_UI = gdb +DEBUG_UI = insight + +# Set the debugging back-end to either avarice, simulavr. +DEBUG_BACKEND = avarice +#DEBUG_BACKEND = simulavr + +# GDB Init Filename. +GDBINIT_FILE = __avr_gdbinit + +# When using avarice settings for the JTAG +JTAG_DEV = /dev/com1 + +# Debugging port used to communicate between GDB / avarice / simulavr. +DEBUG_PORT = 4242 + +# Debugging host used to communicate between GDB / avarice / simulavr, normally +# just set to localhost unless doing some sort of crazy debugging when +# avarice is running on a different computer. +DEBUG_HOST = localhost + + + +#============================================================================ + + +# Define programs and commands. +SHELL = sh +CC = avr-gcc +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump +SIZE = avr-size +AR = avr-ar rcs +NM = avr-nm +AVRDUDE = avrdude +REMOVE = rm -f +REMOVEDIR = rm -rf +COPY = cp +WINSHELL = cmd + + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = -------- begin -------- +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_COFF = Converting to AVR COFF: +MSG_EXTENDED_COFF = Converting to AVR Extended COFF: +MSG_FLASH = Creating load file for Flash: +MSG_EEPROM = Creating load file for EEPROM: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling C: +MSG_COMPILING_CPP = Compiling C++: +MSG_ASSEMBLING = Assembling: +MSG_CLEANING = Cleaning project: +MSG_CREATING_LIBRARY = Creating library: + + + + +# Define all object files. +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + +# Define all listing files. +LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + + +# Compiler flags to generate dependency files. +GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d + + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + + + + +# Default target. +all: begin gccversion sizebefore build sizeafter end + +# Change the build target to build a HEX file or a library. +build: elf hex eep lss sym +#build: lib + + +elf: $(TARGET).elf +hex: $(TARGET).hex +eep: $(TARGET).eep +lss: $(TARGET).lss +sym: $(TARGET).sym +LIBNAME=lib$(TARGET).a +lib: $(LIBNAME) + + + +# Eye candy. +# AVR Studio 3.x does not check make's exit code but relies on +# the following magic strings to be generated by the compile job. +begin: + @echo + @echo $(MSG_BEGIN) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf +MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) +FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) + + +sizebefore: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ + 2>/dev/null; echo; fi + +sizeafter: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ + 2>/dev/null; echo; fi + + + +# Display compiler version information. +gccversion : + @$(CC) --version + + +# Program the device. +program: $(TARGET).hex $(TARGET).eep + $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) + +flip: $(TARGET).hex + batchisp -hardware usb -device $(MCU) -operation erase f + batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program + batchisp -hardware usb -device $(MCU) -operation start reset 0 + +dfu: $(TARGET).hex + dfu-programmer $(MCU) erase + dfu-programmer $(MCU) flash $(TARGET).hex + dfu-programmer $(MCU) reset + +flip-ee: $(TARGET).hex $(TARGET).eep + $(COPY) $(TARGET).eep $(TARGET)eep.hex + batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase + batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program + batchisp -hardware usb -device $(MCU) -operation start reset 0 + $(REMOVE) $(TARGET)eep.hex + +dfu-ee: $(TARGET).hex $(TARGET).eep + dfu-programmer $(MCU) eeprom-flash $(TARGET).eep + dfu-programmer $(MCU) reset + + +# Generate avr-gdb config/init file which does the following: +# define the reset signal, load the target file, connect to target, and set +# a breakpoint at main(). +gdb-config: + @$(REMOVE) $(GDBINIT_FILE) + @echo define reset >> $(GDBINIT_FILE) + @echo SIGNAL SIGHUP >> $(GDBINIT_FILE) + @echo end >> $(GDBINIT_FILE) + @echo file $(TARGET).elf >> $(GDBINIT_FILE) + @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE) +ifeq ($(DEBUG_BACKEND),simulavr) + @echo load >> $(GDBINIT_FILE) +endif + @echo break main >> $(GDBINIT_FILE) + +debug: gdb-config $(TARGET).elf +ifeq ($(DEBUG_BACKEND), avarice) + @echo Starting AVaRICE - Press enter when "waiting to connect" message displays. + @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \ + $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT) + @$(WINSHELL) /c pause + +else + @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \ + $(DEBUG_MFREQ) --port $(DEBUG_PORT) +endif + @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE) + + + + +# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +COFFCONVERT = $(OBJCOPY) --debugging +COFFCONVERT += --change-section-address .data-0x800000 +COFFCONVERT += --change-section-address .bss-0x800000 +COFFCONVERT += --change-section-address .noinit-0x800000 +COFFCONVERT += --change-section-address .eeprom-0x810000 + + + +coff: $(TARGET).elf + @echo + @echo $(MSG_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-avr $< $(TARGET).cof + + +extcoff: $(TARGET).elf + @echo + @echo $(MSG_EXTENDED_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof + + + +# Create final output files (.hex, .eep) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@ + +%.eep: %.elf + @echo + @echo $(MSG_EEPROM) $@ + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ + --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0 + +# Create extended listing file from ELF output file. +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S -z $< > $@ + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + + +# Create library from object files. +.SECONDARY : $(TARGET).a +.PRECIOUS : $(OBJ) +%.a: $(OBJ) + @echo + @echo $(MSG_CREATING_LIBRARY) $@ + $(AR) $@ $(OBJ) + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(OBJ) +%.elf: $(OBJ) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +$(OBJDIR)/%.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create object files from C++ source files. +$(OBJDIR)/%.o : %.cpp + @echo + @echo $(MSG_COMPILING_CPP) $< + $(CC) -c $(ALL_CPPFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +%.s : %.c + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C++ source files. +%.s : %.cpp + $(CC) -S $(ALL_CPPFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +$(OBJDIR)/%.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Create preprocessed source for use in sending a bug report. +%.i : %.c + $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ + + +# Target: clean project. +clean: begin clean_list end + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).eep + $(REMOVE) $(TARGET).cof + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lss + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) $(SRC:.c=.i) + $(REMOVEDIR) .dep + +doxygen: + @echo Generating Project Documentation \($(TARGET)\)... + @if ( doxygen Doxygen.conf 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then \ + exit 1; \ + fi; + @echo Documentation Generation Complete. + +clean_doxygen: + rm -rf Documentation + +checksource: + @for f in $(SRC) $(CPPSRC) $(ASRC); do \ + if [ -f $$f ]; then \ + echo "Found Source File: $$f" ; \ + else \ + echo "Source File Not Found: $$f" ; \ + fi; done + + +# Create object files directory +$(shell mkdir $(OBJDIR) 2>/dev/null) + + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff doxygen clean \ +clean_list clean_doxygen program dfu flip flip-ee dfu-ee \ +debug gdb-config checksource diff --git a/BuildTests/makefile b/BuildTests/makefile index e296436139..dfa4f8d4bd 100644 --- a/BuildTests/makefile +++ b/BuildTests/makefile @@ -14,8 +14,10 @@ all: $(MAKE) -C ModuleTest all $(MAKE) -C SingleUSBModeTest all $(MAKE) -C StaticAnalysisTest all + $(MAKE) -C BoardDriverTest all %: $(MAKE) -C ModuleTest $@ $(MAKE) -C SingleUSBModeTest $@ $(MAKE) -C StaticAnalysisTest $@ + $(MAKE) -C BoardDriverTest $@ diff --git a/LUFA.pnproj b/LUFA.pnproj index 3ba9430065..d410a46070 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 2afa02686643b1b19341c99816715cac1d88abb9 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 6 May 2012 15:01:40 +0000 Subject: [PATCH 32/37] Complete BoardDriverTest build test. --- BuildTests/BoardDriverTest/BoardDeviceMap.cfg | 50 ++++++++++++++++++- BuildTests/BoardDriverTest/Test.c | 39 +++++++++++++-- BuildTests/BoardDriverTest/makefile | 12 +++-- 3 files changed, 89 insertions(+), 12 deletions(-) diff --git a/BuildTests/BoardDriverTest/BoardDeviceMap.cfg b/BuildTests/BoardDriverTest/BoardDeviceMap.cfg index 15a5f451ad..8d0854905f 100644 --- a/BuildTests/BoardDriverTest/BoardDeviceMap.cfg +++ b/BuildTests/BoardDriverTest/BoardDeviceMap.cfg @@ -1,3 +1,49 @@ # BOARD DEFINE = {ARCH} : {MCU} -BOARD_USER = avr8 : at90usb1287 -BOARD_USBKEY = avr8 : at90usb1287 \ No newline at end of file +BOARD_USBKEY = avr8 : at90usb1287 +BOARD_STK525 = avr8 : at90usb647 +BOARD_STK526 = avr8 : at90usb162 +BOARD_RZUSBSTICK = avr8 : at90usb1287 +BOARD_ATAVRUSBRF01 = avr8 : at90usb1287 +BOARD_BUMBLEB = avr8 : at90usb162 +BOARD_XPLAIN = avr8 : at90usb1287 +BOARD_XPLAIN_REV1 = avr8 : at90usb1287 +BOARD_EVK527 = avr8 : atmega32u4 +BOARD_TEENSY = avr8 : at90usb162 +BOARD_USBTINYMKII = avr8 : at90usb162 +BOARD_BENITO = avr8 : at90usb162 +BOARD_JMDBU2 = avr8 : atmega32u2 +BOARD_OLIMEX162 = avr8 : at90usb162 +BOARD_UDIP = avr8 : atmega32u2 +BOARD_BUI = avr8 : at90usb646 +BOARD_UNO = avr8 : atmega8u2 +BOARD_CULV3 = avr8 : atmega32u4 +BOARD_BLACKCAT = avr8 : at90usb162 +BOARD_MAXIMUS = avr8 : at90usb162 +BOARD_MINIMUS = avr8 : atmega32u2 +BOARD_ADAFRUITU4 = avr8 : atmega32u4 +BOARD_MICROSIN162 = avr8 : atmega162 +BOARD_USBFOO = avr8 : atmega162 +BOARD_SPARKFUN8U2 = avr8 : atmega8u2 +BOARD_EVK1101 = uc3 : uc3b0256 +BOARD_TUL = avr8 : atmega32u4 +BOARD_EVK1100 = uc3 : uc3a0512 +BOARD_EVK1104 = uc3 : uc3a3256 +BOARD_A3BU_XPLAINED = xmega : atxmega256a3bu +BOARD_TEENSY2 = avr8 : at90usb646 +BOARD_USB2AX = avr8 : atmega32u4 +BOARD_USB2AX_V3 = avr8 : atmega32u4 +BOARD_MICROPENDOUS_32U2 = avr8 : atmega32u2 +BOARD_MICROPENDOUS_A = avr8 : at90usb1287 +BOARD_MICROPENDOUS_1 = avr8 : at90usb162 +BOARD_MICROPENDOUS_2 = avr8 : atmega32u4 +BOARD_MICROPENDOUS_3 = avr8 : at90usb1287 +BOARD_MICROPENDOUS_4 = avr8 : at90usb1287 +BOARD_MICROPENDOUS_DIP = avr8 : at90usb1287 +BOARD_MICROPENDOUS_REV1 = avr8 : at90usb1287 +BOARD_MICROPENDOUS_REV2 = avr8 : at90usb1287 +BOARD_B1_XPLAINED = xmega : atxmega128b1 +BOARD_MULTIO = avr8 : at90usb162 +BOARD_BIGMULTIO = avr8 : atmega32u4 +BOARD_DUCE = avr8 : atmega32u2 +BOARD_OLIMEX32U4 = avr8 : atmega32u4 +BOARD_OLIMEXT32U4 = avr8 : atmega32u4 \ No newline at end of file diff --git a/BuildTests/BoardDriverTest/Test.c b/BuildTests/BoardDriverTest/Test.c index 796dd84b5c..2d908cb663 100644 --- a/BuildTests/BoardDriverTest/Test.c +++ b/BuildTests/BoardDriverTest/Test.c @@ -36,13 +36,42 @@ int main(void) { + uint_reg_t Dummy; + + /* Buttons Compile Check */ + Buttons_Init(); + Dummy = Buttons_GetStatus(); + Buttons_Disable(); + + /* Dataflash Compile Check */ + Dataflash_Init(); + Dataflash_TransferByte(0); + Dataflash_SendByte(0); + Dummy = Dataflash_ReceiveByte(); + Dummy = Dataflash_GetSelectedChip(); + Dataflash_SelectChip(0); + Dataflash_DeselectChip(); + Dataflash_SelectChipFromPage(0); + Dataflash_ToggleSelectedChipCS(); + Dataflash_WaitWhileBusy(); + Dataflash_SendAddressBytes(0, 0); + + /* LEDs Compile Check */ + LEDs_Init(); + LEDs_TurnOnLEDs(LEDS_ALL_LEDS); + LEDs_TurnOffLEDs(LEDS_ALL_LEDS); LEDs_SetAllLEDs(LEDS_ALL_LEDS); - LEDs_SetAllLEDs(LEDS_NO_LEDS); - LEDs_SetAllLEDs(LEDS_LED1); - LEDs_SetAllLEDs(LEDS_LED2); - LEDs_SetAllLEDs(LEDS_LED3); - LEDs_SetAllLEDs(LEDS_LED4); + LEDs_ChangeLEDs(LEDS_ALL_LEDS, LEDS_NO_LEDS); LEDs_ToggleLEDs(LEDS_ALL_LEDS); + Dummy = LEDs_GetLEDs(); + LEDs_Disable(); + + /* Joystick Compile Check */ + Joystick_Init(); + Dummy = Joystick_GetStatus(); + Joystick_Disable(); + + (void)Dummy; } diff --git a/BuildTests/BoardDriverTest/makefile b/BuildTests/BoardDriverTest/makefile index aca8d5109f..e0e784ddd8 100644 --- a/BuildTests/BoardDriverTest/makefile +++ b/BuildTests/BoardDriverTest/makefile @@ -29,7 +29,7 @@ makeboardlist: @grep "BOARD_" $(LUFA_ROOT_PATH)/LUFA/Common/BoardTypes.h | cut -d'#' -f2 | cut -d' ' -f2 | grep "BOARD_" > BoardList.txt testboards: - echo "%:" > BuildMakefile + echo "buildtest:" > BuildMakefile @while read line; \ do \ build_cfg=`grep "$$line " BoardDeviceMap.cfg | cut -d'=' -f2-`; \ @@ -39,13 +39,15 @@ testboards: build_mcu=`echo $$build_cfg | cut -d':' -f2 | cut -d' ' -f2`; \ \ if ( test -z "$$build_cfg" ); then \ - echo "No matching information set for board $$line"; \ + echo "No matching information set for board $$build_board"; \ else \ - printf "\tmake -f makefile.$$build_arch clean\n" >> BuildMakefile; \ - printf "\tmake -f makefile.$$build_arch MCU=$$build_mcu BOARD=$$build_board\n" >> BuildMakefile; \ + echo "Found board configuration for $$build_board ($$build_arch, $$build_mcu)"; \ + printf "\t@echo Building dummy project for $$build_board...\n" >> BuildMakefile; \ + printf "\tmake -s -f makefile.$$build_arch clean\n" >> BuildMakefile; \ + printf "\tmake -s -f makefile.$$build_arch MCU=$$build_mcu BOARD=$$build_board\n\n" >> BuildMakefile; \ fi; \ done < BoardList.txt - $(MAKE) -f BuildMakefile all + $(MAKE) -f BuildMakefile buildtest clean: rm -f BuildMakefile From f0af2e4a0280c43af3200909f6a00c2afaa65364 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 6 May 2012 16:02:45 +0000 Subject: [PATCH 33/37] Improve BoardDriverTest build test so that it will work regardless of native line endings. --- BuildTests/BoardDriverTest/BoardDeviceMap.cfg | 98 +++++++++---------- BuildTests/BoardDriverTest/makefile | 13 +-- 2 files changed, 56 insertions(+), 55 deletions(-) diff --git a/BuildTests/BoardDriverTest/BoardDeviceMap.cfg b/BuildTests/BoardDriverTest/BoardDeviceMap.cfg index 8d0854905f..27eaae9f46 100644 --- a/BuildTests/BoardDriverTest/BoardDeviceMap.cfg +++ b/BuildTests/BoardDriverTest/BoardDeviceMap.cfg @@ -1,49 +1,49 @@ -# BOARD DEFINE = {ARCH} : {MCU} -BOARD_USBKEY = avr8 : at90usb1287 -BOARD_STK525 = avr8 : at90usb647 -BOARD_STK526 = avr8 : at90usb162 -BOARD_RZUSBSTICK = avr8 : at90usb1287 -BOARD_ATAVRUSBRF01 = avr8 : at90usb1287 -BOARD_BUMBLEB = avr8 : at90usb162 -BOARD_XPLAIN = avr8 : at90usb1287 -BOARD_XPLAIN_REV1 = avr8 : at90usb1287 -BOARD_EVK527 = avr8 : atmega32u4 -BOARD_TEENSY = avr8 : at90usb162 -BOARD_USBTINYMKII = avr8 : at90usb162 -BOARD_BENITO = avr8 : at90usb162 -BOARD_JMDBU2 = avr8 : atmega32u2 -BOARD_OLIMEX162 = avr8 : at90usb162 -BOARD_UDIP = avr8 : atmega32u2 -BOARD_BUI = avr8 : at90usb646 -BOARD_UNO = avr8 : atmega8u2 -BOARD_CULV3 = avr8 : atmega32u4 -BOARD_BLACKCAT = avr8 : at90usb162 -BOARD_MAXIMUS = avr8 : at90usb162 -BOARD_MINIMUS = avr8 : atmega32u2 -BOARD_ADAFRUITU4 = avr8 : atmega32u4 -BOARD_MICROSIN162 = avr8 : atmega162 -BOARD_USBFOO = avr8 : atmega162 -BOARD_SPARKFUN8U2 = avr8 : atmega8u2 -BOARD_EVK1101 = uc3 : uc3b0256 -BOARD_TUL = avr8 : atmega32u4 -BOARD_EVK1100 = uc3 : uc3a0512 -BOARD_EVK1104 = uc3 : uc3a3256 -BOARD_A3BU_XPLAINED = xmega : atxmega256a3bu -BOARD_TEENSY2 = avr8 : at90usb646 -BOARD_USB2AX = avr8 : atmega32u4 -BOARD_USB2AX_V3 = avr8 : atmega32u4 -BOARD_MICROPENDOUS_32U2 = avr8 : atmega32u2 -BOARD_MICROPENDOUS_A = avr8 : at90usb1287 -BOARD_MICROPENDOUS_1 = avr8 : at90usb162 -BOARD_MICROPENDOUS_2 = avr8 : atmega32u4 -BOARD_MICROPENDOUS_3 = avr8 : at90usb1287 -BOARD_MICROPENDOUS_4 = avr8 : at90usb1287 -BOARD_MICROPENDOUS_DIP = avr8 : at90usb1287 -BOARD_MICROPENDOUS_REV1 = avr8 : at90usb1287 -BOARD_MICROPENDOUS_REV2 = avr8 : at90usb1287 -BOARD_B1_XPLAINED = xmega : atxmega128b1 -BOARD_MULTIO = avr8 : at90usb162 -BOARD_BIGMULTIO = avr8 : atmega32u4 -BOARD_DUCE = avr8 : atmega32u2 -BOARD_OLIMEX32U4 = avr8 : atmega32u4 -BOARD_OLIMEXT32U4 = avr8 : atmega32u4 \ No newline at end of file +# BOARD DEFINE = {ARCH} : {MCU} : +BOARD_USBKEY = avr8 : at90usb1287 : +BOARD_STK525 = avr8 : at90usb647 : +BOARD_STK526 = avr8 : at90usb162 : +BOARD_RZUSBSTICK = avr8 : at90usb1287 : +BOARD_ATAVRUSBRF01 = avr8 : at90usb1287 : +BOARD_BUMBLEB = avr8 : at90usb162 : +BOARD_XPLAIN = avr8 : at90usb1287 : +BOARD_XPLAIN_REV1 = avr8 : at90usb1287 : +BOARD_EVK527 = avr8 : atmega32u4 : +BOARD_TEENSY = avr8 : at90usb162 : +BOARD_USBTINYMKII = avr8 : at90usb162 : +BOARD_BENITO = avr8 : at90usb162 : +BOARD_JMDBU2 = avr8 : atmega32u2 : +BOARD_OLIMEX162 = avr8 : at90usb162 : +BOARD_UDIP = avr8 : atmega32u2 : +BOARD_BUI = avr8 : at90usb646 : +BOARD_UNO = avr8 : atmega8u2 : +BOARD_CULV3 = avr8 : atmega32u4 : +BOARD_BLACKCAT = avr8 : at90usb162 : +BOARD_MAXIMUS = avr8 : at90usb162 : +BOARD_MINIMUS = avr8 : atmega32u2 : +BOARD_ADAFRUITU4 = avr8 : atmega32u4 : +BOARD_MICROSIN162 = avr8 : atmega162 : +BOARD_USBFOO = avr8 : atmega162 : +BOARD_SPARKFUN8U2 = avr8 : atmega8u2 : +BOARD_EVK1101 = uc3 : uc3b0256 : +BOARD_TUL = avr8 : atmega32u4 : +BOARD_EVK1100 = uc3 : uc3a0512 : +BOARD_EVK1104 = uc3 : uc3a3256 : +BOARD_A3BU_XPLAINED = xmega : atxmega256a3bu : +BOARD_TEENSY2 = avr8 : at90usb646 : +BOARD_USB2AX = avr8 : atmega32u4 : +BOARD_USB2AX_V3 = avr8 : atmega32u4 : +BOARD_MICROPENDOUS_32U2 = avr8 : atmega32u2 : +BOARD_MICROPENDOUS_A = avr8 : at90usb1287 : +BOARD_MICROPENDOUS_1 = avr8 : at90usb162 : +BOARD_MICROPENDOUS_2 = avr8 : atmega32u4 : +BOARD_MICROPENDOUS_3 = avr8 : at90usb1287 : +BOARD_MICROPENDOUS_4 = avr8 : at90usb1287 : +BOARD_MICROPENDOUS_DIP = avr8 : at90usb1287 : +BOARD_MICROPENDOUS_REV1 = avr8 : at90usb1287 : +BOARD_MICROPENDOUS_REV2 = avr8 : at90usb1287 : +BOARD_B1_XPLAINED = xmega : atxmega128b1 : +BOARD_MULTIO = avr8 : at90usb162 : +BOARD_BIGMULTIO = avr8 : atmega32u4 : +BOARD_DUCE = avr8 : atmega32u2 : +BOARD_OLIMEX32U4 = avr8 : atmega32u4 : +BOARD_OLIMEXT32U4 = avr8 : atmega32u4 : \ No newline at end of file diff --git a/BuildTests/BoardDriverTest/makefile b/BuildTests/BoardDriverTest/makefile index e0e784ddd8..5fffe1c1e1 100644 --- a/BuildTests/BoardDriverTest/makefile +++ b/BuildTests/BoardDriverTest/makefile @@ -32,19 +32,20 @@ testboards: echo "buildtest:" > BuildMakefile @while read line; \ do \ - build_cfg=`grep "$$line " BoardDeviceMap.cfg | cut -d'=' -f2-`; \ + build_cfg=`grep "$$line " BoardDeviceMap.cfg | sed 's/ //g' | cut -d'=' -f2-`; \ \ build_board=$$line; \ - build_arch=`echo $$build_cfg | cut -d':' -f1 | cut -d' ' -f1`; \ - build_mcu=`echo $$build_cfg | cut -d':' -f2 | cut -d' ' -f2`; \ + build_arch=`echo $$build_cfg | cut -d':' -f1`; \ + build_mcu=`echo $$build_cfg | cut -d':' -f2`; \ \ if ( test -z "$$build_cfg" ); then \ echo "No matching information set for board $$build_board"; \ else \ - echo "Found board configuration for $$build_board ($$build_arch, $$build_mcu)"; \ + echo "Found board configuration for $$build_board - $$build_arch, $$build_mcu"; \ + \ printf "\t@echo Building dummy project for $$build_board...\n" >> BuildMakefile; \ - printf "\tmake -s -f makefile.$$build_arch clean\n" >> BuildMakefile; \ - printf "\tmake -s -f makefile.$$build_arch MCU=$$build_mcu BOARD=$$build_board\n\n" >> BuildMakefile; \ + printf "\tmake -s -f makefile.%s clean\n" $$build_arch >> BuildMakefile; \ + printf "\tmake -s -f makefile.%s MCU=%s BOARD=%s\n\n" $$build_arch $$build_mcu $$build_board >> BuildMakefile; \ fi; \ done < BoardList.txt $(MAKE) -f BuildMakefile buildtest From e5a7fa201e4482c3658cd382470c4dcfe27578fb Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 7 May 2012 17:40:52 +0000 Subject: [PATCH 34/37] Add support for the ATXMEGA384C3. --- LUFA.pnproj | 2 +- LUFA/DoxygenPages/DeviceSupport.txt | 5 +++++ LUFA/Drivers/USB/Core/USBMode.h | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/LUFA.pnproj b/LUFA.pnproj index d410a46070..c01b16461f 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/DoxygenPages/DeviceSupport.txt b/LUFA/DoxygenPages/DeviceSupport.txt index 98678985d1..d1fe4f3cbc 100644 --- a/LUFA/DoxygenPages/DeviceSupport.txt +++ b/LUFA/DoxygenPages/DeviceSupport.txt @@ -401,6 +401,11 @@ * No * * + * ATXMEGA384C3 + * Yes + * No + * + * * ATXMEGA16C4 * Yes * No diff --git a/LUFA/Drivers/USB/Core/USBMode.h b/LUFA/Drivers/USB/Core/USBMode.h index 56e5b5e84b..f62c8c152f 100644 --- a/LUFA/Drivers/USB/Core/USBMode.h +++ b/LUFA/Drivers/USB/Core/USBMode.h @@ -230,7 +230,8 @@ #define USB_SERIES_B3_XMEGA #define USB_CAN_BE_DEVICE #elif (defined(__AVR_ATxmega128C3__) || defined(__AVR_ATxmega64C3__) || \ - defined(__AVR_ATxmega192C3__) || defined(__AVR_ATxmega256C3__)) + defined(__AVR_ATxmega192C3__) || defined(__AVR_ATxmega256C3__) || \ + defined(__AVR_ATxmega384C3__)) #define USB_SERIES_C3_XMEGA #define USB_CAN_BE_DEVICE #elif (defined(__AVR_ATxmega16C4__) || defined(__AVR_ATxmega32C4__)) From 7a7ee6a908c1a3d9fff220152309460287178a4f Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 7 May 2012 17:42:49 +0000 Subject: [PATCH 35/37] Speed up build tests by only building each test to the ELF output stage (when all files are compiled and linked), rather than to the full HEX output stage as the resulting binary is not actually required. --- BuildTests/BoardDriverTest/BoardDeviceMap.cfg | 2 ++ BuildTests/BoardDriverTest/makefile | 4 ++- BuildTests/ModuleTest/makefile | 18 +++++------ BuildTests/SingleUSBModeTest/makefile | 30 +++++++++---------- BuildTests/makefile | 7 +---- 5 files changed, 30 insertions(+), 31 deletions(-) diff --git a/BuildTests/BoardDriverTest/BoardDeviceMap.cfg b/BuildTests/BoardDriverTest/BoardDeviceMap.cfg index 27eaae9f46..683b1819dc 100644 --- a/BuildTests/BoardDriverTest/BoardDeviceMap.cfg +++ b/BuildTests/BoardDriverTest/BoardDeviceMap.cfg @@ -1,4 +1,6 @@ # BOARD DEFINE = {ARCH} : {MCU} : +BOARD_USER = avr8 : at90usb1287 : +BOARD_NONE = avr8 : at90usb1287 : BOARD_USBKEY = avr8 : at90usb1287 : BOARD_STK525 = avr8 : at90usb647 : BOARD_STK526 = avr8 : at90usb162 : diff --git a/BuildTests/BoardDriverTest/makefile b/BuildTests/BoardDriverTest/makefile index 5fffe1c1e1..598d953b6e 100644 --- a/BuildTests/BoardDriverTest/makefile +++ b/BuildTests/BoardDriverTest/makefile @@ -30,6 +30,7 @@ makeboardlist: testboards: echo "buildtest:" > BuildMakefile + @while read line; \ do \ build_cfg=`grep "$$line " BoardDeviceMap.cfg | sed 's/ //g' | cut -d'=' -f2-`; \ @@ -45,9 +46,10 @@ testboards: \ printf "\t@echo Building dummy project for $$build_board...\n" >> BuildMakefile; \ printf "\tmake -s -f makefile.%s clean\n" $$build_arch >> BuildMakefile; \ - printf "\tmake -s -f makefile.%s MCU=%s BOARD=%s\n\n" $$build_arch $$build_mcu $$build_board >> BuildMakefile; \ + printf "\tmake -s -f makefile.%s MCU=%s BOARD=%s elf\n\n" $$build_arch $$build_mcu $$build_board >> BuildMakefile; \ fi; \ done < BoardList.txt + $(MAKE) -f BuildMakefile buildtest clean: diff --git a/BuildTests/ModuleTest/makefile b/BuildTests/ModuleTest/makefile index c0d3ec040d..59700730cf 100644 --- a/BuildTests/ModuleTest/makefile +++ b/BuildTests/ModuleTest/makefile @@ -37,21 +37,21 @@ end: @echo %.avr8: - $(MAKE) -f makefile.avr8 clean -s - $(MAKE) -f makefile.avr8 all MCU=$(@:%.avr8=%) -s + $(MAKE) -s -f makefile.avr8 clean + $(MAKE) -s -f makefile.avr8 all MCU=$(@:%.avr8=%) elf %.xmega: - $(MAKE) -f makefile.xmega clean -s - $(MAKE) -f makefile.xmega all MCU=$(@:%.xmega=%) -s + $(MAKE) -s -f makefile.xmega clean + $(MAKE) -s -f makefile.xmega all MCU=$(@:%.xmega=%) elf %.uc3: - $(MAKE) -f makefile.uc3 clean -s - $(MAKE) -f makefile.uc3 all MCU=$(@:%.uc3=%) -s + $(MAKE) -s -f makefile.uc3 clean + $(MAKE) -s -f makefile.uc3 all MCU=$(@:%.uc3=%) elf clean: - $(MAKE) -f makefile.avr8 clean -s - $(MAKE) -f makefile.xmega clean -s - $(MAKE) -f makefile.uc3 clean -s + $(MAKE) -s -f makefile.avr8 clean + $(MAKE) -s -f makefile.xmega clean + $(MAKE) -s -f makefile.uc3 clean %: \ No newline at end of file diff --git a/BuildTests/SingleUSBModeTest/makefile b/BuildTests/SingleUSBModeTest/makefile index 701a4b930d..725f4a50ec 100644 --- a/BuildTests/SingleUSBModeTest/makefile +++ b/BuildTests/SingleUSBModeTest/makefile @@ -23,23 +23,23 @@ end: @echo compile: - $(MAKE) -f makefile.avr8 clean -s - $(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_DEVICE_ONLY' -s - $(MAKE) -f makefile.avr8 clean -s - $(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_HOST_ONLY' -s - - $(MAKE) -f makefile.xmega clean -s - $(MAKE) -f makefile.xmega LUFA_OPTS='-D USB_DEVICE_ONLY' -s - - $(MAKE) -f makefile.uc3 clean -s - $(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_DEVICE_ONLY' -s - $(MAKE) -f makefile.uc3 clean -s - $(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_HOST_ONLY' -s + $(MAKE) -s -f makefile.avr8 clean + $(MAKE) -s -f makefile.avr8 LUFA_OPTS='-D USB_DEVICE_ONLY' elf + $(MAKE) -s -f makefile.avr8 clean + $(MAKE) -s -f makefile.avr8 LUFA_OPTS='-D USB_HOST_ONLY' elf + + $(MAKE) -s -f makefile.xmega clean + $(MAKE) -s -f makefile.xmega LUFA_OPTS='-D USB_DEVICE_ONLY' elf + + $(MAKE) -s -f makefile.uc3 clean + $(MAKE) -s -f makefile.uc3 LUFA_OPTS='-D USB_DEVICE_ONLY' elf + $(MAKE) -s -f makefile.uc3 clean + $(MAKE) -s -f makefile.uc3 LUFA_OPTS='-D USB_HOST_ONLY' elf clean: - $(MAKE) -f makefile.avr8 clean -s - $(MAKE) -f makefile.xmega clean -s - $(MAKE) -f makefile.uc3 clean -s + $(MAKE) -s -f makefile.avr8 clean + $(MAKE) -s -f makefile.xmega clean + $(MAKE) -s -f makefile.uc3 clean %: \ No newline at end of file diff --git a/BuildTests/makefile b/BuildTests/makefile index dfa4f8d4bd..ac0cde2603 100644 --- a/BuildTests/makefile +++ b/BuildTests/makefile @@ -11,13 +11,8 @@ # not intended to be modified or compiled by non-developers. all: - $(MAKE) -C ModuleTest all - $(MAKE) -C SingleUSBModeTest all - $(MAKE) -C StaticAnalysisTest all - $(MAKE) -C BoardDriverTest all - %: + $(MAKE) -C BoardDriverTest $@ $(MAKE) -C ModuleTest $@ $(MAKE) -C SingleUSBModeTest $@ $(MAKE) -C StaticAnalysisTest $@ - $(MAKE) -C BoardDriverTest $@ From b601043e17844ac1a9ce7aa6c002684fb7754d50 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 10 May 2012 19:33:38 +0000 Subject: [PATCH 36/37] Fix broken documentation in the CDC and DFU class bootloaders due to Doxygen's confusion over the ATTR_NO_INIT attribute macro. --- Bootloaders/CDC/Doxygen.conf | 3 ++- Bootloaders/DFU/Doxygen.conf | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Bootloaders/CDC/Doxygen.conf b/Bootloaders/CDC/Doxygen.conf index a5b4bd683c..2c655dcffd 100644 --- a/Bootloaders/CDC/Doxygen.conf +++ b/Bootloaders/CDC/Doxygen.conf @@ -1531,7 +1531,8 @@ INCLUDE_FILE_PATTERNS = # instead of the = operator. PREDEFINED = __DOXYGEN__ \ - PROGMEM + PROGMEM \ + ATTR_NO_INIT # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff --git a/Bootloaders/DFU/Doxygen.conf b/Bootloaders/DFU/Doxygen.conf index 331b4b417f..99c1769ba6 100644 --- a/Bootloaders/DFU/Doxygen.conf +++ b/Bootloaders/DFU/Doxygen.conf @@ -1531,7 +1531,8 @@ INCLUDE_FILE_PATTERNS = # instead of the = operator. PREDEFINED = __DOXYGEN__ \ - PROGMEM + PROGMEM \ + ATTR_NO_INIT # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. From 3e7e02c6dd77a5c1afc1a249d6ba786241d5becd Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 12 May 2012 15:07:31 +0000 Subject: [PATCH 37/37] Minor documentation improvements. --- LUFA/DoxygenPages/LUFAPoweredProjects.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LUFA/DoxygenPages/LUFAPoweredProjects.txt b/LUFA/DoxygenPages/LUFAPoweredProjects.txt index 842d98fd96..841776bb62 100644 --- a/LUFA/DoxygenPages/LUFAPoweredProjects.txt +++ b/LUFA/DoxygenPages/LUFAPoweredProjects.txt @@ -128,9 +128,11 @@ * * \li Arduino Uno, the official Arduino board: http://www.arduino.cc * \li ARPS Locator: http://la3t.hamradio.no/lab//?id=tracker_en + * \li AsTeRICS assistive technologies project, HID actuator: http://www.asterics.eu * \li CFFA3000, a CompactFlash interface for the Apple II: http://www.dreher.net/CFforAppleII * \li Digital Survey Instruments Magnetometer and Pointer: http://www.digitalsurveyinstruments.com/ * \li FinchRobot, a robot designed for educational use: http://www.finchrobot.com/ + * \li HummingBird Kit, a robotics learning platform: http://www.hummingbirdkit.com/ * \li Penguino, an Arduino Board With On-Board LUFA Powered Debugger/Programmer: http://wiki.icy.com.au/PenguinoAVR * \li PIR-1, an IR control interface for consumer electronics: http://www.promixis.com/pir-1.php * \li PIR-4, a USB Connected 4 port IR transmitter: http://promixis.com/pir-4.php