Reduce struct name pollution - group typedef struct names by class driver name where appropriate.

pull/1469/head
Dean Camera 16 years ago
parent 7366f590f5
commit 3cbdcd3686

@ -104,13 +104,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioControlInterface_SPC = .AudioControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_AudioInterface_AC_t) + .TotalLength = (sizeof(USB_Audio_Interface_AC_t) +
sizeof(USB_AudioInputTerminal_t) + sizeof(USB_Audio_InputTerminal_t) +
sizeof(USB_AudioOutputTerminal_t)), sizeof(USB_Audio_OutputTerminal_t)),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumbers = {1},
@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InputTerminal = .InputTerminal =
{ {
.Header = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_InputTerminal, .Subtype = DSUBTYPE_InputTerminal,
.TerminalID = 0x01, .TerminalID = 0x01,
@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.OutputTerminal = .OutputTerminal =
{ {
.Header = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_OutputTerminal, .Subtype = DSUBTYPE_OutputTerminal,
.TerminalID = 0x02, .TerminalID = 0x02,
@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioStreamInterface_SPC = .AudioStreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.TerminalLink = 0x02, .TerminalLink = 0x02,
@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioFormat = .AudioFormat =
{ {
.Header = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Format, .Subtype = DSUBTYPE_Format,
.FormatType = 0x01, .FormatType = 0x01,
@ -199,7 +199,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.SubFrameSize = 0x02, .SubFrameSize = 0x02,
.BitResolution = 16, .BitResolution = 16,
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)), .SampleFrequencyType = (AUDIO_TOTAL_SAMPLE_RATES * sizeof(USB_Audio_SampleFreq_t)),
.SampleFrequencies = {AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)} .SampleFrequencies = {AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
}, },
@ -208,7 +208,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Endpoint = .Endpoint =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM), .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA), .Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
@ -222,7 +222,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioEndpoint_SPC = .AudioEndpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.Attributes = 0x00, .Attributes = 0x00,

@ -68,15 +68,15 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t AudioControlInterface; USB_Descriptor_Interface_t AudioControlInterface;
USB_AudioInterface_AC_t AudioControlInterface_SPC; USB_Audio_Interface_AC_t AudioControlInterface_SPC;
USB_AudioInputTerminal_t InputTerminal; USB_Audio_InputTerminal_t InputTerminal;
USB_AudioOutputTerminal_t OutputTerminal; USB_Audio_OutputTerminal_t OutputTerminal;
USB_Descriptor_Interface_t AudioStreamInterface_Alt0; USB_Descriptor_Interface_t AudioStreamInterface_Alt0;
USB_Descriptor_Interface_t AudioStreamInterface_Alt1; USB_Descriptor_Interface_t AudioStreamInterface_Alt1;
USB_AudioInterface_AS_t AudioStreamInterface_SPC; USB_Audio_Interface_AS_t AudioStreamInterface_SPC;
USB_AudioFormat_t AudioFormat; USB_Audio_Format_t AudioFormat;
USB_AudioStreamEndpoint_Std_t AudioEndpoint; USB_Audio_StreamEndpoint_Std_t AudioEndpoint;
USB_AudioStreamEndpoint_Spc_t AudioEndpoint_SPC; USB_Audio_StreamEndpoint_Spc_t AudioEndpoint_SPC;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;
/* Function Prototypes: */ /* Function Prototypes: */

@ -104,13 +104,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioControlInterface_SPC = .AudioControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_AudioInterface_AC_t) + .TotalLength = (sizeof(USB_Audio_Interface_AC_t) +
sizeof(USB_AudioInputTerminal_t) + sizeof(USB_Audio_InputTerminal_t) +
sizeof(USB_AudioOutputTerminal_t)), sizeof(USB_Audio_OutputTerminal_t)),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumbers = {1},
@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InputTerminal = .InputTerminal =
{ {
.Header = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_InputTerminal, .Subtype = DSUBTYPE_InputTerminal,
.TerminalID = 0x01, .TerminalID = 0x01,
@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.OutputTerminal = .OutputTerminal =
{ {
.Header = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_OutputTerminal, .Subtype = DSUBTYPE_OutputTerminal,
.TerminalID = 0x02, .TerminalID = 0x02,
@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioStreamInterface_SPC = .AudioStreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.TerminalLink = 0x01, .TerminalLink = 0x01,
@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioFormat = .AudioFormat =
{ {
.Header = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Format, .Subtype = DSUBTYPE_Format,
.FormatType = 0x01, .FormatType = 0x01,
@ -200,7 +200,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.SubFrameSize = 0x02, .SubFrameSize = 0x02,
.BitResolution = 16, .BitResolution = 16,
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)), .SampleFrequencyType = (AUDIO_TOTAL_SAMPLE_RATES * sizeof(USB_Audio_SampleFreq_t)),
.SampleFrequencies = {AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)} .SampleFrequencies = {AUDIO_SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
}, },
@ -208,7 +208,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Endpoint = .Endpoint =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM), .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA), .Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
@ -222,7 +222,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioEndpoint_SPC = .AudioEndpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.Attributes = EP_ACCEPTS_SMALL_PACKETS, .Attributes = EP_ACCEPTS_SMALL_PACKETS,

@ -68,15 +68,15 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t AudioControlInterface; USB_Descriptor_Interface_t AudioControlInterface;
USB_AudioInterface_AC_t AudioControlInterface_SPC; USB_Audio_Interface_AC_t AudioControlInterface_SPC;
USB_AudioInputTerminal_t InputTerminal; USB_Audio_InputTerminal_t InputTerminal;
USB_AudioOutputTerminal_t OutputTerminal; USB_Audio_OutputTerminal_t OutputTerminal;
USB_Descriptor_Interface_t AudioStreamInterface_Alt0; USB_Descriptor_Interface_t AudioStreamInterface_Alt0;
USB_Descriptor_Interface_t AudioStreamInterface_Alt1; USB_Descriptor_Interface_t AudioStreamInterface_Alt1;
USB_AudioInterface_AS_t AudioStreamInterface_SPC; USB_Audio_Interface_AS_t AudioStreamInterface_SPC;
USB_AudioFormat_t AudioFormat; USB_Audio_Format_t AudioFormat;
USB_AudioStreamEndpoint_Std_t AudioEndpoint; USB_Audio_StreamEndpoint_Std_t AudioEndpoint;
USB_AudioStreamEndpoint_Spc_t AudioEndpoint_SPC; USB_Audio_StreamEndpoint_Spc_t AudioEndpoint_SPC;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;
/* Function Prototypes: */ /* Function Prototypes: */

@ -130,7 +130,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.GenericHID = .GenericHID =
{ {
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
@ -227,7 +227,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
break; break;
case DTYPE_HID: case DTYPE_HID:
Address = (void*)&ConfigurationDescriptor.GenericHID; Address = (void*)&ConfigurationDescriptor.GenericHID;
Size = sizeof(USB_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_t);
break; break;
case DTYPE_Report: case DTYPE_Report:
Address = (void*)&GenericReport; Address = (void*)&GenericReport;

@ -51,7 +51,7 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t Interface; USB_Descriptor_Interface_t Interface;
USB_Descriptor_HID_t GenericHID; USB_HID_Descriptor_t GenericHID;
USB_Descriptor_Endpoint_t GenericINEndpoint; USB_Descriptor_Endpoint_t GenericINEndpoint;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;

@ -140,7 +140,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.JoystickHID = .JoystickHID =
{ {
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
@ -237,7 +237,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
break; break;
case DTYPE_HID: case DTYPE_HID:
Address = (void*)&ConfigurationDescriptor.JoystickHID; Address = (void*)&ConfigurationDescriptor.JoystickHID;
Size = sizeof(USB_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_t);
break; break;
case DTYPE_Report: case DTYPE_Report:
Address = (void*)&JoystickReport; Address = (void*)&JoystickReport;

@ -51,7 +51,7 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t Interface; USB_Descriptor_Interface_t Interface;
USB_Descriptor_HID_t JoystickHID; USB_HID_Descriptor_t JoystickHID;
USB_Descriptor_Endpoint_t JoystickEndpoint; USB_Descriptor_Endpoint_t JoystickEndpoint;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;

@ -147,7 +147,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.KeyboardHID = .KeyboardHID =
{ {
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
@ -244,7 +244,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
break; break;
case DTYPE_HID: case DTYPE_HID:
Address = (void*)&ConfigurationDescriptor.KeyboardHID; Address = (void*)&ConfigurationDescriptor.KeyboardHID;
Size = sizeof(USB_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_t);
break; break;
case DTYPE_Report: case DTYPE_Report:
Address = (void*)&KeyboardReport; Address = (void*)&KeyboardReport;

@ -52,7 +52,7 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t Interface; USB_Descriptor_Interface_t Interface;
USB_Descriptor_HID_t KeyboardHID; USB_HID_Descriptor_t KeyboardHID;
USB_Descriptor_Endpoint_t KeyboardEndpoint; USB_Descriptor_Endpoint_t KeyboardEndpoint;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;

@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.KeyboardHID = .KeyboardHID =
{ {
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
@ -217,7 +217,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MouseHID = .MouseHID =
{ {
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
@ -316,12 +316,12 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
if (!(wIndex)) if (!(wIndex))
{ {
Address = (void*)&ConfigurationDescriptor.KeyboardHID; Address = (void*)&ConfigurationDescriptor.KeyboardHID;
Size = sizeof(USB_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_t);
} }
else else
{ {
Address = (void*)&ConfigurationDescriptor.MouseHID; Address = (void*)&ConfigurationDescriptor.MouseHID;
Size = sizeof(USB_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_t);
} }
break; break;
case DTYPE_Report: case DTYPE_Report:

@ -52,10 +52,10 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t KeyboardInterface; USB_Descriptor_Interface_t KeyboardInterface;
USB_Descriptor_HID_t KeyboardHID; USB_HID_Descriptor_t KeyboardHID;
USB_Descriptor_Endpoint_t KeyboardInEndpoint; USB_Descriptor_Endpoint_t KeyboardInEndpoint;
USB_Descriptor_Interface_t MouseInterface; USB_Descriptor_Interface_t MouseInterface;
USB_Descriptor_HID_t MouseHID; USB_HID_Descriptor_t MouseHID;
USB_Descriptor_Endpoint_t MouseInEndpoint; USB_Descriptor_Endpoint_t MouseInEndpoint;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;

@ -104,11 +104,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioControlInterface_SPC = .AudioControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = sizeof(USB_AudioInterface_AC_t), .TotalLength = sizeof(USB_Audio_Interface_AC_t),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumbers = {1},
@ -132,7 +132,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioStreamInterface_SPC = .AudioStreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_MIDI_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_AudioInterface_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.AudioSpecification = VERSION_BCD(01.00), .AudioSpecification = VERSION_BCD(01.00),
@ -196,7 +196,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Endpoint = .Endpoint =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM), .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
@ -221,7 +221,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Endpoint = .Endpoint =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM), .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),

@ -61,16 +61,16 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t AudioControlInterface; USB_Descriptor_Interface_t AudioControlInterface;
USB_AudioInterface_AC_t AudioControlInterface_SPC; USB_Audio_Interface_AC_t AudioControlInterface_SPC;
USB_Descriptor_Interface_t AudioStreamInterface; USB_Descriptor_Interface_t AudioStreamInterface;
USB_AudioInterface_MIDI_AS_t AudioStreamInterface_SPC; USB_MIDI_AudioInterface_AS_t AudioStreamInterface_SPC;
USB_MIDI_In_Jack_t MIDI_In_Jack_Emb; USB_MIDI_In_Jack_t MIDI_In_Jack_Emb;
USB_MIDI_In_Jack_t MIDI_In_Jack_Ext; USB_MIDI_In_Jack_t MIDI_In_Jack_Ext;
USB_MIDI_Out_Jack_t MIDI_Out_Jack_Emb; USB_MIDI_Out_Jack_t MIDI_Out_Jack_Emb;
USB_MIDI_Out_Jack_t MIDI_Out_Jack_Ext; USB_MIDI_Out_Jack_t MIDI_Out_Jack_Ext;
USB_AudioStreamEndpoint_Std_t MIDI_In_Jack_Endpoint; USB_Audio_StreamEndpoint_Std_t MIDI_In_Jack_Endpoint;
USB_MIDI_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC; USB_MIDI_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC;
USB_AudioStreamEndpoint_Std_t MIDI_Out_Jack_Endpoint; USB_Audio_StreamEndpoint_Std_t MIDI_Out_Jack_Endpoint;
USB_MIDI_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; USB_MIDI_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;

@ -72,7 +72,7 @@ int main(void)
{ {
CheckJoystickMovement(); CheckJoystickMovement();
USB_MIDI_EventPacket_t DummyMIDIEvent; MIDI_EventPacket_t DummyMIDIEvent;
MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &DummyMIDIEvent); MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &DummyMIDIEvent);
MIDI_Device_USBTask(&Keyboard_MIDI_Interface); MIDI_Device_USBTask(&Keyboard_MIDI_Interface);
@ -144,7 +144,7 @@ void CheckJoystickMovement(void)
if (MIDICommand) if (MIDICommand)
{ {
USB_MIDI_EventPacket_t MIDIEvent = (USB_MIDI_EventPacket_t) MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t)
{ {
.CableNumber = 0, .CableNumber = 0,
.Command = (MIDICommand >> 4), .Command = (MIDICommand >> 4),

@ -140,7 +140,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MouseHID = .MouseHID =
{ {
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
@ -237,7 +237,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
break; break;
case DTYPE_HID: case DTYPE_HID:
Address = (void*)&ConfigurationDescriptor.MouseHID; Address = (void*)&ConfigurationDescriptor.MouseHID;
Size = sizeof(USB_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_t);
break; break;
case DTYPE_Report: case DTYPE_Report:
Address = (void*)&MouseReport; Address = (void*)&MouseReport;

@ -51,7 +51,7 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t Interface; USB_Descriptor_Interface_t Interface;
USB_Descriptor_HID_t MouseHID; USB_HID_Descriptor_t MouseHID;
USB_Descriptor_Endpoint_t MouseEndpoint; USB_Descriptor_Endpoint_t MouseEndpoint;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;

@ -104,13 +104,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioControlInterface_SPC = .AudioControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_AudioInterface_AC_t) + .TotalLength = (sizeof(USB_Audio_Interface_AC_t) +
sizeof(USB_AudioInputTerminal_t) + sizeof(USB_Audio_InputTerminal_t) +
sizeof(USB_AudioOutputTerminal_t)), sizeof(USB_Audio_OutputTerminal_t)),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumbers = {1},
@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InputTerminal = .InputTerminal =
{ {
.Header = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_InputTerminal, .Subtype = DSUBTYPE_InputTerminal,
.TerminalID = 0x01, .TerminalID = 0x01,
@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.OutputTerminal = .OutputTerminal =
{ {
.Header = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_OutputTerminal, .Subtype = DSUBTYPE_OutputTerminal,
.TerminalID = 0x02, .TerminalID = 0x02,
@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioStreamInterface_SPC = .AudioStreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.TerminalLink = 0x02, .TerminalLink = 0x02,
@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioFormat = .AudioFormat =
{ {
.Header = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Format, .Subtype = DSUBTYPE_Format,
.FormatType = 0x01, .FormatType = 0x01,
@ -199,7 +199,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.SubFrameSize = 0x02, .SubFrameSize = 0x02,
.BitResolution = 16, .BitResolution = 16,
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)), .SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(Audio_SampleFreq_t)),
.SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)} .SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
}, },
@ -208,7 +208,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Endpoint = .Endpoint =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM), .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA), .Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
@ -222,7 +222,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioEndpoint_SPC = .AudioEndpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.Attributes = 0x00, .Attributes = 0x00,

@ -168,7 +168,7 @@
uint8_t InCollection; /**< Total number of audio class interfaces within this device */ uint8_t InCollection; /**< Total number of audio class interfaces within this device */
uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */ uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */
} USB_AudioInterface_AC_t; } USB_Audio_Interface_AC_t;
/** Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features /** Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features
* are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio * are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
@ -186,7 +186,7 @@
uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */ uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioFeatureUnit_t; } USB_Audio_FeatureUnit_t;
/** Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device /** Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device
* contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example, * contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
@ -207,7 +207,7 @@
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */ uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioInputTerminal_t; } USB_Audio_InputTerminal_t;
/** Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device /** Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device
* contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example, * contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
@ -226,7 +226,7 @@
uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */ uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioOutputTerminal_t; } USB_Audio_OutputTerminal_t;
/** Type define for an Audio class specific streaming interface descriptor. This indicates to the host /** Type define for an Audio class specific streaming interface descriptor. This indicates to the host
* how audio streams within the device are formatted. See the USB Audio specification for more details. * how audio streams within the device are formatted. See the USB Audio specification for more details.
@ -240,7 +240,7 @@
uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */ uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */
uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */ uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */
} USB_AudioInterface_AS_t; } USB_Audio_Interface_AS_t;
/** Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype, /** Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype,
* this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro. * this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro.
@ -249,7 +249,7 @@
{ {
uint16_t LowWord; /**< Low 16 bits of the 24-bit value */ uint16_t LowWord; /**< Low 16 bits of the 24-bit value */
uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */ uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */
} AudioSampleFreq_t; } Audio_SampleFreq_t;
/** Type define for an Audio class specific audio format descriptor. This is used to give the host full details /** Type define for an Audio class specific audio format descriptor. This is used to give the host full details
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used * about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
@ -267,8 +267,8 @@
uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */ uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */
uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */ uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */
AudioSampleFreq_t SampleFrequencies[1]; /**< Sample frequencies supported by the device */ Audio_SampleFreq_t SampleFrequencies[1]; /**< Sample frequencies supported by the device */
} USB_AudioFormat_t; } USB_Audio_Format_t;
/** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint /** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details. * descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details.
@ -279,7 +279,7 @@
uint8_t Refresh; /**< Always set to zero */ uint8_t Refresh; /**< Always set to zero */
uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */ uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */
} USB_AudioStreamEndpoint_Std_t; } USB_Audio_StreamEndpoint_Std_t;
/** Type define for an Audio class specific extended endpoint descriptor. This contains extra information /** Type define for an Audio class specific extended endpoint descriptor. This contains extra information
* on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio * on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
@ -294,7 +294,7 @@
uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */ uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */
uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */ uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */
} USB_AudioStreamEndpoint_Spc_t; } USB_Audio_StreamEndpoint_Spc_t;
/** Type define for the device configuration descriptor structure. This must be defined in the /** Type define for the device configuration descriptor structure. This must be defined in the
* application code, as the configuration descriptor contains several sub-descriptors which * application code, as the configuration descriptor contains several sub-descriptors which
@ -304,15 +304,15 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t AudioControlInterface; USB_Descriptor_Interface_t AudioControlInterface;
USB_AudioInterface_AC_t AudioControlInterface_SPC; USB_Audio_Interface_AC_t AudioControlInterface_SPC;
USB_AudioInputTerminal_t InputTerminal; USB_Audio_InputTerminal_t InputTerminal;
USB_AudioOutputTerminal_t OutputTerminal; USB_Audio_OutputTerminal_t OutputTerminal;
USB_Descriptor_Interface_t AudioStreamInterface_Alt0; USB_Descriptor_Interface_t AudioStreamInterface_Alt0;
USB_Descriptor_Interface_t AudioStreamInterface_Alt1; USB_Descriptor_Interface_t AudioStreamInterface_Alt1;
USB_AudioInterface_AS_t AudioStreamInterface_SPC; USB_Audio_Interface_AS_t AudioStreamInterface_SPC;
USB_AudioFormat_t AudioFormat; USB_Audio_Format_t AudioFormat;
USB_AudioStreamEndpoint_Std_t AudioEndpoint; USB_Audio_StreamEndpoint_Std_t AudioEndpoint;
USB_AudioStreamEndpoint_Spc_t AudioEndpoint_SPC; USB_Audio_StreamEndpoint_Spc_t AudioEndpoint_SPC;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;
/* Function Prototypes: */ /* Function Prototypes: */

@ -104,13 +104,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioControlInterface_SPC = .AudioControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_AudioInterface_AC_t) + .TotalLength = (sizeof(USB_Audio_Interface_AC_t) +
sizeof(USB_AudioInputTerminal_t) + sizeof(USB_Audio_InputTerminal_t) +
sizeof(USB_AudioOutputTerminal_t)), sizeof(USB_Audio_OutputTerminal_t)),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumbers = {1},
@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InputTerminal = .InputTerminal =
{ {
.Header = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_InputTerminal, .Subtype = DSUBTYPE_InputTerminal,
.TerminalID = 0x01, .TerminalID = 0x01,
@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.OutputTerminal = .OutputTerminal =
{ {
.Header = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_OutputTerminal, .Subtype = DSUBTYPE_OutputTerminal,
.TerminalID = 0x02, .TerminalID = 0x02,
@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioStreamInterface_SPC = .AudioStreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.TerminalLink = 0x01, .TerminalLink = 0x01,
@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioFormat = .AudioFormat =
{ {
.Header = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Format, .Subtype = DSUBTYPE_Format,
.FormatType = 0x01, .FormatType = 0x01,
@ -200,7 +200,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.SubFrameSize = 0x02, .SubFrameSize = 0x02,
.BitResolution = 16, .BitResolution = 16,
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)), .SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(Audio_SampleFreq_t)),
.SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)} .SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
}, },
@ -208,7 +208,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Endpoint = .Endpoint =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM), .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA), .Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
@ -222,7 +222,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioEndpoint_SPC = .AudioEndpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.Attributes = EP_ACCEPTS_SMALL_PACKETS, .Attributes = EP_ACCEPTS_SMALL_PACKETS,

@ -168,7 +168,7 @@
uint8_t InCollection; /**< Total number of audio class interfaces within this device */ uint8_t InCollection; /**< Total number of audio class interfaces within this device */
uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */ uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */
} USB_AudioInterface_AC_t; } USB_Audio_Interface_AC_t;
/** Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features /** Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features
* are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio * are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
@ -186,7 +186,7 @@
uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */ uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioFeatureUnit_t; } USB_Audio_FeatureUnit_t;
/** Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device /** Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device
* contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example, * contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
@ -207,7 +207,7 @@
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */ uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioInputTerminal_t; } USB_Audio_InputTerminal_t;
/** Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device /** Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device
* contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example, * contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
@ -226,7 +226,7 @@
uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */ uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioOutputTerminal_t; } USB_Audio_OutputTerminal_t;
/** Type define for an Audio class specific streaming interface descriptor. This indicates to the host /** Type define for an Audio class specific streaming interface descriptor. This indicates to the host
* how audio streams within the device are formatted. See the USB Audio specification for more details. * how audio streams within the device are formatted. See the USB Audio specification for more details.
@ -240,7 +240,7 @@
uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */ uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */
uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */ uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */
} USB_AudioInterface_AS_t; } USB_Audio_Interface_AS_t;
/** Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype, /** Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype,
* this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro. * this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro.
@ -249,7 +249,7 @@
{ {
uint16_t LowWord; /**< Low 16 bits of the 24-bit value */ uint16_t LowWord; /**< Low 16 bits of the 24-bit value */
uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */ uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */
} AudioSampleFreq_t; } Audio_SampleFreq_t;
/** Type define for an Audio class specific audio format descriptor. This is used to give the host full details /** Type define for an Audio class specific audio format descriptor. This is used to give the host full details
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used * about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
@ -267,8 +267,8 @@
uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */ uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */
uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */ uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */
AudioSampleFreq_t SampleFrequencies[1]; /**< Sample frequencies supported by the device */ Audio_SampleFreq_t SampleFrequencies[1]; /**< Sample frequencies supported by the device */
} USB_AudioFormat_t; } USB_Audio_Format_t;
/** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint /** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details. * descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details.
@ -279,7 +279,7 @@
uint8_t Refresh; /**< Always set to zero */ uint8_t Refresh; /**< Always set to zero */
uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */ uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */
} USB_AudioStreamEndpoint_Std_t; } USB_Audio_StreamEndpoint_Std_t;
/** Type define for an Audio class specific extended endpoint descriptor. This contains extra information /** Type define for an Audio class specific extended endpoint descriptor. This contains extra information
* on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio * on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
@ -294,7 +294,7 @@
uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */ uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */
uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */ uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */
} USB_AudioStreamEndpoint_Spc_t; } USB_Audio_StreamEndpoint_Spc_t;
/** Type define for the device configuration descriptor structure. This must be defined in the /** Type define for the device configuration descriptor structure. This must be defined in the
* application code, as the configuration descriptor contains several sub-descriptors which * application code, as the configuration descriptor contains several sub-descriptors which
@ -304,15 +304,15 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t AudioControlInterface; USB_Descriptor_Interface_t AudioControlInterface;
USB_AudioInterface_AC_t AudioControlInterface_SPC; USB_Audio_Interface_AC_t AudioControlInterface_SPC;
USB_AudioInputTerminal_t InputTerminal; USB_Audio_InputTerminal_t InputTerminal;
USB_AudioOutputTerminal_t OutputTerminal; USB_Audio_OutputTerminal_t OutputTerminal;
USB_Descriptor_Interface_t AudioStreamInterface_Alt0; USB_Descriptor_Interface_t AudioStreamInterface_Alt0;
USB_Descriptor_Interface_t AudioStreamInterface_Alt1; USB_Descriptor_Interface_t AudioStreamInterface_Alt1;
USB_AudioInterface_AS_t AudioStreamInterface_SPC; USB_Audio_Interface_AS_t AudioStreamInterface_SPC;
USB_AudioFormat_t AudioFormat; USB_Audio_Format_t AudioFormat;
USB_AudioStreamEndpoint_Std_t AudioEndpoint; USB_Audio_StreamEndpoint_Std_t AudioEndpoint;
USB_AudioStreamEndpoint_Spc_t AudioEndpoint_SPC; USB_Audio_StreamEndpoint_Spc_t AudioEndpoint_SPC;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;
/* Function Prototypes: */ /* Function Prototypes: */

@ -104,11 +104,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioControlInterface_SPC = .AudioControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = sizeof(USB_AudioInterface_AC_t), .TotalLength = sizeof(USB_Audio_Interface_AC_t),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumbers = {1},
@ -132,7 +132,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.AudioStreamInterface_SPC = .AudioStreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_AudioInterface_MIDI_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_MIDI_AS_t), .Type = DTYPE_AudioInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.AudioSpecification = VERSION_BCD(01.00), .AudioSpecification = VERSION_BCD(01.00),
@ -196,7 +196,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Endpoint = .Endpoint =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM), .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
@ -221,7 +221,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Endpoint = .Endpoint =
{ {
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM), .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),

@ -90,7 +90,7 @@
uint8_t InCollection; /** Total number of audio class interfaces within this device */ uint8_t InCollection; /** Total number of audio class interfaces within this device */
uint8_t InterfaceNumbers[1]; /** Interface numbers of each audio interface */ uint8_t InterfaceNumbers[1]; /** Interface numbers of each audio interface */
} USB_AudioInterface_AC_t; } USB_Audio_Interface_AC_t;
/** Type define for an Audio class specific MIDI streaming interface descriptor. This indicates to the host /** Type define for an Audio class specific MIDI streaming interface descriptor. This indicates to the host
* how MIDI the specification compliance of the device and the total length of the Audio class specific descriptors. * how MIDI the specification compliance of the device and the total length of the Audio class specific descriptors.
@ -103,7 +103,7 @@
uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */ uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */
uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */ uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */
} USB_AudioInterface_MIDI_AS_t; } USB_Audio_Interface_MIDI_AS_t;
/** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint /** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details. * descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details.
@ -114,7 +114,7 @@
uint8_t Refresh; /**< Always set to zero */ uint8_t Refresh; /**< Always set to zero */
uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */ uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */
} USB_AudioStreamEndpoint_Std_t; } USB_Audio_StreamEndpoint_Std_t;
/** Type define for an Audio class specific MIDI IN jack. This gives information to the host on a MIDI input, either /** Type define for an Audio class specific MIDI IN jack. This gives information to the host on a MIDI input, either
* a physical input jack, or a logical jack (receiving input data internally, or from the host via an endpoint). * a physical input jack, or a logical jack (receiving input data internally, or from the host via an endpoint).
@ -169,16 +169,16 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t AudioControlInterface; USB_Descriptor_Interface_t AudioControlInterface;
USB_AudioInterface_AC_t AudioControlInterface_SPC; USB_Audio_Interface_AC_t AudioControlInterface_SPC;
USB_Descriptor_Interface_t AudioStreamInterface; USB_Descriptor_Interface_t AudioStreamInterface;
USB_AudioInterface_MIDI_AS_t AudioStreamInterface_SPC; USB_Audio_Interface_MIDI_AS_t AudioStreamInterface_SPC;
USB_MIDI_In_Jack_t MIDI_In_Jack_Emb; USB_MIDI_In_Jack_t MIDI_In_Jack_Emb;
USB_MIDI_In_Jack_t MIDI_In_Jack_Ext; USB_MIDI_In_Jack_t MIDI_In_Jack_Ext;
USB_MIDI_Out_Jack_t MIDI_Out_Jack_Emb; USB_MIDI_Out_Jack_t MIDI_Out_Jack_Emb;
USB_MIDI_Out_Jack_t MIDI_Out_Jack_Ext; USB_MIDI_Out_Jack_t MIDI_Out_Jack_Ext;
USB_AudioStreamEndpoint_Std_t MIDI_In_Jack_Endpoint; USB_Audio_StreamEndpoint_Std_t MIDI_In_Jack_Endpoint;
USB_MIDI_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC; USB_MIDI_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC;
USB_AudioStreamEndpoint_Std_t MIDI_Out_Jack_Endpoint; USB_Audio_StreamEndpoint_Std_t MIDI_Out_Jack_Endpoint;
USB_MIDI_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; USB_MIDI_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;

@ -269,7 +269,7 @@ SUBGROUPING = YES
# be useful for C code in case the coding convention dictates that all compound # be useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name. # types are typedef'ed and only the typedef is referenced, never the tag name.
TYPEDEF_HIDES_STRUCT = NO TYPEDEF_HIDES_STRUCT = YES
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk. # determine which symbols to keep in memory and which to flush to disk.

@ -46,6 +46,13 @@
#endif #endif
/* Macros: */ /* Macros: */
#if !defined(AUDIO_TOTAL_SAMPLE_RATES) || defined(__DOXYGEN__)
/** Total number of discrete audio sample rates supported by the device. This value can be overridden by defining this
* token in the project makefile to the desired value, and passing it to the compiler via the -D switch.
*/
#define AUDIO_TOTAL_SAMPLE_RATES 1
#endif
/** Descriptor header constant to indicate a Audio class interface descriptor. */ /** Descriptor header constant to indicate a Audio class interface descriptor. */
#define DTYPE_AudioInterface 0x24 #define DTYPE_AudioInterface 0x24
@ -223,7 +230,7 @@
uint8_t InCollection; /**< Total number of audio class interfaces within this device */ uint8_t InCollection; /**< Total number of audio class interfaces within this device */
uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */ uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */
} USB_AudioInterface_AC_t; } USB_Audio_Interface_AC_t;
/** Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features /** Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features
* are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio * are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
@ -241,7 +248,7 @@
uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */ uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioFeatureUnit_t; } USB_Audio_FeatureUnit_t;
/** Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device /** Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device
* contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example, * contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
@ -262,7 +269,7 @@
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */ uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioInputTerminal_t; } USB_Audio_InputTerminal_t;
/** Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device /** Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device
* contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example, * contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
@ -281,7 +288,7 @@
uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */ uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */ uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
} USB_AudioOutputTerminal_t; } USB_Audio_OutputTerminal_t;
/** Type define for an Audio class specific streaming interface descriptor. This indicates to the host /** Type define for an Audio class specific streaming interface descriptor. This indicates to the host
* how audio streams within the device are formatted. See the USB Audio specification for more details. * how audio streams within the device are formatted. See the USB Audio specification for more details.
@ -295,7 +302,7 @@
uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */ uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */
uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */ uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */
} USB_AudioInterface_AS_t; } USB_Audio_Interface_AS_t;
/** Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype, /** Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype,
* this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro. * this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro.
@ -304,7 +311,7 @@
{ {
uint16_t LowWord; /**< Low 16 bits of the 24-bit value */ uint16_t LowWord; /**< Low 16 bits of the 24-bit value */
uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */ uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */
} AudioSampleFreq_t; } USB_Audio_SampleFreq_t;
/** Type define for an Audio class specific audio format descriptor. This is used to give the host full details /** Type define for an Audio class specific audio format descriptor. This is used to give the host full details
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used * about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
@ -322,8 +329,8 @@
uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */ uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */
uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */ uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */
AudioSampleFreq_t SampleFrequencies[1]; /**< Sample frequencies supported by the device */ USB_Audio_SampleFreq_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES]; /**< Sample frequencies supported by the device */
} USB_AudioFormat_t; } USB_Audio_Format_t;
/** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint /** Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details. * descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details.
@ -334,7 +341,7 @@
uint8_t Refresh; /**< Always set to zero */ uint8_t Refresh; /**< Always set to zero */
uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */ uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronisation information to, if needed (zero otherwise) */
} USB_AudioStreamEndpoint_Std_t; } USB_Audio_StreamEndpoint_Std_t;
/** Type define for an Audio class specific extended endpoint descriptor. This contains extra information /** Type define for an Audio class specific extended endpoint descriptor. This contains extra information
* on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio * on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
@ -349,7 +356,7 @@
uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */ uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */
uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */ uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */
} USB_AudioStreamEndpoint_Spc_t; } USB_Audio_StreamEndpoint_Spc_t;
/* Disable C linkage for C++ Compilers: */ /* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)

@ -80,7 +80,7 @@
uint8_t HIDReportType; uint8_t HIDReportType;
uint16_t HIDReportLength; uint16_t HIDReportLength;
} USB_Descriptor_HID_t; } USB_HID_Descriptor_t;
/** Type define for the data type used to store HID report descriptor elements. */ /** Type define for the data type used to store HID report descriptor elements. */
typedef uint8_t USB_Descriptor_HIDReport_Datatype_t; typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;

@ -87,7 +87,7 @@
uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */ uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */
uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */ uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */
} USB_AudioInterface_MIDI_AS_t; } USB_MIDI_AudioInterface_AS_t;
/** Type define for an Audio class specific MIDI IN jack. This gives information to the host on a MIDI input, either /** Type define for an Audio class specific MIDI IN jack. This gives information to the host on a MIDI input, either
* a physical input jack, or a logical jack (receiving input data internally, or from the host via an endpoint). * a physical input jack, or a logical jack (receiving input data internally, or from the host via an endpoint).
@ -143,7 +143,7 @@
uint8_t Data1; /**< First byte of data in the MIDI event */ uint8_t Data1; /**< First byte of data in the MIDI event */
uint8_t Data2; /**< Second byte of data in the MIDI event */ uint8_t Data2; /**< Second byte of data in the MIDI event */
uint8_t Data3; /**< Third byte of data in the MIDI event */ uint8_t Data3; /**< Third byte of data in the MIDI event */
} USB_MIDI_EventPacket_t; } MIDI_EventPacket_t;
/* Disable C linkage for C++ Compilers: */ /* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)

@ -75,7 +75,7 @@
uint8_t LUN; /**< Logical Unit number this command is issued to */ uint8_t LUN; /**< Logical Unit number this command is issued to */
uint8_t SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array */ uint8_t SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array */
uint8_t SCSICommandData[16]; /**< Issued SCSI command in the Command Block */ uint8_t SCSICommandData[16]; /**< Issued SCSI command in the Command Block */
} CommandBlockWrapper_t; } MS_CommandBlockWrapper_t;
/** Type define for a Command Status Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */ /** Type define for a Command Status Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
typedef struct typedef struct
@ -84,7 +84,7 @@
uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper */ uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper */
uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command */ uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command */
uint8_t Status; /**< Status code of the issued command - a value from the MassStorage_CommandStatusCodes_t enum */ uint8_t Status; /**< Status code of the issued command - a value from the MassStorage_CommandStatusCodes_t enum */
} CommandStatusWrapper_t; } MS_CommandStatusWrapper_t;
/* Enums: */ /* Enums: */
/** Enum for the possible command status wrapper return status codes. */ /** Enum for the possible command status wrapper return status codes. */

@ -93,13 +93,6 @@
uint8_t Octets[6]; /**< Individual bytes of a MAC address */ uint8_t Octets[6]; /**< Individual bytes of a MAC address */
} MAC_Address_t; } MAC_Address_t;
/** Type define for a RNDIS message header, sent before RNDIS messages */
typedef struct
{
uint32_t MessageType; /**< RNDIS message type, a REMOTE_NDIS_*_MSG constant */
uint32_t MessageLength; /**< Total length of the RNDIS message, in bytes */
} RNDIS_Message_Header_t;
/** Type define for an Ethernet frame buffer. */ /** Type define for an Ethernet frame buffer. */
typedef struct typedef struct
{ {
@ -108,6 +101,13 @@
bool FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer */ bool FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer */
} Ethernet_Frame_Info_t; } Ethernet_Frame_Info_t;
/** Type define for a RNDIS message header, sent before RNDIS messages */
typedef struct
{
uint32_t MessageType; /**< RNDIS message type, a REMOTE_NDIS_*_MSG constant */
uint32_t MessageLength; /**< Total length of the RNDIS message, in bytes */
} RNDIS_Message_Header_t;
/** Type define for a RNDIS packet message, used to encapsulate Ethernet packets sent to and from the adapter */ /** Type define for a RNDIS packet message, used to encapsulate Ethernet packets sent to and from the adapter */
typedef struct typedef struct
{ {

@ -53,8 +53,13 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Configuration information structure for \ref USB_ClassInfo_Audio_Device_t Audio device interface structures. */ /** Class state structure. An instance of this structure should be made for each Audio interface
* within the user application, and passed to each of the Audio class driver functions as the
* AudioInterfaceInfo parameter. This stores each Audio interface's configuration and state information.
*/
typedef struct typedef struct
{
const struct
{ {
uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this
* structure controls. * structure controls.
@ -73,32 +78,16 @@
uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing Audio Streaming data endpoint, if available uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing Audio Streaming data endpoint, if available
* (zero if unused). * (zero if unused).
*/ */
} USB_ClassInfo_Audio_Device_Config_t; } Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
/** Current State information structure for \ref USB_ClassInfo_Audio_Device_t Audio device interface structures. */ */
typedef struct struct
{ {
bool InterfaceEnabled; /**< Set and cleared by the class driver to indicate if the host has enabled the streaming endpoints bool InterfaceEnabled; /**< Set and cleared by the class driver to indicate if the host has enabled the streaming endpoints
* of the Audio Streaming interface. * of the Audio Streaming interface.
*/ */
} USB_ClassInfo_Audio_Device_State_t; } State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
/** Class state structure. An instance of this structure should be made for each Audio interface
* within the user application, and passed to each of the Audio class driver functions as the
* AudioInterfaceInfo parameter. This stores each Audio interface's configuration and state information.
*/
typedef struct
{
const USB_ClassInfo_Audio_Device_Config_t Config; /**< Config data for the USB class interface within
* the device. All elements in this section
* <b>must</b> be set or the interface will fail
* to enumerate and operate correctly.
*/
USB_ClassInfo_Audio_Device_State_t State; /**< State data for the USB class interface within
* the device. All elements in this section
* <b>may</b> be set to initial values, but may
* also be ignored to default to sane values when
* the interface is enumerated. * the interface is enumerated.
*/ */
} USB_ClassInfo_Audio_Device_t; } USB_ClassInfo_Audio_Device_t;

@ -53,8 +53,13 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Configuration information structure for \ref USB_ClassInfo_CDC_Device_t CDC device interface structures. */ /** Class state structure. An instance of this structure should be made for each CDC interface
* within the user application, and passed to each of the CDC class driver functions as the
* CDCInterfaceInfo parameter. This stores each CDC interface's configuration and state information.
*/
typedef struct typedef struct
{
const struct
{ {
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */ uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */
@ -66,10 +71,10 @@
uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */ uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */
uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used */ uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used */
} USB_ClassInfo_CDC_Device_Config_t; } Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
/** Current State information structure for \ref USB_ClassInfo_CDC_Device_t CDC device interface structures. */ */
typedef struct struct
{ {
struct struct
{ {
@ -92,24 +97,8 @@
*/ */
uint8_t DataBits; /**< Bits of data per character of the virtual serial port */ uint8_t DataBits; /**< Bits of data per character of the virtual serial port */
} LineEncoding; } LineEncoding;
} USB_ClassInfo_CDC_Device_State_t; } State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
/** Class state structure. An instance of this structure should be made for each CDC interface
* within the user application, and passed to each of the CDC class driver functions as the
* CDCInterfaceInfo parameter. This stores each CDC interface's configuration and state information.
*/
typedef struct
{
const USB_ClassInfo_CDC_Device_Config_t Config; /**< Config data for the USB class interface within
* the device. All elements in this section
* <b>must</b> be set or the interface will fail
* to enumerate and operate correctly.
*/
USB_ClassInfo_CDC_Device_State_t State; /**< State data for the USB class interface within
* the device. All elements in this section
* <b>may</b> be set to initial values, but may
* also be ignored to default to sane values when
* the interface is enumerated. * the interface is enumerated.
*/ */
} USB_ClassInfo_CDC_Device_t; } USB_ClassInfo_CDC_Device_t;

@ -53,8 +53,13 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Configuration information structure for \ref USB_ClassInfo_HID_Device_t HID device interface structures. */ /** Class state structure. An instance of this structure should be made for each HID interface
* within the user application, and passed to each of the HID class driver functions as the
* HIDInterfaceInfo parameter. This stores each HID interface's configuration and state information.
*/
typedef struct typedef struct
{
const struct
{ {
uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device */ uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device */
@ -64,33 +69,17 @@
uint8_t ReportINBufferSize; /**< Size of the largest possible report to send to the host, for uint8_t ReportINBufferSize; /**< Size of the largest possible report to send to the host, for
* buffer allocation purposes * buffer allocation purposes
*/ */
} USB_ClassInfo_HID_Device_Config_t; } Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
/** Current State information structure for \ref USB_ClassInfo_HID_Device_t HID device interface structures. */ */
typedef struct struct
{ {
bool UsingReportProtocol; /**< Indicates if the HID interface is set to Boot or Report protocol mode */ bool UsingReportProtocol; /**< Indicates if the HID interface is set to Boot or Report protocol mode */
uint16_t IdleCount; /**< Report idle period, in ms, set by the host */ uint16_t IdleCount; /**< Report idle period, in ms, set by the host */
uint16_t IdleMSRemaining; /**< Total number of ms remaining before the idle period elapsed - this should be uint16_t IdleMSRemaining; /**< Total number of ms remaining before the idle period elapsed - this should be
* decremented by the user application if non-zero each millisecond */ * decremented by the user application if non-zero each millisecond */
} USB_ClassInfo_HID_Device_State_t; } State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
/** Class state structure. An instance of this structure should be made for each HID interface
* within the user application, and passed to each of the HID class driver functions as the
* HIDInterfaceInfo parameter. This stores each HID interface's configuration and state information.
*/
typedef struct
{
const USB_ClassInfo_HID_Device_Config_t Config; /**< Config data for the USB class interface within
* the device. All elements in this section
* <b>must</b> be set or the interface will fail
* to enumerate and operate correctly.
*/
USB_ClassInfo_HID_Device_State_t State; /**< State data for the USB class interface within
* the device. All elements in this section
* <b>may</b> be set to initial values, but may
* also be ignored to default to sane values when
* the interface is enumerated. * the interface is enumerated.
*/ */
} USB_ClassInfo_HID_Device_t; } USB_ClassInfo_HID_Device_t;

@ -68,7 +68,7 @@ void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo)
} }
void MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event) void MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo, MIDI_EventPacket_t* Event)
{ {
if (!(USB_IsConnected)) if (!(USB_IsConnected))
return; return;
@ -77,12 +77,12 @@ void MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo,
if (Endpoint_IsReadWriteAllowed()); if (Endpoint_IsReadWriteAllowed());
{ {
Endpoint_Write_Stream_LE(Event, sizeof(USB_MIDI_EventPacket_t), NO_STREAM_CALLBACK); Endpoint_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
} }
bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event) bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo, MIDI_EventPacket_t* Event)
{ {
if (!(USB_IsConnected)) if (!(USB_IsConnected))
return false; return false;
@ -92,7 +92,7 @@ bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceIn
if (!(Endpoint_IsReadWriteAllowed())) if (!(Endpoint_IsReadWriteAllowed()))
return false; return false;
Endpoint_Read_Stream_LE(Event, sizeof(USB_MIDI_EventPacket_t), NO_STREAM_CALLBACK); Endpoint_Read_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NO_STREAM_CALLBACK);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
return true; return true;

@ -55,7 +55,18 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Define: */ /* Type Define: */
/** Configuration information structure for \ref USB_ClassInfo_MIDI_Device_t MIDI device interface structures. */ /** Configuration information structure for \ref USB_ClassInfo_MIDI_Device_t MIDI device interface structures. */
typedef USB_ClassInfo_MIDI_Device_Config_t;
/** Current State information structure for \ref USB_ClassInfo_MIDI_Device_t MIDI device interface structures. */
typedef USB_ClassInfo_MIDI_Device_State_t;
/** Class state structure. An instance of this structure should be made for each MIDI interface
* within the user application, and passed to each of the MIDI class driver functions as the
* MIDIInterfaceInfo parameter. This stores each MIDI interface's configuration and state information.
*/
typedef struct typedef struct
{
const struct
{ {
uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this structure controls */ uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this structure controls */
@ -64,30 +75,14 @@
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing MIDI data, if available (zero if unused) */ uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing MIDI data, if available (zero if unused) */
uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing MIDI data endpoint, if available (zero if unused) */ uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing MIDI data endpoint, if available (zero if unused) */
} USB_ClassInfo_MIDI_Device_Config_t; } Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
/** Current State information structure for \ref USB_ClassInfo_MIDI_Device_t MIDI device interface structures. */
typedef struct
{
// No state information for this class yet
} USB_ClassInfo_MIDI_Device_State_t;
/** Class state structure. An instance of this structure should be made for each MIDI interface
* within the user application, and passed to each of the MIDI class driver functions as the
* MIDIInterfaceInfo parameter. This stores each MIDI interface's configuration and state information.
*/ */
typedef struct struct
{ {
const USB_ClassInfo_MIDI_Device_Config_t Config; /**< Config data for the USB class interface within // No state information for this class yet
* the device. All elements in this section } State; /**< State data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail * <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* to enumerate and operate correctly.
*/
USB_ClassInfo_MIDI_Device_State_t State; /**< State data for the USB class interface within
* the device. All elements in this section
* <b>may</b> be set to initial values, but may
* also be ignored to default to sane values when
* the interface is enumerated. * the interface is enumerated.
*/ */
} USB_ClassInfo_MIDI_Device_t; } USB_ClassInfo_MIDI_Device_t;
@ -122,7 +117,7 @@
* \param MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state. * \param MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
* \param Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send * \param Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send
*/ */
void MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event); void MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo, MIDI_EventPacket_t* Event);
/** Receives a MIDI event packet from the host. /** Receives a MIDI event packet from the host.
* *
@ -131,7 +126,7 @@
* *
* \return Boolean true if a MIDI event packet was received, false otherwise * \return Boolean true if a MIDI event packet was received, false otherwise
*/ */
bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event); bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* MIDIInterfaceInfo, MIDI_EventPacket_t* Event);
/* Disable C linkage for C++ Compilers: */ /* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)

@ -144,7 +144,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* MSInterfaceI
CallbackMSInterfaceInfo = MSInterfaceInfo; CallbackMSInterfaceInfo = MSInterfaceInfo;
Endpoint_Read_Stream_LE(&MSInterfaceInfo->State.CommandBlock, Endpoint_Read_Stream_LE(&MSInterfaceInfo->State.CommandBlock,
(sizeof(CommandBlockWrapper_t) - 16), (sizeof(MS_CommandBlockWrapper_t) - 16),
StreamCallback_MS_Device_AbortOnMassStoreReset); StreamCallback_MS_Device_AbortOnMassStoreReset);
if ((MSInterfaceInfo->State.CommandBlock.Signature != MS_CBW_SIGNATURE) || if ((MSInterfaceInfo->State.CommandBlock.Signature != MS_CBW_SIGNATURE) ||
@ -194,7 +194,7 @@ static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* MSInterface
} }
CallbackMSInterfaceInfo = MSInterfaceInfo; CallbackMSInterfaceInfo = MSInterfaceInfo;
Endpoint_Write_Stream_LE(&MSInterfaceInfo->State.CommandStatus, sizeof(CommandStatusWrapper_t), Endpoint_Write_Stream_LE(&MSInterfaceInfo->State.CommandStatus, sizeof(MS_CommandStatusWrapper_t),
StreamCallback_MS_Device_AbortOnMassStoreReset); StreamCallback_MS_Device_AbortOnMassStoreReset);
Endpoint_ClearIN(); Endpoint_ClearIN();

@ -53,8 +53,13 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Configuration information structure for \ref USB_ClassInfo_MS_Device_t Mass Storage device interface structures. */ /** Class state structure. An instance of this structure should be made for each Mass Storage interface
* within the user application, and passed to each of the Mass Storage class driver functions as the
* MSInterfaceInfo parameter. This stores each Mass Storage interface's configuration and state information.
*/
typedef struct typedef struct
{
const struct
{ {
uint8_t InterfaceNumber; /**< Interface number of the Mass Storage interface within the device */ uint8_t InterfaceNumber; /**< Interface number of the Mass Storage interface within the device */
@ -65,39 +70,22 @@
uint16_t DataOUTEndpointSize; /**< Size in bytes of the Mass Storage interface's OUT data endpoint */ uint16_t DataOUTEndpointSize; /**< Size in bytes of the Mass Storage interface's OUT data endpoint */
uint8_t TotalLUNs; /**< Total number of logical drives in the Mass Storage interface */ uint8_t TotalLUNs; /**< Total number of logical drives in the Mass Storage interface */
} USB_ClassInfo_MS_Device_Config_t; } Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
/** Current State information structure for \ref USB_ClassInfo_MS_Device_t Mass Storage device interface structures. */ */
typedef struct struct
{ {
CommandBlockWrapper_t CommandBlock; /**< Mass Storage class command block structure, stores the received SCSI MS_CommandBlockWrapper_t CommandBlock; /**< Mass Storage class command block structure, stores the received SCSI
* command from the host which is to be processed * command from the host which is to be processed
*/ */
CommandStatusWrapper_t CommandStatus; /**< Mass Storage class command status structure, set elements to indicate MS_CommandStatusWrapper_t CommandStatus; /**< Mass Storage class command status structure, set elements to indicate
* the issued command's success or failure to the host * the issued command's success or failure to the host
*/ */
bool IsMassStoreReset; /**< Flag indicating that the host has requested that the Mass Storage interface be reset bool IsMassStoreReset; /**< Flag indicating that the host has requested that the Mass Storage interface be reset
* and that all current Mass Storage operations should immediately abort * and that all current Mass Storage operations should immediately abort
*/ */
} USB_ClassInfo_MS_Device_State_t; } State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
/** Class state structure. An instance of this structure should be made for each Mass Storage interface
* within the user application, and passed to each of the Mass Storage class driver functions as the
* MSInterfaceInfo parameter. This stores each Mass Storage interface's configuration and state information.
*/
typedef struct
{
const USB_ClassInfo_MS_Device_Config_t Config; /**< Config data for the USB class interface within
* the device. All elements in this section
* <b>must</b> be set or the interface will fail
* to enumerate and operate correctly.
*/
USB_ClassInfo_MS_Device_State_t State; /**< State data for the USB class interface within
* the device. All elements in this section
* <b>may</b> be set to initial values, but may
* also be ignored to default to sane values when
* the interface is enumerated. * the interface is enumerated.
*/ */
} USB_ClassInfo_MS_Device_t; } USB_ClassInfo_MS_Device_t;

@ -54,8 +54,13 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Configuration information structure for \ref USB_ClassInfo_RNDIS_Device_t RNDIS device interface structures. */ /** Class state structure. An instance of this structure should be made for each RNDIS interface
* within the user application, and passed to each of the RNDIS class driver functions as the
* RNDISInterfaceInfo parameter. This stores each RNDIS interface's configuration and state information.
*/
typedef struct typedef struct
{
const struct
{ {
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */ uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */
@ -70,10 +75,10 @@
char* AdapterVendorDescription; /**< String description of the adapter vendor */ char* AdapterVendorDescription; /**< String description of the adapter vendor */
MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter */ MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter */
} USB_ClassInfo_MS_Device_Config_t; } Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
/** Current State information structure for \ref USB_ClassInfo_RNDIS_Device_t RNDIS device interface structures. */ */
typedef struct struct
{ {
uint8_t RNDISMessageBuffer[RNDIS_MESSAGE_BUFFER_SIZE]; /**< Buffer to hold RNDIS messages to and from the host, uint8_t RNDISMessageBuffer[RNDIS_MESSAGE_BUFFER_SIZE]; /**< Buffer to hold RNDIS messages to and from the host,
* managed by the class driver * managed by the class driver
@ -87,24 +92,8 @@
Ethernet_Frame_Info_t FrameOUT; /**< Structure holding the next Ethernet frame to send to the host, populated by the Ethernet_Frame_Info_t FrameOUT; /**< Structure holding the next Ethernet frame to send to the host, populated by the
* user application * user application
*/ */
} USB_ClassInfo_MS_Device_State_t; } State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
/** Class state structure. An instance of this structure should be made for each RNDIS interface
* within the user application, and passed to each of the RNDIS class driver functions as the
* RNDISInterfaceInfo parameter. This stores each RNDIS interface's configuration and state information.
*/
typedef struct
{
const USB_ClassInfo_MS_Device_Config_t Config; /**< Config data for the USB class interface within
* the device. All elements in this section
* <b>must</b> be set or the interface will fail
* to enumerate and operate correctly.
*/
USB_ClassInfo_MS_Device_State_t State; /**< State data for the USB class interface within
* the device. All elements in this section
* <b>may</b> be set to initial values, but may
* also be ignored to default to sane values when
* the interface is enumerated. * the interface is enumerated.
*/ */
} USB_ClassInfo_RNDIS_Device_t; } USB_ClassInfo_RNDIS_Device_t;

@ -51,16 +51,21 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Configuration information structure for \ref USB_ClassInfo_CDC_Host_t CDC host interface structures. */ /** Class state structure. An instance of this structure should be made within the user application,
* and passed to each of the CDC class driver functions as the CDCInterfaceInfo parameter. This
* stores each CDC interface's configuration and state information.
*/
typedef struct typedef struct
{
const struct
{ {
uint8_t DataINPipeNumber; /**< Pipe number of the CDC interface's IN data pipe */ uint8_t DataINPipeNumber; /**< Pipe number of the CDC interface's IN data pipe */
uint8_t DataOUTPipeNumber; /**< Pipe number of the CDC interface's OUT data pipe */ uint8_t DataOUTPipeNumber; /**< Pipe number of the CDC interface's OUT data pipe */
uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used */ uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used */
} USB_ClassInfo_CDC_Host_Config_t; } Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
/** Current State information structure for \ref USB_ClassInfo_CDC_Host_t CDC host interface structures. */ */
typedef struct struct
{ {
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */ uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */
@ -91,24 +96,8 @@
*/ */
uint8_t DataBits; /**< Bits of data per character of the virtual serial port */ uint8_t DataBits; /**< Bits of data per character of the virtual serial port */
} LineEncoding; } LineEncoding;
} USB_ClassInfo_CDC_Host_State_t; } State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
/** Class state structure. An instance of this structure should be made within the user application,
* and passed to each of the CDC class driver functions as the CDCInterfaceInfo parameter. This
* stores each CDC interface's configuration and state information.
*/
typedef struct
{
const USB_ClassInfo_CDC_Host_Config_t Config; /**< Config data for the USB class interface within
* the device. All elements in this section
* <b>must</b> be set or the interface will fail
* to enumerate and operate correctly.
*/
USB_ClassInfo_CDC_Host_State_t State; /**< State data for the USB class interface within
* the device. All elements in this section
* <b>may</b> be set to initial values, but may
* also be ignored to default to sane values when
* the interface is enumerated. * the interface is enumerated.
*/ */
} USB_ClassInfo_CDC_Host_t; } USB_ClassInfo_CDC_Host_t;

@ -138,7 +138,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.KeyboardHID = .KeyboardHID =
{ {
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_t), .Type = DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
@ -234,7 +234,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
break; break;
case DTYPE_HID: case DTYPE_HID:
Address = (void*)&ConfigurationDescriptor.KeyboardHID; Address = (void*)&ConfigurationDescriptor.KeyboardHID;
Size = sizeof(USB_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_t);
break; break;
case DTYPE_Report: case DTYPE_Report:
Address = (void*)&KeyboardReport; Address = (void*)&KeyboardReport;

@ -52,7 +52,7 @@
{ {
USB_Descriptor_Configuration_Header_t Config; /**< Configuration descriptor header structure */ USB_Descriptor_Configuration_Header_t Config; /**< Configuration descriptor header structure */
USB_Descriptor_Interface_t Interface; /**< Keyboard interface descriptor */ USB_Descriptor_Interface_t Interface; /**< Keyboard interface descriptor */
USB_Descriptor_HID_t KeyboardHID; /**< Keyboard HID descriptor */ USB_HID_Descriptor_t KeyboardHID; /**< Keyboard HID descriptor */
USB_Descriptor_Endpoint_t KeyboardEndpoint; /**< Keyboard key report endpoint descriptor */ USB_Descriptor_Endpoint_t KeyboardEndpoint; /**< Keyboard key report endpoint descriptor */
} USB_Descriptor_Configuration_t; } USB_Descriptor_Configuration_t;

Loading…
Cancel
Save