Commit b37d77ea authored by Dean Camera's avatar Dean Camera

All USB class drivers are now automatically included when LUFA/Drivers/USB.h...

All USB class drivers are now automatically included when LUFA/Drivers/USB.h is included, and no longer need to be seperately included.

All LowLevel demos changed to use the constants and types defined in the USB class drivers.
parent 8f3bee7d
......@@ -47,7 +47,6 @@
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/Audio.h>
#include "Descriptors.h"
......
......@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/Audio.h>
#include <avr/pgmspace.h>
......
......@@ -48,7 +48,6 @@
#include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/Audio.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/Audio.h>
#include <avr/pgmspace.h>
......@@ -82,4 +81,3 @@
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
#endif
......@@ -40,7 +40,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/CDC.h>
/* Macros: */
/** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */
......@@ -102,4 +101,3 @@
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
#endif
......@@ -49,7 +49,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/CDC.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -40,7 +40,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
......
......@@ -48,7 +48,6 @@
#include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -40,7 +40,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
......
......@@ -50,7 +50,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Type Defines: */
/** Type define for the joystick HID report structure, for creating and sending HID reports to the host PC.
......
......@@ -40,7 +40,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
......
......@@ -51,7 +51,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -40,7 +40,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
......
......@@ -46,7 +46,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MIDI.h>
#include <avr/pgmspace.h>
......
......@@ -51,7 +51,6 @@
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MIDI.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -40,7 +40,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h>
/* Macros: */
/** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
......
......@@ -44,7 +44,6 @@
#include <LUFA/Common/Common.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h>
#include <LUFA/Drivers/Board/Dataflash.h>
/* Preprocessor Checks: */
......
......@@ -41,7 +41,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h>
#include "MassStorage.h"
#include "Descriptors.h"
......
......@@ -51,7 +51,6 @@
#include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -41,8 +41,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Macros: */
/** Endpoint number of the Keyboard HID reporting IN endpoint. */
......
......@@ -41,7 +41,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h>
#include "MassStorageKeyboard.h"
#include "Descriptors.h"
......
......@@ -56,8 +56,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/MassStorage.h>
#include <LUFA/Drivers/USB/Class/Device/HID.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
#include <avr/pgmspace.h>
......
......@@ -52,7 +52,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -38,7 +38,6 @@
/* Includes: */
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/RNDIS.h>
#include <avr/pgmspace.h>
......
......@@ -41,7 +41,6 @@
#include <avr/pgmspace.h>
#include <stdio.h>
#include <LUFA/Drivers/USB/Class/RNDIS.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h>
#include "EthernetProtocols.h"
......
......@@ -54,7 +54,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/RNDIS.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -40,7 +40,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/CDC.h>
/* Macros: */
/** Endpoint number of the CDC device-to-host notification IN endpoint. */
......
......@@ -50,7 +50,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/CDC.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -40,8 +40,6 @@
#include <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/CDC.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Macros: */
/** Endpoint number of the CDC device-to-host notification IN endpoint. */
......
......@@ -50,8 +50,6 @@
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/CDC.h>
#include <LUFA/Drivers/USB/Class/HID.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
......
......@@ -185,7 +185,7 @@ void USB_Audio_Task(void)
/* Microphone is biased to half rail voltage, subtract the bias from the sample value */
AudioSample -= (SAMPLE_MAX_RANGE / 2);
#endif
#end if
#endif
/* Write the sample to the buffer */
Endpoint_Write_Word_LE(AudioSample);
......
......@@ -104,25 +104,25 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_ControlInterface_SPC =
{
.Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_AudioHeader,
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_Header,
.ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_Audio_Interface_AC_t) +
sizeof(USB_Audio_InputTerminal_t) +
sizeof(USB_Audio_OutputTerminal_t)),
.TotalLength = (sizeof(USB_Audio_Descriptor_Interface_AC_t) +
sizeof(USB_Audio_Descriptor_InputTerminal_t) +
sizeof(USB_Audio_Descriptor_OutputTerminal_t)),
.InCollection = 1,
.InterfaceNumbers = {1},
.InterfaceNumber = 1,
},
.Audio_InputTerminal =
{
.Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputTerminal,
.Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
.TerminalID = 0x01,
.TerminalType = TERMINAL_IN_MIC,
.TerminalType = AUDIO_TERMINAL_IN_MIC,
.AssociatedOutputTerminal = 0x00,
.TotalChannels = 1,
......@@ -134,11 +134,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_OutputTerminal =
{
.Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputTerminal,
.Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
.TerminalID = 0x02,
.TerminalType = TERMINAL_STREAMING,
.TerminalType = AUDIO_TERMINAL_STREAMING,
.AssociatedInputTerminal = 0x00,
.SourceID = 0x01,
......@@ -180,8 +180,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamInterface_SPC =
{
.Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_General,
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_General,
.TerminalLink = 0x02,
......@@ -191,25 +191,24 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_AudioFormat =
{
.Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Format,
.Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_FormatType,
.FormatType = 0x01,
.Channels = 0x01,
.SubFrameSize = 0x02,
.BitResolution = 16,
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.Audio_AudioFormat.SampleFrequencies) /
sizeof(Audio_SampleFreq_t)),
.SampleFrequencyType = AUDIO_TOTAL_SAMPLE_RATES,
.SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
.SampleFrequencies = {AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
},
.Audio_StreamEndpoint =
{
.Endpoint =
{
.Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
......@@ -223,10 +222,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamEndpoint_SPC =
{
.Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General,
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
.Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
.Attributes = EP_ACCEPTS_SMALL_PACKETS,
.Attributes = AUDIO_EP_ACCEPTS_SMALL_PACKETS,
.LockDelayUnits = 0x00,
.LockDelay = 0x0000
......
......@@ -104,29 +104,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_ControlInterface_SPC =
{
.Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_AudioHeader,
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_Header,
.ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_Audio_Interface_AC_t) +
sizeof(USB_Audio_InputTerminal_t) +
sizeof(USB_Audio_OutputTerminal_t)),
.TotalLength = (sizeof(USB_Audio_Descriptor_Interface_AC_t) +
sizeof(USB_Audio_Descriptor_InputTerminal_t) +
sizeof(USB_Audio_Descriptor_OutputTerminal_t)),
.InCollection = 1,
.InterfaceNumbers = {1},
.InterfaceNumber = 1,
},
.Audio_InputTerminal =
{
.Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputTerminal,
.Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
.TerminalID = 0x01,
.TerminalType = TERMINAL_STREAMING,
.TerminalType = AUDIO_TERMINAL_STREAMING,
.AssociatedOutputTerminal = 0x00,
.TotalChannels = 2,
.ChannelConfig = (CHANNEL_LEFT_FRONT | CHANNEL_RIGHT_FRONT),
.ChannelConfig = (AUDIO_CHANNEL_LEFT_FRONT | AUDIO_CHANNEL_RIGHT_FRONT),
.ChannelStrIndex = NO_DESCRIPTOR,
.TerminalStrIndex = NO_DESCRIPTOR
......@@ -134,11 +134,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_OutputTerminal =
{
.Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputTerminal,
.Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
.TerminalID = 0x02,
.TerminalType = TERMINAL_OUT_SPEAKER,
.TerminalType = AUDIO_TERMINAL_OUT_SPEAKER,
.AssociatedInputTerminal = 0x00,
.SourceID = 0x01,
......@@ -180,8 +180,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamInterface_SPC =
{
.Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_General,
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_General,
.TerminalLink = 0x01,
......@@ -191,8 +191,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_AudioFormat =
{
.Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Format,
.Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface},
.Subtype = AUDIO_DSUBTYPE_CSInterface_FormatType,
.FormatType = 0x01,
.Channels = 0x02,
......@@ -200,16 +200,15 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.SubFrameSize = 0x02,
.BitResolution = 16,
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.Audio_AudioFormat.SampleFrequencies) /
sizeof(Audio_SampleFreq_t)),
.SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
.SampleFrequencyType = AUDIO_TOTAL_SAMPLE_RATES,
.SampleFrequencies = {AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
},
.Audio_StreamEndpoint =
{
.Endpoint =
{
.Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
......@@ -223,10 +222,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamEndpoint_SPC =
{
.Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General,
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
.Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
.Attributes = EP_ACCEPTS_SMALL_PACKETS,
.Attributes = AUDIO_EP_ACCEPTS_SMALL_PACKETS,
.LockDelayUnits = 0x00,
.LockDelay = 0x0000
......
......@@ -130,24 +130,24 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.CDC1_Functional_Header =
{
.Header = {.Size = sizeof(USB_Descriptor_CDC_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.Subtype = 0x00,
.Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.Subtype = CDC_DSUBTYPE_CSInterface_Header,
.CDCSpecification = VERSION_BCD(01.10),
},
.CDC1_Functional_ACM =
{
.Header = {.Size = sizeof(USB_Descriptor_CDC_FunctionalACM_t), .Type = DTYPE_CSInterface},
.Subtype = 0x02,
.Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Capabilities = 0x06,
},
.CDC1_Functional_Union =
{
.Header = {.Size = sizeof(USB_Descriptor_CDC_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.Subtype = 0x06,
.Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.Subtype = CDC_DSUBTYPE_CSInterface_Union,
.MasterInterfaceNumber = 0,