Changed over all deprecated GCC structure tag initializers to the standardized C99 format (thanks to Mike Alexander).

This commit is contained in:
Dean Camera 2009-04-20 11:21:36 +00:00
parent 619b0b7b6b
commit 37b2130fb2
55 changed files with 1670 additions and 1669 deletions

View file

@ -39,8 +39,8 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: USB_Audio_Task , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = USB_Audio_Task , .TaskStatus = TASK_STOP },
};

View file

@ -44,24 +44,24 @@
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(02.00),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(02.00),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2047,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2047,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -71,164 +71,164 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 2,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 2,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
AudioControlInterface:
.AudioControlInterface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0,
AlternateSetting: 0,
.InterfaceNumber = 0,
.AlternateSetting = 0,
TotalEndpoints: 0,
.TotalEndpoints = 0,
Class: 0x01,
SubClass: 0x01,
Protocol: 0x00,
.Class = 0x01,
.SubClass = 0x01,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
AudioControlInterface_SPC:
.AudioControlInterface_SPC =
{
Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_Header,
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header,
ACSpecification: VERSION_BCD(01.00),
TotalLength: (sizeof(USB_AudioInterface_AC_t) +
sizeof(USB_AudioInputTerminal_t) +
sizeof(USB_AudioOutputTerminal_t)),
.ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_AudioInterface_AC_t) +
sizeof(USB_AudioInputTerminal_t) +
sizeof(USB_AudioOutputTerminal_t)),
InCollection: 1,
InterfaceNumbers: {1},
.InCollection = 1,
.InterfaceNumbers = {1},
},
InputTerminal:
.InputTerminal =
{
Header: {Size: sizeof(USB_AudioInputTerminal_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_InputTerminal,
.Header = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_InputTerminal,
TerminalID: 0x01,
TerminalType: TERMINAL_IN_MIC,
AssociatedOutputTerminal: 0x00,
.TerminalID = 0x01,
.TerminalType = TERMINAL_IN_MIC,
.AssociatedOutputTerminal = 0x00,
TotalChannels: 1,
ChannelConfig: 0,
.TotalChannels = 1,
.ChannelConfig = 0,
ChannelStrIndex: NO_DESCRIPTOR,
TerminalStrIndex: NO_DESCRIPTOR
.ChannelStrIndex = NO_DESCRIPTOR,
.TerminalStrIndex = NO_DESCRIPTOR
},
OutputTerminal:
.OutputTerminal =
{
Header: {Size: sizeof(USB_AudioOutputTerminal_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_OutputTerminal,
.Header = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_OutputTerminal,
TerminalID: 0x02,
TerminalType: TERMINAL_STREAMING,
AssociatedInputTerminal: 0x00,
.TerminalID = 0x02,
.TerminalType = TERMINAL_STREAMING,
.AssociatedInputTerminal = 0x00,
SourceID: 0x01,
.SourceID = 0x01,
TerminalStrIndex: NO_DESCRIPTOR
.TerminalStrIndex = NO_DESCRIPTOR
},
AudioStreamInterface_Alt0:
.AudioStreamInterface_Alt0 =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 0,
.InterfaceNumber = 1,
.AlternateSetting = 0,
TotalEndpoints: 0,
.TotalEndpoints = 0,
Class: 0x01,
SubClass: 0x02,
Protocol: 0x00,
.Class = 0x01,
.SubClass = 0x02,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
AudioStreamInterface_Alt1:
.AudioStreamInterface_Alt1 =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 1,
.InterfaceNumber = 1,
.AlternateSetting = 1,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x01,
SubClass: 0x02,
Protocol: 0x00,
.Class = 0x01,
.SubClass = 0x02,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
AudioStreamInterface_SPC:
.AudioStreamInterface_SPC =
{
Header: {Size: sizeof(USB_AudioInterface_AS_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_General,
.Header = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General,
TerminalLink: 0x02,
.TerminalLink = 0x02,
FrameDelay: 1,
AudioFormat: 0x0001
.FrameDelay = 1,
.AudioFormat = 0x0001
},
AudioFormat:
.AudioFormat =
{
Header: {Size: sizeof(USB_AudioFormat_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_Format,
.Header = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Format,
FormatType: 0x01,
Channels: 0x01,
.FormatType = 0x01,
.Channels = 0x01,
SubFrameSize: 0x02,
BitResolution: 16,
SampleFrequencyType: (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
.SubFrameSize = 0x02,
.BitResolution = 16,
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
SampleFrequencies: {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
.SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
},
AudioEndpoint:
.AudioEndpoint =
{
Endpoint:
.Endpoint =
{
Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
Attributes: (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
EndpointSize: AUDIO_STREAM_EPSIZE,
PollingIntervalMS: 1
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AUDIO_STREAM_EPSIZE,
.PollingIntervalMS = 1
},
Refresh: 0,
SyncEndpointNumber: 0
.Refresh = 0,
.SyncEndpointNumber = 0
},
AudioEndpoint_SPC:
.AudioEndpoint_SPC =
{
Header: {Size: sizeof(USB_AudioStreamEndpoint_Spc_t), Type: DTYPE_AudioEndpoint},
Subtype: DSUBTYPE_General,
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
.Subtype = DSUBTYPE_General,
Attributes: 0x00,
.Attributes = 0x00,
LockDelayUnits: 0x00,
LockDelay: 0x0000
.LockDelayUnits = 0x00,
.LockDelay = 0x0000
}
};
@ -238,9 +238,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -249,9 +249,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -260,9 +260,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
UnicodeString: L"LUFA Audio In Demo"
.UnicodeString = L"LUFA Audio In Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -285,22 +285,22 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;

View file

@ -39,8 +39,8 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: USB_Audio_Task , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = USB_Audio_Task , .TaskStatus = TASK_STOP },
};

View file

@ -44,24 +44,24 @@
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(02.00),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(02.00),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2046,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2046,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -71,164 +71,164 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 2,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 2,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
AudioControlInterface:
.AudioControlInterface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0,
AlternateSetting: 0,
.InterfaceNumber = 0,
.AlternateSetting = 0,
TotalEndpoints: 0,
.TotalEndpoints = 0,
Class: 0x01,
SubClass: 0x01,
Protocol: 0x00,
.Class = 0x01,
.SubClass = 0x01,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
AudioControlInterface_SPC:
.AudioControlInterface_SPC =
{
Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_Header,
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header,
ACSpecification: VERSION_BCD(01.00),
TotalLength: (sizeof(USB_AudioInterface_AC_t) +
.ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_AudioInterface_AC_t) +
sizeof(USB_AudioInputTerminal_t) +
sizeof(USB_AudioOutputTerminal_t)),
InCollection: 1,
InterfaceNumbers: {1},
.InCollection = 1,
.InterfaceNumbers = {1},
},
InputTerminal:
.InputTerminal =
{
Header: {Size: sizeof(USB_AudioInputTerminal_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_InputTerminal,
.Header = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_InputTerminal,
TerminalID: 0x01,
TerminalType: TERMINAL_STREAMING,
AssociatedOutputTerminal: 0x00,
.TerminalID = 0x01,
.TerminalType = TERMINAL_STREAMING,
.AssociatedOutputTerminal = 0x00,
TotalChannels: 2,
ChannelConfig: (CHANNEL_LEFT_FRONT | CHANNEL_RIGHT_FRONT),
.TotalChannels = 2,
.ChannelConfig = (CHANNEL_LEFT_FRONT | CHANNEL_RIGHT_FRONT),
ChannelStrIndex: NO_DESCRIPTOR,
TerminalStrIndex: NO_DESCRIPTOR
.ChannelStrIndex = NO_DESCRIPTOR,
.TerminalStrIndex = NO_DESCRIPTOR
},
OutputTerminal:
.OutputTerminal =
{
Header: {Size: sizeof(USB_AudioOutputTerminal_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_OutputTerminal,
.Header = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_OutputTerminal,
TerminalID: 0x02,
TerminalType: TERMINAL_OUT_SPEAKER,
AssociatedInputTerminal: 0x00,
.TerminalID = 0x02,
.TerminalType = TERMINAL_OUT_SPEAKER,
.AssociatedInputTerminal = 0x00,
SourceID: 0x01,
.SourceID = 0x01,
TerminalStrIndex: NO_DESCRIPTOR
.TerminalStrIndex = NO_DESCRIPTOR
},
AudioStreamInterface_Alt0:
.AudioStreamInterface_Alt0 =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 0,
.InterfaceNumber = 1,
.AlternateSetting = 0,
TotalEndpoints: 0,
.TotalEndpoints = 0,
Class: 0x01,
SubClass: 0x02,
Protocol: 0x00,
.Class = 0x01,
.SubClass = 0x02,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
AudioStreamInterface_Alt1:
.AudioStreamInterface_Alt1 =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 1,
.InterfaceNumber = 1,
.AlternateSetting = 1,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x01,
SubClass: 0x02,
Protocol: 0x00,
.Class = 0x01,
.SubClass = 0x02,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
AudioStreamInterface_SPC:
.AudioStreamInterface_SPC =
{
Header: {Size: sizeof(USB_AudioInterface_AS_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_General,
.Header = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General,
TerminalLink: 0x01,
.TerminalLink = 0x01,
FrameDelay: 1,
AudioFormat: 0x0001
.FrameDelay = 1,
.AudioFormat = 0x0001
},
AudioFormat:
.AudioFormat =
{
Header: {Size: sizeof(USB_AudioFormat_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_Format,
.Header = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Format,
FormatType: 0x01,
Channels: 0x02,
.FormatType = 0x01,
.Channels = 0x02,
SubFrameSize: 0x02,
BitResolution: 16,
.SubFrameSize = 0x02,
.BitResolution = 16,
SampleFrequencyType: (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
SampleFrequencies: {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
.SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
},
AudioEndpoint:
.AudioEndpoint =
{
Endpoint:
.Endpoint =
{
Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
Attributes: (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
EndpointSize: AUDIO_STREAM_EPSIZE,
PollingIntervalMS: 1
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AUDIO_STREAM_EPSIZE,
.PollingIntervalMS = 1
},
Refresh: 0,
SyncEndpointNumber: 0
.Refresh = 0,
.SyncEndpointNumber = 0
},
AudioEndpoint_SPC:
.AudioEndpoint_SPC =
{
Header: {Size: sizeof(USB_AudioStreamEndpoint_Spc_t), Type: DTYPE_AudioEndpoint},
Subtype: DSUBTYPE_General,
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
.Subtype = DSUBTYPE_General,
Attributes: EP_ACCEPTS_SMALL_PACKETS,
.Attributes = EP_ACCEPTS_SMALL_PACKETS,
LockDelayUnits: 0x00,
LockDelay: 0x0000
.LockDelayUnits = 0x00,
.LockDelay = 0x0000
}
};
@ -238,9 +238,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -249,9 +249,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -260,9 +260,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
UnicodeString: L"LUFA Audio Out Demo"
.UnicodeString = L"LUFA Audio Out Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -289,18 +289,18 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;

View file

@ -39,8 +39,8 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: CDC_Task , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = CDC_Task , .TaskStatus = TASK_STOP },
};
/* Globals: */
@ -52,10 +52,10 @@ TASK_LIST
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
* serial link characteristics and instead sends and receives data in endpoint streams.
*/
CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
CharFormat: OneStopBit,
ParityType: Parity_None,
DataBits: 8 };
CDC_Line_Coding_t LineCoding = { .BaudRateBPS = 9600,
.CharFormat = OneStopBit,
.ParityType = Parity_None,
.DataBits = 8 };
/** String to print through the virtual serial port when the joystick is pressed upwards. */
char JoystickUpString[] = "Joystick Up\r\n";
@ -256,11 +256,11 @@ TASK(CDC_Task)
*/
USB_Notification_Header_t Notification = (USB_Notification_Header_t)
{
NotificationType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
Notification: NOTIF_SerialState,
wValue: 0,
wIndex: 0,
wLength: sizeof(uint16_t),
.NotificationType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
.Notification = NOTIF_SerialState,
.wValue = 0,
.wIndex = 0,
.wLength = sizeof(uint16_t),
};
uint16_t LineStateMask;

View file

@ -44,24 +44,24 @@
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x02,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x02,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2044,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2044,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -71,113 +71,113 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 2,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 2,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
CCI_Interface:
.CCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0,
AlternateSetting: 0,
.InterfaceNumber = 0,
.AlternateSetting = 0,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x02,
SubClass: 0x02,
Protocol: 0x01,
.Class = 0x02,
.SubClass = 0x02,
.Protocol = 0x01,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
CDC_Functional_IntHeader:
.CDC_Functional_IntHeader =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x00,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x00,
Data: {0x01, 0x10}
.Data = {0x01, 0x10}
},
CDC_Functional_CallManagement:
.CDC_Functional_CallManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x01,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x01,
Data: {0x03, 0x01}
.Data = {0x03, 0x01}
},
CDC_Functional_AbstractControlManagement:
.CDC_Functional_AbstractControlManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
SubType: 0x02,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
.SubType = 0x02,
Data: {0x06}
.Data = {0x06}
},
CDC_Functional_Union:
.CDC_Functional_Union =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x06,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x06,
Data: {0x00, 0x01}
.Data = {0x00, 0x01}
},
ManagementEndpoint:
.ManagementEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: CDC_NOTIFICATION_EPSIZE,
PollingIntervalMS: 0xFF
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
},
DCI_Interface:
.DCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 0,
.InterfaceNumber = 1,
.AlternateSetting = 0,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x0A,
SubClass: 0x00,
Protocol: 0x00,
.Class = 0x0A,
.SubClass = 0x00,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
DataOutEndpoint:
.DataOutEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
},
DataInEndpoint:
.DataInEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
}
};
@ -187,9 +187,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -198,9 +198,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -209,9 +209,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(13), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},
UnicodeString: L"LUFA CDC Demo"
.UnicodeString = L"LUFA CDC Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -234,22 +234,22 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;

View file

@ -44,24 +44,24 @@
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0xEF,
SubClass: 0x02,
Protocol: 0x01,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0xEF,
.SubClass = 0x02,
.Protocol = 0x01,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x204E,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x204E,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -71,235 +71,235 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 4,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 4,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
IAD1:
.IAD1 =
{
Header: {Size: sizeof(USB_Descriptor_Interface_Association_t), Type: DTYPE_InterfaceAssociation},
.Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation},
FirstInterfaceIndex: 0,
TotalInterfaces: 2,
.FirstInterfaceIndex = 0,
.TotalInterfaces = 2,
Class: 0x02,
SubClass: 0x02,
Protocol: 0x01,
.Class = 0x02,
.SubClass = 0x02,
.Protocol = 0x01,
IADStrIndex: NO_DESCRIPTOR
.IADStrIndex = NO_DESCRIPTOR
},
CDC1_CCI_Interface:
.CDC1_CCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0,
AlternateSetting: 0,
.InterfaceNumber = 0,
.AlternateSetting = 0,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x02,
SubClass: 0x02,
Protocol: 0x01,
.Class = 0x02,
.SubClass = 0x02,
.Protocol = 0x01,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
CDC1_Functional_IntHeader:
.CDC1_Functional_IntHeader =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x00,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x00,
Data: {0x01, 0x10}
.Data = {0x01, 0x10}
},
CDC1_Functional_CallManagement:
.CDC1_Functional_CallManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x01,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x01,
Data: {0x03, 0x01}
.Data = {0x03, 0x01}
},
CDC1_Functional_AbstractControlManagement:
.CDC1_Functional_AbstractControlManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
SubType: 0x02,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
.SubType = 0x02,
Data: {0x06}
.Data = {0x06}
},
CDC1_Functional_Union:
.CDC1_Functional_Union =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x06,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x06,
Data: {0x00, 0x01}
.Data = {0x00, 0x01}
},
CDC1_ManagementEndpoint:
.CDC1_ManagementEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_NOTIFICATION_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: CDC_NOTIFICATION_EPSIZE,
PollingIntervalMS: 0xFF
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_NOTIFICATION_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
},
CDC1_DCI_Interface:
.CDC1_DCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 0,
.InterfaceNumber = 1,
.AlternateSetting = 0,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x0A,
SubClass: 0x00,
Protocol: 0x00,
.Class = 0x0A,
.SubClass = 0x00,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
CDC1_DataOutEndpoint:
.CDC1_DataOutEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC1_RX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC1_RX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
},
CDC1_DataInEndpoint:
.CDC1_DataInEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_TX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_TX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
},
IAD2:
.IAD2 =
{
Header: {Size: sizeof(USB_Descriptor_Interface_Association_t), Type: DTYPE_InterfaceAssociation},
.Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation},
FirstInterfaceIndex: 2,
TotalInterfaces: 2,
.FirstInterfaceIndex = 2,
.TotalInterfaces = 2,
Class: 0x02,
SubClass: 0x02,
Protocol: 0x01,
.Class = 0x02,
.SubClass = 0x02,
.Protocol = 0x01,
IADStrIndex: NO_DESCRIPTOR
.IADStrIndex = NO_DESCRIPTOR
},
CDC2_CCI_Interface:
.CDC2_CCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 2,
AlternateSetting: 0,
.InterfaceNumber = 2,
.AlternateSetting = 0,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x02,
SubClass: 0x02,
Protocol: 0x01,
.Class = 0x02,
.SubClass = 0x02,
.Protocol = 0x01,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
CDC2_Functional_IntHeader:
.CDC2_Functional_IntHeader =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x00,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x00,
Data: {0x01, 0x10}
.Data = {0x01, 0x10}
},
CDC2_Functional_CallManagement:
.CDC2_Functional_CallManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x01,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x01,
Data: {0x03, 0x03}
.Data = {0x03, 0x03}
},
CDC2_Functional_AbstractControlManagement:
.CDC2_Functional_AbstractControlManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
SubType: 0x02,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
.SubType = 0x02,
Data: {0x06}
.Data = {0x06}
},
CDC2_Functional_Union:
.CDC2_Functional_Union =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x06,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x06,
Data: {0x02, 0x03}
.Data = {0x02, 0x03}
},
CDC2_ManagementEndpoint:
.CDC2_ManagementEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_NOTIFICATION_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: CDC_NOTIFICATION_EPSIZE,
PollingIntervalMS: 0xFF
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_NOTIFICATION_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
},
CDC2_DCI_Interface:
.CDC2_DCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 3,
AlternateSetting: 0,
.InterfaceNumber = 3,
.AlternateSetting = 0,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x0A,
SubClass: 0x00,
Protocol: 0x00,
.Class = 0x0A,
.SubClass = 0x00,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
CDC2_DataOutEndpoint:
.CDC2_DataOutEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC2_RX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC2_RX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
},
CDC2_DataInEndpoint:
.CDC2_DataInEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_TX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_TX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
}
};
@ -309,9 +309,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -320,9 +320,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -331,9 +331,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(13), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},
UnicodeString: L"LUFA Dual CDC Demo"
.UnicodeString = L"LUFA Dual CDC Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -356,22 +356,22 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;

View file

@ -39,9 +39,9 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: CDC1_Task , TaskStatus: TASK_STOP },
{ Task: CDC2_Task , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = CDC1_Task , .TaskStatus = TASK_STOP },
{ .Task = CDC2_Task , .TaskStatus = TASK_STOP },
};
/* Globals: */
@ -53,10 +53,10 @@ TASK_LIST
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
* serial link characteristics and instead sends and receives data in endpoint streams.
*/
CDC_Line_Coding_t LineCoding1 = { BaudRateBPS: 9600,
CharFormat: OneStopBit,
ParityType: Parity_None,
DataBits: 8 };
CDC_Line_Coding_t LineCoding1 = { .BaudRateBPS = 9600,
.CharFormat = OneStopBit,
.ParityType = Parity_None,
.DataBits = 8 };
/** Contains the current baud rate and other settings of the second virtual serial port. While this demo does not use
* the physical USART and thus does not use these settings, they must still be retained and returned to the host
@ -66,10 +66,10 @@ CDC_Line_Coding_t LineCoding1 = { BaudRateBPS: 9600,
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
* serial link characteristics and instead sends and receives data in endpoint streams.
*/
CDC_Line_Coding_t LineCoding2 = { BaudRateBPS: 9600,
CharFormat: OneStopBit,
ParityType: Parity_None,
DataBits: 8 };
CDC_Line_Coding_t LineCoding2 = { .BaudRateBPS = 9600,
.CharFormat = OneStopBit,
.ParityType = Parity_None,
.DataBits = 8 };
/** String to print through the first virtual serial port when the joystick is pressed upwards. */
char JoystickUpString[] = "Joystick Up\r\n";

View file

@ -70,24 +70,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM GenericReport[] =
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x204F,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x204F,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -97,66 +97,66 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 1,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 1,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
Interface:
.Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0x00,
AlternateSetting: 0x00,
.InterfaceNumber = 0x00,
.AlternateSetting = 0x00,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x03,
SubClass: 0x00,
Protocol: 0x00,
.Class = 0x03,
.SubClass = 0x00,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
GenericHID:
.GenericHID =
{
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
HIDSpec: VERSION_BCD(01.11),
CountryCode: 0x00,
TotalHIDReports: 0x01,
HIDReportType: DTYPE_Report,
HIDReportLength: sizeof(GenericReport)
.HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00,
.TotalHIDReports = 0x01,
.HIDReportType = DTYPE_Report,
.HIDReportLength = sizeof(GenericReport)
},
GenericINEndpoint:
.GenericINEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | GENERIC_IN_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: GENERIC_EPSIZE,
PollingIntervalMS: 0x02
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | GENERIC_IN_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = GENERIC_EPSIZE,
.PollingIntervalMS = 0x02
},
GenericOUTEndpoint:
.GenericOUTEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | GENERIC_OUT_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: GENERIC_EPSIZE,
PollingIntervalMS: 0x02
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | GENERIC_OUT_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = GENERIC_EPSIZE,
.PollingIntervalMS = 0x02
}
};
@ -166,9 +166,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -177,9 +177,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -188,9 +188,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(13), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(21), .Type = DTYPE_String},
UnicodeString: L"LUFA HID Demo"
.UnicodeString = L"LUFA Generic HID Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -213,33 +213,33 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;
}
break;
case DTYPE_HID:
case DTYPE_HID:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.GenericHID);
Size = sizeof(USB_Descriptor_HID_t);
break;
case DTYPE_Report:
case DTYPE_Report:
Address = DESCRIPTOR_ADDRESS(GenericReport);
Size = sizeof(GenericReport);
break;

View file

@ -40,11 +40,11 @@
TASK_LIST
{
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
#endif
#if !defined(INTERRUPT_DATA_ENDPOINT)
{ Task: USB_HID_Report , TaskStatus: TASK_STOP },
{ .Task = USB_HID_Report , .TaskStatus = TASK_STOP },
#endif
};

View file

@ -80,24 +80,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] =
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2043,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2043,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -107,56 +107,56 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 1,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 1,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
Interface:
.Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0x00,
AlternateSetting: 0x00,
.InterfaceNumber = 0x00,
.AlternateSetting = 0x00,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x03,
SubClass: 0x00,
Protocol: 0x00,
.Class = 0x03,
.SubClass = 0x00,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
JoystickHID:
.JoystickHID =
{
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
HIDSpec: VERSION_BCD(01.11),
CountryCode: 0x00,
TotalHIDReports: 0x01,
HIDReportType: DTYPE_Report,
HIDReportLength: sizeof(JoystickReport)
.HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00,
.TotalHIDReports = 0x01,
.HIDReportType = DTYPE_Report,
.HIDReportLength = sizeof(JoystickReport)
},
JoystickEndpoint:
.JoystickEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | JOYSTICK_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: JOYSTICK_EPSIZE,
PollingIntervalMS: 0x02
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | JOYSTICK_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = JOYSTICK_EPSIZE,
.PollingIntervalMS = 0x02
}
};
@ -166,9 +166,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -177,9 +177,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -188,9 +188,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
UnicodeString: L"LUFA Joystick Demo"
.UnicodeString = L"LUFA Joystick Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -213,33 +213,33 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;
}
break;
case DTYPE_HID:
case DTYPE_HID:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.JoystickHID);
Size = sizeof(USB_Descriptor_HID_t);
break;
case DTYPE_Report:
case DTYPE_Report:
Address = DESCRIPTOR_ADDRESS(JoystickReport);
Size = sizeof(JoystickReport);
break;

View file

@ -39,8 +39,8 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: USB_Joystick_Report , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = USB_Joystick_Report , .TaskStatus = TASK_STOP },
};
/** Main program entry point. This routine configures the hardware required by the application, then

View file

@ -87,24 +87,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2042,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2042,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -114,66 +114,66 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 1,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 1,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
Interface:
.Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0x00,
AlternateSetting: 0x00,
.InterfaceNumber = 0x00,
.AlternateSetting = 0x00,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x03,
SubClass: 0x01,
Protocol: 0x01,
.Class = 0x03,
.SubClass = 0x01,
.Protocol = 0x01,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
KeyboardHID:
.KeyboardHID =
{
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
HIDSpec: VERSION_BCD(01.11),
CountryCode: 0x00,
TotalHIDReports: 0x01,
HIDReportType: DTYPE_Report,
HIDReportLength: sizeof(KeyboardReport)
.HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00,
.TotalHIDReports = 0x01,
.HIDReportType = DTYPE_Report,
.HIDReportLength = sizeof(KeyboardReport)
},
KeyboardEndpoint:
.KeyboardEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: KEYBOARD_EPSIZE,
PollingIntervalMS: 0x04
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x04
},
KeyboardLEDsEndpoint:
.KeyboardLEDsEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: KEYBOARD_EPSIZE,
PollingIntervalMS: 0x04
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x04
}
};
@ -183,9 +183,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -194,9 +194,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(16), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(16), .Type = DTYPE_String},
UnicodeString: L"Denver Gingerich"
.UnicodeString = L"Denver Gingerich"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -205,9 +205,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
UnicodeString: L"LUFA Keyboard Demo"
.UnicodeString = L"LUFA Keyboard Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -226,37 +226,37 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
switch (DescriptorType)
{
case DTYPE_Device:
case DTYPE_Device:
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;
}
break;
case DTYPE_HID:
case DTYPE_HID:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.KeyboardHID);
Size = sizeof(USB_Descriptor_HID_t);
break;
case DTYPE_Report:
case DTYPE_Report:
Address = DESCRIPTOR_ADDRESS(KeyboardReport);
Size = sizeof(KeyboardReport);
break;

View file

@ -41,11 +41,11 @@
TASK_LIST
{
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
#endif
#if !defined(INTERRUPT_DATA_ENDPOINT)
{ Task: USB_Keyboard_Report , TaskStatus: TASK_STOP },
{ .Task = USB_Keyboard_Report , .TaskStatus = TASK_STOP },
#endif
};

View file

@ -120,24 +120,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x204D,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x204D,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -147,103 +147,103 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 2,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 2,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
KeyboardInterface:
.KeyboardInterface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0x00,
AlternateSetting: 0x00,
.InterfaceNumber = 0x00,
.AlternateSetting = 0x00,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x03,
SubClass: 0x01,
Protocol: 0x01,
.Class = 0x03,
.SubClass = 0x01,
.Protocol = 0x01,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
KeyboardHID:
.KeyboardHID =
{
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
HIDSpec: VERSION_BCD(01.11),
CountryCode: 0x00,
TotalHIDReports: 0x01,
HIDReportType: DTYPE_Report,
HIDReportLength: sizeof(KeyboardReport)
.HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00,
.TotalHIDReports = 0x01,
.HIDReportType = DTYPE_Report,
.HIDReportLength = sizeof(KeyboardReport)
},
KeyboardInEndpoint:
.KeyboardInEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_IN_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: HID_EPSIZE,
PollingIntervalMS: 0x02
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_IN_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x02
},
KeyboardOutEndpoint:
.KeyboardOutEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_OUT_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: HID_EPSIZE,
PollingIntervalMS: 0x02
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_OUT_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x02
},
MouseInterface:
.MouseInterface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0x01,
AlternateSetting: 0x00,
.InterfaceNumber = 0x01,
.AlternateSetting = 0x00,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x03,
SubClass: 0x01,
Protocol: 0x02,
.Class = 0x03,
.SubClass = 0x01,
.Protocol = 0x02,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
MouseHID:
.MouseHID =
{
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
HIDSpec: VERSION_BCD(01.11),
CountryCode: 0x00,
TotalHIDReports: 0x01,
HIDReportType: DTYPE_Report,
HIDReportLength: sizeof(MouseReport)
.HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00,
.TotalHIDReports = 0x01,
.HIDReportType = DTYPE_Report,
.HIDReportLength = sizeof(MouseReport)
},
MouseInEndpoint:
.MouseInEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_IN_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: HID_EPSIZE,
PollingIntervalMS: 0x02
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_IN_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = HID_EPSIZE,
.PollingIntervalMS = 0x02
}
};
@ -253,9 +253,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -264,9 +264,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -275,9 +275,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(28), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(28), .Type = DTYPE_String},
UnicodeString: L"LUFA Mouse and Keyboard Demo"
.UnicodeString = L"LUFA Mouse and Keyboard Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -296,33 +296,33 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
switch (DescriptorType)
{
case DTYPE_Device:
case DTYPE_Device:
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;
}
break;
case DTYPE_HID:
case DTYPE_HID:
if (!(wIndex))
{
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.KeyboardHID);
@ -334,7 +334,7 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
Size = sizeof(USB_Descriptor_HID_t);
}
break;
case DTYPE_Report:
case DTYPE_Report:
if (!(wIndex))
{
Address = DESCRIPTOR_ADDRESS(KeyboardReport);

View file

@ -40,9 +40,9 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: USB_Mouse , TaskStatus: TASK_RUN },
{ Task: USB_Keyboard , TaskStatus: TASK_RUN },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = USB_Mouse , .TaskStatus = TASK_RUN },
{ .Task = USB_Keyboard , .TaskStatus = TASK_RUN },
};
/* Global Variables */

View file

@ -44,24 +44,24 @@
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2048,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2048,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -71,175 +71,175 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 2,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 2,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
AudioControlInterface:
.AudioControlInterface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0,
AlternateSetting: 0,
.InterfaceNumber = 0,
.AlternateSetting = 0,
TotalEndpoints: 0,
.TotalEndpoints = 0,
Class: 0x01,
SubClass: 0x01,
Protocol: 0x00,
.Class = 0x01,
.SubClass = 0x01,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
AudioControlInterface_SPC:
.AudioControlInterface_SPC =
{
Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_Header,
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header,
ACSpecification: VERSION_BCD(01.00),
TotalLength: sizeof(USB_AudioInterface_AC_t),
.ACSpecification = VERSION_BCD(01.00),
.TotalLength = sizeof(USB_AudioInterface_AC_t),
InCollection: 1,
InterfaceNumbers: {1},
.InCollection = 1,
.InterfaceNumbers = {1},
},
AudioStreamInterface:
.AudioStreamInterface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 0,
.InterfaceNumber = 1,
.AlternateSetting = 0,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x01,
SubClass: 0x03,
Protocol: 0x00,
.Class = 0x01,
.SubClass = 0x03,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
AudioStreamInterface_SPC:
.AudioStreamInterface_SPC =
{
Header: {Size: sizeof(USB_AudioInterface_MIDI_AS_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_General,
.Header = {.Size = sizeof(USB_AudioInterface_MIDI_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General,
AudioSpecification: VERSION_BCD(01.00),
.AudioSpecification = VERSION_BCD(01.00),
TotalLength: (sizeof(USB_Descriptor_Configuration_t) - offsetof(USB_Descriptor_Configuration_t, AudioStreamInterface_SPC))
.TotalLength = (sizeof(USB_Descriptor_Configuration_t) - offsetof(USB_Descriptor_Configuration_t, AudioStreamInterface_SPC))
},
MIDI_In_Jack_Emb:
.MIDI_In_Jack_Emb =
{
Header: {Size: sizeof(USB_MIDI_In_Jack_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_InputJack,
.Header = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_InputJack,
JackType: JACKTYPE_EMBEDDED,
JackID: 0x01,
.JackType = JACKTYPE_EMBEDDED,
.JackID = 0x01,
JackStrIndex: NO_DESCRIPTOR
.JackStrIndex = NO_DESCRIPTOR
},
MIDI_In_Jack_Ext:
.MIDI_In_Jack_Ext =
{
Header: {Size: sizeof(USB_MIDI_In_Jack_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_InputJack,
.Header = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_InputJack,
JackType: JACKTYPE_EXTERNAL,
JackID: 0x02,
.JackType = JACKTYPE_EXTERNAL,
.JackID = 0x02,
JackStrIndex: NO_DESCRIPTOR
.JackStrIndex = NO_DESCRIPTOR
},
MIDI_Out_Jack_Emb:
.MIDI_Out_Jack_Emb =
{
Header: {Size: sizeof(USB_MIDI_Out_Jack_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_OutputJack,
.Header = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_OutputJack,
JackType: JACKTYPE_EMBEDDED,
JackID: 0x03,
.JackType = JACKTYPE_EMBEDDED,
.JackID = 0x03,
NumberOfPins: 1,
SourceJackID: {0x02},
SourcePinID: {0x01},
.NumberOfPins = 1,
.SourceJackID = {0x02},
.SourcePinID = {0x01},
JackStrIndex: NO_DESCRIPTOR
.JackStrIndex = NO_DESCRIPTOR
},
MIDI_Out_Jack_Ext:
.MIDI_Out_Jack_Ext =
{
Header: {Size: sizeof(USB_MIDI_Out_Jack_t), Type: DTYPE_AudioInterface},
Subtype: DSUBTYPE_OutputJack,
.Header = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_OutputJack,
JackType: JACKTYPE_EXTERNAL,
JackID: 0x04,
.JackType = JACKTYPE_EXTERNAL,
.JackID = 0x04,
NumberOfPins: 1,
SourceJackID: {0x01},
SourcePinID: {0x01},
.NumberOfPins = 1,
.SourceJackID = {0x01},
.SourcePinID = {0x01},
JackStrIndex: NO_DESCRIPTOR
.JackStrIndex = NO_DESCRIPTOR
},
MIDI_In_Jack_Endpoint:
.MIDI_In_Jack_Endpoint =
{
Endpoint:
.Endpoint =
{
Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
Attributes: (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
EndpointSize: MIDI_STREAM_EPSIZE,
PollingIntervalMS: 0
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MIDI_STREAM_EPSIZE,
.PollingIntervalMS = 0
},
Refresh: 0,
SyncEndpointNumber: 0
.Refresh = 0,
.SyncEndpointNumber = 0
},
MIDI_In_Jack_Endpoint_SPC:
.MIDI_In_Jack_Endpoint_SPC =
{
Header: {Size: sizeof(USB_MIDI_Jack_Endpoint_t), Type: DTYPE_AudioEndpoint},
Subtype: DSUBTYPE_General,
.Header = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint},
.Subtype = DSUBTYPE_General,
TotalEmbeddedJacks: 0x01,
AssociatedJackID: {0x01}
.TotalEmbeddedJacks = 0x01,
.AssociatedJackID = {0x01}
},
MIDI_Out_Jack_Endpoint:
.MIDI_Out_Jack_Endpoint =
{
Endpoint:
.Endpoint =
{
Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM),
Attributes: (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
EndpointSize: MIDI_STREAM_EPSIZE,
PollingIntervalMS: 0
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MIDI_STREAM_EPSIZE,
.PollingIntervalMS = 0
},
Refresh: 0,
SyncEndpointNumber: 0
.Refresh = 0,
.SyncEndpointNumber = 0
},
MIDI_Out_Jack_Endpoint_SPC:
.MIDI_Out_Jack_Endpoint_SPC =
{
Header: {Size: sizeof(USB_MIDI_Jack_Endpoint_t), Type: DTYPE_AudioEndpoint},
Subtype: DSUBTYPE_General,
.Header = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint},
.Subtype = DSUBTYPE_General,
TotalEmbeddedJacks: 0x01,
AssociatedJackID: {0x03}
.TotalEmbeddedJacks = 0x01,
.AssociatedJackID = {0x03}
}
};
@ -249,9 +249,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -260,9 +260,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -271,9 +271,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(14), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(14), .Type = DTYPE_String},
UnicodeString: L"LUFA MIDI Demo"
.UnicodeString = L"LUFA MIDI Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -292,26 +292,26 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
switch (DescriptorType)
{
case DTYPE_Device:
case DTYPE_Device:
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;

View file

@ -39,8 +39,8 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: USB_MIDI_Task , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = USB_MIDI_Task , .TaskStatus = TASK_STOP },
};
/** Main program entry point. This routine configures the hardware required by the application, then

View file

@ -44,24 +44,24 @@
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2045,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2045,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: 0x03,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = 0x03,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -71,55 +71,55 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 1,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 1,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: USB_CONFIG_ATTR_BUSPOWERED,
.ConfigAttributes = USB_CONFIG_ATTR_BUSPOWERED,
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
Interface:
.Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0,
AlternateSetting: 0,
.InterfaceNumber = 0,
.AlternateSetting = 0,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x08,
SubClass: 0x06,
Protocol: 0x50,
.Class = 0x08,
.SubClass = 0x06,
.Protocol = 0x50,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
DataInEndpoint:
.DataInEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MASS_STORAGE_IN_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: MASS_STORAGE_IO_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MASS_STORAGE_IN_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x00
},
DataOutEndpoint:
.DataOutEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: MASS_STORAGE_IO_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x00
}
};
@ -129,9 +129,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -140,9 +140,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -151,9 +151,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(22), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(22), .Type = DTYPE_String},
UnicodeString: L"LUFA Mass Storage Demo"
.UnicodeString = L"LUFA Mass Storage Demo"
};
/** Serial number descriptor string. This is a Unicode string containing a string of HEX characters at least 12
@ -165,9 +165,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
*/
USB_Descriptor_String_t PROGMEM SerialNumberString =
{
Header: {Size: USB_STRING_LEN(12), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(12), .Type = DTYPE_String},
UnicodeString: L"000000000000"
.UnicodeString = L"000000000000"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -186,30 +186,30 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
switch (DescriptorType)
{
case DTYPE_Device:
case DTYPE_Device:
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;
case 0x03:
case 0x03:
Address = DESCRIPTOR_ADDRESS(SerialNumberString);
Size = pgm_read_byte(&SerialNumberString.Header.Size);
break;

View file

@ -40,7 +40,7 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_MassStorage , TaskStatus: TASK_STOP },
{ .Task = USB_MassStorage , .TaskStatus = TASK_STOP },
};
/* Global Variables */
@ -48,7 +48,7 @@ TASK_LIST
CommandBlockWrapper_t CommandBlock;
/** Structure to hold the latest Command Status Wrapper to return to the host, containing the status of the last issued command. */
CommandStatusWrapper_t CommandStatus = { Signature: CSW_SIGNATURE };
CommandStatusWrapper_t CommandStatus = { .Signature = CSW_SIGNATURE };
/** Flag to asynchronously abort any in-progress data transfers upon the reception of a mass storage reset command. */
volatile bool IsMassStoreReset = false;

View file

@ -43,31 +43,31 @@
*/
SCSI_Inquiry_Response_t InquiryData =
{
DeviceType: 0,
PeripheralQualifier: 0,
.DeviceType = 0,
.PeripheralQualifier = 0,
Removable: true,
.Removable = true,
Version: 0,
.Version = 0,
ResponseDataFormat: 2,
NormACA: false,
TrmTsk: false,
AERC: false,
.ResponseDataFormat = 2,
.NormACA = false,
.TrmTsk = false,
.AERC = false,
AdditionalLength: 0x1F,
.AdditionalLength = 0x1F,
SoftReset: false,
CmdQue: false,
Linked: false,
Sync: false,
WideBus16Bit: false,
WideBus32Bit: false,
RelAddr: false,
.SoftReset = false,
.CmdQue = false,
.Linked = false,
.Sync = false,
.WideBus16Bit = false,
.WideBus32Bit = false,
.RelAddr = false,
VendorID: "LUFA",
ProductID: "Dataflash Disk",
RevisionID: {'0','.','0','0'},
.VendorID = "LUFA",
.ProductID = "Dataflash Disk",
.RevisionID = {'0','.','0','0'},
};
/** Structure to hold the sense data for the last issued SCSI command, which is returned to the host after a SCSI REQUEST SENSE
@ -75,8 +75,8 @@ SCSI_Inquiry_Response_t InquiryData =
*/
SCSI_Request_Sense_Response_t SenseData =
{
ResponseCode: 0x70,
AdditionalLength: 0x0A,
.ResponseCode = 0x70,
.AdditionalLength = 0x0A,
};

View file

@ -80,24 +80,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] =
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x00,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x00,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2041,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2041,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -107,56 +107,56 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 1,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 1,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
Interface:
.Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0x00,
AlternateSetting: 0x00,
.InterfaceNumber = 0x00,
.AlternateSetting = 0x00,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x03,
SubClass: 0x01,
Protocol: 0x02,
.Class = 0x03,
.SubClass = 0x01,
.Protocol = 0x02,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
MouseHID:
.MouseHID =
{
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
HIDSpec: VERSION_BCD(01.11),
CountryCode: 0x00,
TotalHIDReports: 0x01,
HIDReportType: DTYPE_Report,
HIDReportLength: sizeof(MouseReport)
.HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00,
.TotalHIDReports = 0x01,
.HIDReportType = DTYPE_Report,
.HIDReportLength = sizeof(MouseReport)
},
MouseEndpoint:
.MouseEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: MOUSE_EPSIZE,
PollingIntervalMS: 0x02
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = MOUSE_EPSIZE,
.PollingIntervalMS = 0x02
}
};
@ -166,9 +166,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -177,9 +177,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -188,9 +188,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(15), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(15), .Type = DTYPE_String},
UnicodeString: L"LUFA Mouse Demo"
.UnicodeString = L"LUFA Mouse Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -235,11 +235,11 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
}
break;
case DTYPE_HID:
case DTYPE_HID:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.MouseHID);
Size = sizeof(USB_Descriptor_HID_t);
break;
case DTYPE_Report:
case DTYPE_Report:
Address = DESCRIPTOR_ADDRESS(MouseReport);
Size = sizeof(MouseReport);
break;

View file

@ -40,11 +40,11 @@
TASK_LIST
{
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
#endif
#if !defined(INTERRUPT_DATA_ENDPOINT)
{ Task: USB_Mouse_Report , TaskStatus: TASK_STOP },
{ .Task = USB_Mouse_Report , .TaskStatus = TASK_STOP },
#endif
};

View file

@ -44,24 +44,24 @@
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x02,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x02,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x204C,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x204C,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -71,113 +71,113 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 2,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 2,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
CCI_Interface:
.CCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0,
AlternateSetting: 0,
.InterfaceNumber = 0,
.AlternateSetting = 0,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x02,
SubClass: 0x02,
Protocol: 0xFF,
.Class = 0x02,
.SubClass = 0x02,
.Protocol = 0xFF,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
CDC_Functional_Header:
.CDC_Functional_Header =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x00,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x00,
Data: {0x01, 0x10}
.Data = {0x01, 0x10}
},
CDC_Functional_CallManagement:
.CDC_Functional_CallManagement=
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x01,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x01,
Data: {0x00, 0x00}
.Data = {0x00, 0x00}
},
CDC_Functional_AbstractControlManagement:
.CDC_Functional_AbstractControlManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
SubType: 0x02,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
.SubType = 0x02,
Data: {0x00}
.Data = {0x00}
},
CDC_Functional_Union:
.CDC_Functional_Union =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x06,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x06,
Data: {0x00, 0x01}
.Data = {0x00, 0x01}
},
ManagementEndpoint:
.ManagementEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: CDC_NOTIFICATION_EPSIZE,
PollingIntervalMS: 0x02
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0x02
},
DCI_Interface:
.DCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 0,
.InterfaceNumber = 1,
.AlternateSetting = 0,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x0A,
SubClass: 0x00,
Protocol: 0x00,
.Class = 0x0A,
.SubClass = 0x00,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
DataOutEndpoint:
.DataOutEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
},
DataInEndpoint:
.DataInEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
}
};
@ -187,9 +187,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -198,9 +198,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -209,9 +209,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
UnicodeString: L"LUFA RNDIS CDC Demo"
.UnicodeString = L"LUFA RNDIS CDC Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -234,7 +234,7 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;

View file

@ -39,10 +39,10 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: Ethernet_Task , TaskStatus: TASK_STOP },
{ Task: TCP_Task , TaskStatus: TASK_STOP },
{ Task: RNDIS_Task , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = Ethernet_Task , .TaskStatus = TASK_STOP },
{ .Task = TCP_Task , .TaskStatus = TASK_STOP },
{ .Task = RNDIS_Task , .TaskStatus = TASK_STOP },
};
/** Main program entry point. This routine configures the hardware required by the application, then
@ -245,11 +245,11 @@ TASK(RNDIS_Task)
{
USB_Notification_t Notification = (USB_Notification_t)
{
bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
bNotification: NOTIF_RESPONSE_AVAILABLE,
wValue: 0,
wIndex: 0,
wLength: 0,
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
.bNotification = NOTIF_RESPONSE_AVAILABLE,
.wValue = 0,
.wIndex = 0,
.wLength = 0,
};
/* Indicate that a message response is ready for the host */

View file

@ -44,24 +44,24 @@
*/
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
USBSpecification: VERSION_BCD(01.10),
Class: 0x02,
SubClass: 0x00,
Protocol: 0x00,
.USBSpecification = VERSION_BCD(01.10),
.Class = 0x02,
.SubClass = 0x00,
.Protocol = 0x00,
Endpoint0Size: 8,
.Endpoint0Size = 8,
VendorID: 0x03EB,
ProductID: 0x2044,
ReleaseNumber: 0x0000,
.VendorID = 0x03EB,
.ProductID = 0x2044,
.ReleaseNumber = 0x0000,
ManufacturerStrIndex: 0x01,
ProductStrIndex: 0x02,
SerialNumStrIndex: NO_DESCRIPTOR,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.SerialNumStrIndex = NO_DESCRIPTOR,
NumberOfConfigurations: 1
.NumberOfConfigurations = 1
};
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
@ -71,113 +71,113 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
*/
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Config:
.Config =
{
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
TotalInterfaces: 2,
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
.TotalInterfaces = 2,
ConfigurationNumber: 1,
ConfigurationStrIndex: NO_DESCRIPTOR,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
CCI_Interface:
.CCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 0,
AlternateSetting: 0,
.InterfaceNumber = 0,
.AlternateSetting = 0,
TotalEndpoints: 1,
.TotalEndpoints = 1,
Class: 0x02,
SubClass: 0x02,
Protocol: 0x01,
.Class = 0x02,
.SubClass = 0x02,
.Protocol = 0x01,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
CDC_Functional_IntHeader:
.CDC_Functional_IntHeader =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x00,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x00,
Data: {0x01, 0x10}
.Data = {0x01, 0x10}
},
CDC_Functional_CallManagement:
.CDC_Functional_CallManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x01,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x01,
Data: {0x03, 0x01}
.Data = {0x03, 0x01}
},
CDC_Functional_AbstractControlManagement:
.CDC_Functional_AbstractControlManagement =
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
SubType: 0x02,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
.SubType = 0x02,
Data: {0x06}
.Data = {0x06}
},
CDC_Functional_Union:
.CDC_Functional_Union=
{
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
SubType: 0x06,
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
.SubType = 0x06,
Data: {0x00, 0x01}
.Data = {0x00, 0x01}
},
ManagementEndpoint:
.ManagementEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
Attributes: EP_TYPE_INTERRUPT,
EndpointSize: CDC_NOTIFICATION_EPSIZE,
PollingIntervalMS: 0xFF
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
.Attributes = EP_TYPE_INTERRUPT,
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
},
DCI_Interface:
.DCI_Interface =
{
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
InterfaceNumber: 1,
AlternateSetting: 0,
.InterfaceNumber = 1,
.AlternateSetting = 0,
TotalEndpoints: 2,
.TotalEndpoints = 2,
Class: 0x0A,
SubClass: 0x00,
Protocol: 0x00,
.Class = 0x0A,
.SubClass = 0x00,
.Protocol = 0x00,
InterfaceStrIndex: NO_DESCRIPTOR
.InterfaceStrIndex = NO_DESCRIPTOR
},
DataOutEndpoint:
.DataOutEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x00
},
DataInEndpoint:
.DataInEndpoint =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
Attributes: EP_TYPE_BULK,
EndpointSize: CDC_TXRX_EPSIZE,
PollingIntervalMS: 0x00
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
.Attributes = EP_TYPE_BULK,
.EndpointSize = CDC_TXRX_EPSIZE,
.PollingIntervalMS= 0x00
}
};
@ -187,9 +187,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
UnicodeString: {LANGUAGE_ID_ENG}
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
@ -198,9 +198,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
UnicodeString: L"Dean Camera"
.UnicodeString = L"Dean Camera"
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
@ -209,9 +209,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
USB_Descriptor_String_t PROGMEM ProductString =
{
Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
.Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
UnicodeString: L"LUFA USB-RS232 Demo"
.UnicodeString = L"LUFA USB-RS232 Demo"
};
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
@ -230,26 +230,26 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
switch (DescriptorType)
{
case DTYPE_Device:
case DTYPE_Device:
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Size = pgm_read_byte(&ProductString.Header.Size);
break;

View file

@ -33,8 +33,8 @@
/* Scheduler Task List */
TASK_LIST
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: CDC_Task , TaskStatus: TASK_STOP },
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
{ .Task = CDC_Task , .TaskStatus = TASK_STOP },
};
/* Globals: */
@ -43,10 +43,10 @@ TASK_LIST
* These values are set by the host via a class-specific request, and the physical USART should be reconfigured to match the
* new settings each time they are changed by the host.
*/
CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
CharFormat: OneStopBit,
ParityType: Parity_None,
DataBits: 8 };
CDC_Line_Coding_t LineCoding = { .BaudRateBPS = 9600,
.CharFormat = OneStopBit,
.ParityType = Parity_None,
.DataBits = 8 };
/** Ring (circular) buffer to hold the RX data - data from the host to the attached device on the serial port. */
RingBuff_t Rx_Buffer;
@ -224,11 +224,11 @@ TASK(CDC_Task)
USB_Notification_Header_t Notification = (USB_Notification_Header_t)
{
NotificationType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
Notification: NOTIF_SerialState,
wValue: 0,
wIndex: 0,
wLength: sizeof(uint16_t),
.NotificationType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
.Notification = NOTIF_SerialState,
.wValue = 0,
.wIndex = 0,
.wLength = sizeof(uint16_t),
};
uint16_t LineStateMask;
@ -244,6 +244,7 @@ TASK(CDC_Task)
/* Select the Serial Rx Endpoint */
Endpoint_SelectEndpoint(CDC_RX_EPNUM);
/* Check to see if a packet has been received from the host */
if (Endpoint_IsOUTReceived())
{
/* Read the bytes in from the endpoint into the buffer while space is available */