Move out many of the common class driver constants into grouped enums, to make them more managable.

Add new CDC descriptor structs to the CDC class driver, so that the CDC demos can use human readable field names.

Rename prefix for Still Image Host class driver functions from "SImage_" to "SI_" to remain consistent with the rest of the driver.
pull/1469/head
Dean Camera 14 years ago
parent 800485bd95
commit 713670043a

@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_ControlInterface_SPC = .Audio_ControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Header, .Subtype = AUDIO_DSUBTYPE_CSInterface_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_Audio_Descriptor_Interface_AC_t) + .TotalLength = (sizeof(USB_Audio_Descriptor_Interface_AC_t) +
@ -113,13 +113,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
sizeof(USB_Audio_Descriptor_OutputTerminal_t)), sizeof(USB_Audio_Descriptor_OutputTerminal_t)),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumber = 1,
}, },
.Audio_InputTerminal = .Audio_InputTerminal =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputTerminal, .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
.TerminalID = 0x01, .TerminalID = 0x01,
.TerminalType = TERMINAL_IN_MIC, .TerminalType = TERMINAL_IN_MIC,
@ -134,8 +134,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_OutputTerminal = .Audio_OutputTerminal =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputTerminal, .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
.TerminalID = 0x02, .TerminalID = 0x02,
.TerminalType = TERMINAL_STREAMING, .TerminalType = TERMINAL_STREAMING,
@ -180,8 +180,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamInterface_SPC = .Audio_StreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_General, .Subtype = AUDIO_DSUBTYPE_CSInterface_General,
.TerminalLink = 0x02, .TerminalLink = 0x02,
@ -191,8 +191,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_AudioFormat = .Audio_AudioFormat =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Format, .Subtype = AUDIO_DSUBTYPE_CSInterface_FormatType,
.FormatType = 0x01, .FormatType = 0x01,
.Channels = 0x01, .Channels = 0x01,
@ -222,8 +222,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamEndpoint_SPC = .Audio_StreamEndpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
.Attributes = 0x00, .Attributes = 0x00,

@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_ControlInterface_SPC = .Audio_ControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Header, .Subtype = AUDIO_DSUBTYPE_CSInterface_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_Audio_Descriptor_Interface_AC_t) + .TotalLength = (sizeof(USB_Audio_Descriptor_Interface_AC_t) +
@ -113,13 +113,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
sizeof(USB_Audio_Descriptor_OutputTerminal_t)), sizeof(USB_Audio_Descriptor_OutputTerminal_t)),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumber = 1,
}, },
.Audio_InputTerminal = .Audio_InputTerminal =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputTerminal, .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
.TerminalID = 0x01, .TerminalID = 0x01,
.TerminalType = TERMINAL_STREAMING, .TerminalType = TERMINAL_STREAMING,
@ -134,8 +134,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_OutputTerminal = .Audio_OutputTerminal =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputTerminal, .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
.TerminalID = 0x02, .TerminalID = 0x02,
.TerminalType = TERMINAL_OUT_SPEAKER, .TerminalType = TERMINAL_OUT_SPEAKER,
@ -180,8 +180,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamInterface_SPC = .Audio_StreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_General, .Subtype = AUDIO_DSUBTYPE_CSInterface_General,
.TerminalLink = 0x01, .TerminalLink = 0x01,
@ -191,8 +191,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_AudioFormat = .Audio_AudioFormat =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Format, .Subtype = AUDIO_DSUBTYPE_CSInterface_FormatType,
.FormatType = 0x01, .FormatType = 0x01,
.Channels = 0x02, .Channels = 0x02,
@ -222,8 +222,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamEndpoint_SPC = .Audio_StreamEndpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
.Attributes = EP_ACCEPTS_SMALL_PACKETS, .Attributes = EP_ACCEPTS_SMALL_PACKETS,

@ -128,28 +128,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.CDC1_Functional_IntHeader = .CDC1_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC1_Functional_AbstractControlManagement = .CDC1_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x06} .Capabilities = 0x06,
}, },
.CDC1_Functional_Union = .CDC1_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x00, 0x01} .MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
}, },
.CDC1_ManagementEndpoint = .CDC1_ManagementEndpoint =
@ -228,28 +229,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.CDC2_Functional_IntHeader = .CDC2_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC2_Functional_AbstractControlManagement = .CDC2_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x06} .Capabilities = 0x06,
}, },
.CDC2_Functional_Union = .CDC2_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x02, 0x03} .MasterInterfaceNumber = 2,
.SlaveInterfaceNumber = 3,
}, },
.CDC2_ManagementEndpoint = .CDC2_ManagementEndpoint =

@ -77,18 +77,18 @@
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_Association_t CDC1_IAD; USB_Descriptor_Interface_Association_t CDC1_IAD;
USB_Descriptor_Interface_t CDC1_CCI_Interface; USB_Descriptor_Interface_t CDC1_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC1_Functional_IntHeader; USB_CDC_Descriptor_FunctionalHeader_t CDC1_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC1_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC1_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC1_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC1_Functional_Union;
USB_Descriptor_Endpoint_t CDC1_ManagementEndpoint; USB_Descriptor_Endpoint_t CDC1_ManagementEndpoint;
USB_Descriptor_Interface_t CDC1_DCI_Interface; USB_Descriptor_Interface_t CDC1_DCI_Interface;
USB_Descriptor_Endpoint_t CDC1_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC1_DataOutEndpoint;
USB_Descriptor_Endpoint_t CDC1_DataInEndpoint; USB_Descriptor_Endpoint_t CDC1_DataInEndpoint;
USB_Descriptor_Interface_Association_t CDC2_IAD; USB_Descriptor_Interface_Association_t CDC2_IAD;
USB_Descriptor_Interface_t CDC2_CCI_Interface; USB_Descriptor_Interface_t CDC2_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC2_Functional_IntHeader; USB_CDC_Descriptor_FunctionalHeader_t CDC2_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC2_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC2_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC2_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC2_Functional_Union;
USB_Descriptor_Endpoint_t CDC2_ManagementEndpoint; USB_Descriptor_Endpoint_t CDC2_ManagementEndpoint;
USB_Descriptor_Interface_t CDC2_DCI_Interface; USB_Descriptor_Interface_t CDC2_DCI_Interface;
USB_Descriptor_Endpoint_t CDC2_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC2_DataOutEndpoint;

@ -123,19 +123,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x00, .SubClass = 0x00,
.Protocol = HID_NON_BOOT_PROTOCOL, .Protocol = HID_BOOTP_NonBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID_GenericHID = .HID_GenericHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(GenericReport) .HIDReportLength = sizeof(GenericReport)
}, },
@ -227,11 +227,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_GenericHID; Address = &ConfigurationDescriptor.HID_GenericHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &GenericReport; Address = &GenericReport;
Size = sizeof(GenericReport); Size = sizeof(GenericReport);
break; break;

@ -138,7 +138,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -163,7 +163,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x00, .SubClass = 0x00,
.Protocol = HID_NON_BOOT_PROTOCOL, .Protocol = HID_BOOTP_NonBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID_JoystickHID = .HID_JoystickHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(JoystickReport) .HIDReportLength = sizeof(JoystickReport)
}, },
@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_JoystickHID; Address = &ConfigurationDescriptor.HID_JoystickHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &JoystickReport; Address = &JoystickReport;
Size = sizeof(JoystickReport); Size = sizeof(JoystickReport);
break; break;

@ -132,7 +132,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -173,7 +173,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -139,19 +139,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x01, .SubClass = 0x01,
.Protocol = HID_BOOT_KEYBOARD_PROTOCOL, .Protocol = HID_BOOTP_KeyboardBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID_KeyboardHID = .HID_KeyboardHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(KeyboardReport) .HIDReportLength = sizeof(KeyboardReport)
}, },
@ -243,11 +243,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_KeyboardHID; Address = &ConfigurationDescriptor.HID_KeyboardHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &KeyboardReport; Address = &KeyboardReport;
Size = sizeof(KeyboardReport); Size = sizeof(KeyboardReport);
break; break;

@ -132,7 +132,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -175,7 +175,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -172,19 +172,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x01, .SubClass = 0x01,
.Protocol = HID_BOOT_KEYBOARD_PROTOCOL, .Protocol = HID_BOOTP_KeyboardBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID1_KeyboardHID = .HID1_KeyboardHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(KeyboardReport) .HIDReportLength = sizeof(KeyboardReport)
}, },
@ -209,19 +209,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x01, .SubClass = 0x01,
.Protocol = HID_BOOT_MOUSE_PROTOCOL, .Protocol = HID_BOOTP_MouseBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID2_MouseHID = .HID2_MouseHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(MouseReport) .HIDReportLength = sizeof(MouseReport)
}, },
@ -313,7 +313,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
if (!(wIndex)) if (!(wIndex))
{ {
Address = &ConfigurationDescriptor.HID1_KeyboardHID; Address = &ConfigurationDescriptor.HID1_KeyboardHID;
@ -325,7 +325,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
} }
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
if (!(wIndex)) if (!(wIndex))
{ {
Address = &KeyboardReport; Address = &KeyboardReport;

@ -158,7 +158,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -230,7 +230,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -104,14 +104,14 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_ControlInterface_SPC = .Audio_ControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Header, .Subtype = AUDIO_DSUBTYPE_CSInterface_Header,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t), .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t),
.InCollection = 1, .InCollection = 1,
.InterfaceNumbers = {1}, .InterfaceNumber = 1,
}, },
.Audio_StreamInterface = .Audio_StreamInterface =
@ -132,8 +132,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamInterface_SPC = .Audio_StreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_General, .Subtype = AUDIO_DSUBTYPE_CSInterface_General,
.AudioSpecification = VERSION_BCD(01.00), .AudioSpecification = VERSION_BCD(01.00),
@ -143,10 +143,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_In_Jack_Emb = .MIDI_In_Jack_Emb =
{ {
.Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputJack, .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
.JackType = MIDI_JACKTYPE_EMBEDDED, .JackType = MIDI_JACKTYPE_Embedded,
.JackID = 0x01, .JackID = 0x01,
.JackStrIndex = NO_DESCRIPTOR .JackStrIndex = NO_DESCRIPTOR
@ -154,10 +154,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_In_Jack_Ext = .MIDI_In_Jack_Ext =
{ {
.Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputJack, .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
.JackType = MIDI_JACKTYPE_EXTERNAL, .JackType = MIDI_JACKTYPE_External,
.JackID = 0x02, .JackID = 0x02,
.JackStrIndex = NO_DESCRIPTOR .JackStrIndex = NO_DESCRIPTOR
@ -165,10 +165,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_Out_Jack_Emb = .MIDI_Out_Jack_Emb =
{ {
.Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputJack, .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
.JackType = MIDI_JACKTYPE_EMBEDDED, .JackType = MIDI_JACKTYPE_Embedded,
.JackID = 0x03, .JackID = 0x03,
.NumberOfPins = 1, .NumberOfPins = 1,
@ -180,10 +180,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_Out_Jack_Ext = .MIDI_Out_Jack_Ext =
{ {
.Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputJack, .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
.JackType = MIDI_JACKTYPE_EXTERNAL, .JackType = MIDI_JACKTYPE_External,
.JackID = 0x04, .JackID = 0x04,
.NumberOfPins = 1, .NumberOfPins = 1,
@ -211,8 +211,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_In_Jack_Endpoint_SPC = .MIDI_In_Jack_Endpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
.TotalEmbeddedJacks = 0x01, .TotalEmbeddedJacks = 0x01,
.AssociatedJackID = {0x01} .AssociatedJackID = {0x01}
@ -236,8 +236,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_Out_Jack_Endpoint_SPC = .MIDI_Out_Jack_Endpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
.TotalEmbeddedJacks = 0x01, .TotalEmbeddedJacks = 0x01,
.AssociatedJackID = {0x03} .AssociatedJackID = {0x03}

@ -188,19 +188,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x01, .SubClass = 0x01,
.Protocol = 0x01, .Protocol = HID_BOOTP_KeyboardBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID_KeyboardHID = .HID_KeyboardHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(KeyboardReport) .HIDReportLength = sizeof(KeyboardReport)
}, },
@ -292,11 +292,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_KeyboardHID; Address = &ConfigurationDescriptor.HID_KeyboardHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &KeyboardReport; Address = &KeyboardReport;
Size = sizeof(KeyboardReport); Size = sizeof(KeyboardReport);
break; break;

@ -178,7 +178,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -221,7 +221,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x01, .SubClass = 0x01,
.Protocol = HID_BOOT_MOUSE_PROTOCOL, .Protocol = HID_BOOTP_MouseBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID_MouseHID = .HID_MouseHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(MouseReport) .HIDReportLength = sizeof(MouseReport)
}, },
@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_MouseHID; Address = &ConfigurationDescriptor.HID_MouseHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &MouseReport; Address = &MouseReport;
Size = sizeof(MouseReport); Size = sizeof(MouseReport);
break; break;

@ -132,7 +132,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -173,7 +173,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -104,26 +104,27 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.CDC_Functional_Header = .CDC_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC_Functional_AbstractControlManagement = .CDC_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x00} .Capabilities = 0x00,
}, },
.CDC_Functional_Union = .CDC_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x00, 0x01} .MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
}, },
.CDC_NotificationEndpoint = .CDC_NotificationEndpoint =

@ -67,9 +67,9 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t CDC_CCI_Interface; USB_Descriptor_Interface_t CDC_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Header; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t RNDIS_DataOutEndpoint; USB_Descriptor_Endpoint_t RNDIS_DataOutEndpoint;

@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.CDC_Functional_IntHeader = .CDC_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC_Functional_AbstractControlManagement = .CDC_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x06} .Capabilities = 0x06,
}, },
.CDC_Functional_Union = .CDC_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x00, 0x01} .MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
}, },
.CDC_NotificationEndpoint = .CDC_NotificationEndpoint =

@ -67,9 +67,9 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t CDC_CCI_Interface; USB_Descriptor_Interface_t CDC_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;

@ -164,28 +164,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.CDC_Functional_IntHeader = .CDC_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC_Functional_AbstractControlManagement = .CDC_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x06} .Capabilities = 0x06,
}, },
.CDC_Functional_Union = .CDC_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x00, 0x01} .MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
}, },
.CDC_NotificationEndpoint = .CDC_NotificationEndpoint =
@ -245,19 +246,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x01, .SubClass = 0x01,
.Protocol = HID_BOOT_MOUSE_PROTOCOL, .Protocol = HID_BOOTP_MouseBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID_MouseHID = .HID_MouseHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(MouseReport) .HIDReportLength = sizeof(MouseReport)
}, },
@ -349,11 +350,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_MouseHID; Address = &ConfigurationDescriptor.HID_MouseHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &MouseReport; Address = &MouseReport;
Size = sizeof(MouseReport); Size = sizeof(MouseReport);
break; break;

@ -75,9 +75,9 @@
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_Association_t CDC_IAD; USB_Descriptor_Interface_Association_t CDC_IAD;
USB_Descriptor_Interface_t CDC_CCI_Interface; USB_Descriptor_Interface_t CDC_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;

@ -191,7 +191,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -232,7 +232,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_ControlInterface_SPC = .Audio_ControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_AudioHeader,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_Audio_Interface_AC_t) + .TotalLength = (sizeof(USB_Audio_Interface_AC_t) +
@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_InputTerminal = .Audio_InputTerminal =
{ {
.Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputTerminal, .Subtype = DSUBTYPE_InputTerminal,
.TerminalID = 0x01, .TerminalID = 0x01,
@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_OutputTerminal = .Audio_OutputTerminal =
{ {
.Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputTerminal, .Subtype = DSUBTYPE_OutputTerminal,
.TerminalID = 0x02, .TerminalID = 0x02,
@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamInterface_SPC = .Audio_StreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.TerminalLink = 0x02, .TerminalLink = 0x02,
@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_AudioFormat = .Audio_AudioFormat =
{ {
.Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Format, .Subtype = DSUBTYPE_Format,
.FormatType = 0x01, .FormatType = 0x01,
@ -223,7 +223,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamEndpoint_SPC = .Audio_StreamEndpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.Attributes = 0x00, .Attributes = 0x00,

@ -42,14 +42,8 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
/* Macros: */ /* Macros: */
/** Descriptor header constant to indicate a Audio class interface descriptor. */
#define DTYPE_AudioInterface 0x24
/** Descriptor header constant to indicate a Audio class endpoint descriptor. */
#define DTYPE_AudioEndpoint 0x25
/** Audio class descriptor subtype value for a Audio class specific header descriptor. */ /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
#define DSUBTYPE_Header 0x01 #define DSUBTYPE_AudioHeader 0x01
/** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */ /** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */
#define DSUBTYPE_InputTerminal 0x02 #define DSUBTYPE_InputTerminal 0x02

@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_ControlInterface_SPC = .Audio_ControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_AudioHeader,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = (sizeof(USB_Audio_Interface_AC_t) + .TotalLength = (sizeof(USB_Audio_Interface_AC_t) +
@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_InputTerminal = .Audio_InputTerminal =
{ {
.Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputTerminal, .Subtype = DSUBTYPE_InputTerminal,
.TerminalID = 0x01, .TerminalID = 0x01,
@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_OutputTerminal = .Audio_OutputTerminal =
{ {
.Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputTerminal, .Subtype = DSUBTYPE_OutputTerminal,
.TerminalID = 0x02, .TerminalID = 0x02,
@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamInterface_SPC = .Audio_StreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.TerminalLink = 0x01, .TerminalLink = 0x01,
@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_AudioFormat = .Audio_AudioFormat =
{ {
.Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Format, .Subtype = DSUBTYPE_Format,
.FormatType = 0x01, .FormatType = 0x01,
@ -223,7 +223,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamEndpoint_SPC = .Audio_StreamEndpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.Attributes = EP_ACCEPTS_SMALL_PACKETS, .Attributes = EP_ACCEPTS_SMALL_PACKETS,

@ -42,14 +42,8 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
/* Macros: */ /* Macros: */
/** Descriptor header constant to indicate a Audio class interface descriptor. */
#define DTYPE_AudioInterface 0x24
/** Descriptor header constant to indicate a Audio class endpoint descriptor. */
#define DTYPE_AudioEndpoint 0x25
/** Audio class descriptor subtype value for a Audio class specific header descriptor. */ /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
#define DSUBTYPE_Header 0x01 #define DSUBTYPE_AudioHeader 0x01
/** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */ /** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */
#define DSUBTYPE_InputTerminal 0x02 #define DSUBTYPE_InputTerminal 0x02

@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_ControlInterface_SPC = .Audio_ControlInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_Header, .Subtype = DSUBTYPE_AudioHeader,
.ACSpecification = VERSION_BCD(01.00), .ACSpecification = VERSION_BCD(01.00),
.TotalLength = sizeof(USB_Audio_Interface_AC_t), .TotalLength = sizeof(USB_Audio_Interface_AC_t),
@ -132,7 +132,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Audio_StreamInterface_SPC = .Audio_StreamInterface_SPC =
{ {
.Header = {.Size = sizeof(USB_Audio_Interface_MIDI_AS_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_Audio_Interface_MIDI_AS_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.AudioSpecification = VERSION_BCD(01.00), .AudioSpecification = VERSION_BCD(01.00),
@ -143,7 +143,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_In_Jack_Emb = .MIDI_In_Jack_Emb =
{ {
.Header = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputJack, .Subtype = DSUBTYPE_InputJack,
.JackType = JACKTYPE_EMBEDDED, .JackType = JACKTYPE_EMBEDDED,
@ -154,7 +154,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_In_Jack_Ext = .MIDI_In_Jack_Ext =
{ {
.Header = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_InputJack, .Subtype = DSUBTYPE_InputJack,
.JackType = JACKTYPE_EXTERNAL, .JackType = JACKTYPE_EXTERNAL,
@ -165,7 +165,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_Out_Jack_Emb = .MIDI_Out_Jack_Emb =
{ {
.Header = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputJack, .Subtype = DSUBTYPE_OutputJack,
.JackType = JACKTYPE_EMBEDDED, .JackType = JACKTYPE_EMBEDDED,
@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_Out_Jack_Ext = .MIDI_Out_Jack_Ext =
{ {
.Header = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_AudioInterface}, .Header = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_CSInterface},
.Subtype = DSUBTYPE_OutputJack, .Subtype = DSUBTYPE_OutputJack,
.JackType = JACKTYPE_EXTERNAL, .JackType = JACKTYPE_EXTERNAL,
@ -211,7 +211,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_In_Jack_Endpoint_SPC = .MIDI_In_Jack_Endpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.TotalEmbeddedJacks = 0x01, .TotalEmbeddedJacks = 0x01,
@ -236,7 +236,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MIDI_Out_Jack_Endpoint_SPC = .MIDI_Out_Jack_Endpoint_SPC =
{ {
.Header = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint}, .Header = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
.Subtype = DSUBTYPE_General, .Subtype = DSUBTYPE_General,
.TotalEmbeddedJacks = 0x01, .TotalEmbeddedJacks = 0x01,

@ -42,14 +42,8 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
/* Macros: */ /* Macros: */
/** Descriptor header constant to indicate a Audio class interface descriptor. */
#define DTYPE_AudioInterface 0x24
/** Descriptor header constant to indicate a Audio class endpoint descriptor. */
#define DTYPE_AudioEndpoint 0x25
/** Audio class descriptor subtype value for a Audio class specific header descriptor. */ /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
#define DSUBTYPE_Header 0x01 #define DSUBTYPE_AudioHeader 0x01
/** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */ /** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */
#define DSUBTYPE_InputJack 0x02 #define DSUBTYPE_InputJack 0x02

@ -89,7 +89,7 @@
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */ /** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2 #define LEDMASK_USB_BUSY LEDS_LED2
/* Type defines: */ /* Type Defines: */
/** Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */ /** Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
typedef struct typedef struct
{ {

@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x01, .SubClass = 0x01,
.Protocol = HID_BOOT_MOUSE_PROTOCOL, .Protocol = HID_BOOTP_MouseBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID_MouseHID = .HID_MouseHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(MouseReport) .HIDReportLength = sizeof(MouseReport)
}, },
@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_MouseHID; Address = &ConfigurationDescriptor.HID_MouseHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &MouseReport; Address = &MouseReport;
Size = sizeof(MouseReport); Size = sizeof(MouseReport);
break; break;

@ -98,7 +98,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -139,7 +139,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -47,7 +47,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Host_Interface =
.DataINPipeNumber = 1, .DataINPipeNumber = 1,
.DataOUTPipeNumber = 2, .DataOUTPipeNumber = 2,
.HIDInterfaceProtocol = HID_BOOT_MOUSE_PROTOCOL, .HIDInterfaceProtocol = HID_BOOTP_MouseBootProtocol,
}, },
}; };

@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Joystick_HID_Interface =
.DataOUTPipeNumber = 2, .DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false, .DataOUTPipeDoubleBank = false,
.HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol,
.HIDParserData = &HIDReportInfo .HIDParserData = &HIDReportInfo
}, },
@ -138,7 +138,7 @@ int main(void)
/* Determine what report item is being tested, process updated value as needed */ /* Determine what report item is being tested, process updated value as needed */
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) && if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
if (ReportItem->Value) if (ReportItem->Value)
LEDMask = LEDS_ALL_LEDS; LEDMask = LEDS_ALL_LEDS;
@ -146,7 +146,7 @@ int main(void)
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
((ReportItem->Attributes.Usage.Usage == USAGE_X) || ((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) && (ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t); int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);

@ -50,7 +50,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
.DataOUTPipeNumber = 2, .DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false, .DataOUTPipeDoubleBank = false,
.HIDInterfaceProtocol = HID_BOOT_KEYBOARD_PROTOCOL, .HIDInterfaceProtocol = HID_BOOTP_KeyboardBootProtocol,
}, },
}; };

@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
.DataOUTPipeNumber = 2, .DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false, .DataOUTPipeDoubleBank = false,
.HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol,
.HIDParserData = &HIDReportInfo .HIDParserData = &HIDReportInfo
}, },
@ -138,7 +138,7 @@ int main(void)
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) && if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) &&
(ReportItem->Attributes.BitSize == 8) && (ReportItem->Attributes.BitSize == 8) &&
(ReportItem->Attributes.Logical.Maximum > 1) && (ReportItem->Attributes.Logical.Maximum > 1) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
/* Key code is an unsigned char in length, cast to the appropriate type */ /* Key code is an unsigned char in length, cast to the appropriate type */
uint8_t KeyCode = (uint8_t)ReportItem->Value; uint8_t KeyCode = (uint8_t)ReportItem->Value;

@ -50,7 +50,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
.DataOUTPipeNumber = 2, .DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false, .DataOUTPipeDoubleBank = false,
.HIDInterfaceProtocol = HID_BOOT_MOUSE_PROTOCOL, .HIDInterfaceProtocol = HID_BOOTP_MouseBootProtocol,
}, },
}; };

@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
.DataOUTPipeNumber = 2, .DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false, .DataOUTPipeDoubleBank = false,
.HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol,
.HIDParserData = &HIDReportInfo .HIDParserData = &HIDReportInfo
}, },
@ -138,14 +138,14 @@ int main(void)
/* Determine what report item is being tested, process updated value as needed */ /* Determine what report item is being tested, process updated value as needed */
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) && if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
if (ReportItem->Value) if (ReportItem->Value)
LEDMask = LEDS_ALL_LEDS; LEDMask = LEDS_ALL_LEDS;
} }
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
(ReportItem->Attributes.Usage.Usage == USAGE_SCROLL_WHEEL) && (ReportItem->Attributes.Usage.Usage == USAGE_SCROLL_WHEEL) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
int16_t WheelDelta = HID_ALIGN_DATA(ReportItem, int16_t); int16_t WheelDelta = HID_ALIGN_DATA(ReportItem, int16_t);
@ -155,7 +155,7 @@ int main(void)
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
((ReportItem->Attributes.Usage.Usage == USAGE_X) || ((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) && (ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t); int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);

@ -86,7 +86,7 @@ int main(void)
break; break;
} }
if (SImage_Host_ConfigurePipes(&DigitalCamera_SI_Interface, if (SI_Host_ConfigurePipes(&DigitalCamera_SI_Interface,
ConfigDescriptorSize, ConfigDescriptorData) != SI_ENUMERROR_NoError) ConfigDescriptorSize, ConfigDescriptorData) != SI_ENUMERROR_NoError)
{ {
puts_P(PSTR("Attached Device Not a Valid Still Image Class Device.\r\n")); puts_P(PSTR("Attached Device Not a Valid Still Image Class Device.\r\n"));
@ -110,7 +110,7 @@ int main(void)
case HOST_STATE_Configured: case HOST_STATE_Configured:
puts_P(PSTR("Opening Session...\r\n")); puts_P(PSTR("Opening Session...\r\n"));
if (SImage_Host_OpenSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError) if (SI_Host_OpenSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
{ {
puts_P(PSTR("Could not open PIMA session.\r\n")); puts_P(PSTR("Could not open PIMA session.\r\n"));
USB_HostState = HOST_STATE_WaitForDeviceRemoval; USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@ -119,8 +119,8 @@ int main(void)
puts_P(PSTR("Turning off Device...\r\n")); puts_P(PSTR("Turning off Device...\r\n"));
SImage_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, NULL); SI_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, NULL);
if (SImage_Host_ReceiveResponse(&DigitalCamera_SI_Interface)) if (SI_Host_ReceiveResponse(&DigitalCamera_SI_Interface))
{ {
puts_P(PSTR("Could not turn off device.\r\n")); puts_P(PSTR("Could not turn off device.\r\n"));
USB_HostState = HOST_STATE_WaitForDeviceRemoval; USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@ -131,7 +131,7 @@ int main(void)
puts_P(PSTR("Closing Session...\r\n")); puts_P(PSTR("Closing Session...\r\n"));
if (SImage_Host_CloseSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError) if (SI_Host_CloseSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
{ {
puts_P(PSTR("Could not close PIMA session.\r\n")); puts_P(PSTR("Could not close PIMA session.\r\n"));
USB_HostState = HOST_STATE_WaitForDeviceRemoval; USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@ -143,7 +143,7 @@ int main(void)
break; break;
} }
SImage_Host_USBTask(&DigitalCamera_SI_Interface); SI_Host_USBTask(&DigitalCamera_SI_Interface);
USB_USBTask(); USB_USBTask();
} }
} }

@ -193,9 +193,9 @@ void Joystick_HID_Task(void)
{ {
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i]; HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In]; uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out]; uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature]; uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
/* Print out the byte sizes of each report within the device */ /* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"), printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@ -258,7 +258,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
bool FoundData; bool FoundData;
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) && if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
/* Get the joystick button value */ /* Get the joystick button value */
FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem); FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem);
@ -274,7 +274,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
((ReportItem->Attributes.Usage.Usage == USAGE_X) || ((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) && (ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
/* Get the joystick relative position value */ /* Get the joystick relative position value */
FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem); FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem);

@ -194,9 +194,9 @@ void Keyboard_HID_Task(void)
{ {
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i]; HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In]; uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out]; uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature]; uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
/* Print out the byte sizes of each report within the device */ /* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"), printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@ -258,7 +258,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport)
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) && if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) &&
(ReportItem->Attributes.BitSize == 8) && (ReportItem->Attributes.BitSize == 8) &&
(ReportItem->Attributes.Logical.Maximum > 1) && (ReportItem->Attributes.Logical.Maximum > 1) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
/* Retrieve the keyboard scan-code from the report data retrieved from the device */ /* Retrieve the keyboard scan-code from the report data retrieved from the device */
bool FoundData = USB_GetHIDReportItemInfo(KeyboardReport, ReportItem); bool FoundData = USB_GetHIDReportItemInfo(KeyboardReport, ReportItem);

@ -75,7 +75,7 @@
/** Additional error code for Mass Storage functions when a device returns a logical command failure. */ /** Additional error code for Mass Storage functions when a device returns a logical command failure. */
#define MASS_STORE_SCSI_COMMAND_FAILED 0xC0 #define MASS_STORE_SCSI_COMMAND_FAILED 0xC0
/* Type defines: */ /* Type Defines: */
/** Type define for a Mass Storage class Command Block Wrapper, used to wrap SCSI /** Type define for a Mass Storage class Command Block Wrapper, used to wrap SCSI
* commands for transport over the USB bulk endpoints to the device. * commands for transport over the USB bulk endpoints to the device.
*/ */

@ -194,9 +194,9 @@ void Mouse_HID_Task(void)
{ {
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i]; HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In]; uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out]; uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature]; uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
/* Print out the byte sizes of each report within the device */ /* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"), printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@ -259,7 +259,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
bool FoundData; bool FoundData;
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) && if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
/* Get the mouse button value */ /* Get the mouse button value */
FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem); FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem);
@ -274,7 +274,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
} }
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
(ReportItem->Attributes.Usage.Usage == USAGE_SCROLL_WHEEL) && (ReportItem->Attributes.Usage.Usage == USAGE_SCROLL_WHEEL) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
/* Get the mouse wheel value if it is contained within the current /* Get the mouse wheel value if it is contained within the current
* report, if not, skip to the next item in the parser list * report, if not, skip to the next item in the parser list
@ -290,7 +290,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
((ReportItem->Attributes.Usage.Usage == USAGE_X) || ((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) && (ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In)) (ReportItem->ItemType == HID_REPORT_ITEM_In))
{ {
/* Get the mouse relative position value */ /* Get the mouse relative position value */
FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem); FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem);

@ -73,30 +73,6 @@
#define AUDIO_TOTAL_SAMPLE_RATES 1 #define AUDIO_TOTAL_SAMPLE_RATES 1
#endif #endif
/** Descriptor header constant to indicate a Audio class interface descriptor. */
#define DTYPE_AudioInterface 0x24
/** Descriptor header constant to indicate a Audio class endpoint descriptor. */
#define DTYPE_AudioEndpoint 0x25
/** Audio class descriptor subtype value for a Audio class-specific header descriptor. */
#define DSUBTYPE_Header 0x01
/** Audio class descriptor subtype value for an Output Terminal Audio class-specific descriptor. */
#define DSUBTYPE_InputTerminal 0x02
/** Audio class descriptor subtype value for an Input Terminal Audio class-specific descriptor. */
#define DSUBTYPE_OutputTerminal 0x03
/** Audio class descriptor subtype value for a Feature Unit Audio class-specific descriptor. */
#define DSUBTYPE_FeatureUnit 0x06
/** Audio class descriptor subtype value for a general Audio class-specific descriptor. */
#define DSUBTYPE_General 0x01
/** Audio class descriptor subtype value for an Audio class-specific descriptor indicating the format of an audio stream. */
#define DSUBTYPE_Format 0x02
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */ /** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
#define CHANNEL_LEFT_FRONT (1 << 0) #define CHANNEL_LEFT_FRONT (1 << 0)
@ -151,8 +127,6 @@
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */ /** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define FEATURE_GRAPHIC_EQUALIZER (1 << 5) #define FEATURE_GRAPHIC_EQUALIZER (1 << 5)
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
/** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */ /** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
#define FEATURE_AUTOMATIC_GAIN (1 << 6) #define FEATURE_AUTOMATIC_GAIN (1 << 6)
@ -235,101 +209,35 @@
*/ */
#define EP_ACCEPTS_SMALL_PACKETS (0 << 7) #define EP_ACCEPTS_SMALL_PACKETS (0 << 7)
/* Type Defines: */ /* Enums: */
/** \brief Audio class-specific Interface Descriptor (LUFA naming conventions). /** Audio class specific interface description subtypes, for the Audio Control interface. */
* enum Audio_CSInterface_AC_SubTypes_t
* Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
* supply extra information about the audio device's layout to the host. See the USB Audio specification for more
* details.
*
* \see \ref USB_Audio_StdDescriptor_Interface_AC_t for the version of this type with standard element names.
*/
typedef struct
{ {
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ AUDIO_DSUBTYPE_CSInterface_Header = 0x01, /**< Audio class specific control interface header. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ AUDIO_DSUBTYPE_CSInterface_InputTerminal = 0x02, /**< Audio class specific control interface Input Terminal. */
AUDIO_DSUBTYPE_CSInterface_OutputTerminal = 0x03, /**< Audio class specific control interface Output Terminal. */
uint16_t ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */ AUDIO_DSUBTYPE_CSInterface_Mixer = 0x04, /**< Audio class specific control interface Mixer Unit. */
uint16_t TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */ AUDIO_DSUBTYPE_CSInterface_Selector = 0x05, /**< Audio class specific control interface Selector Unit. */
AUDIO_DSUBTYPE_CSInterface_Feature = 0x06, /**< Audio class specific control interface Feature Unit. */
uint8_t InCollection; /**< Total number of audio class interfaces within this device. */ AUDIO_DSUBTYPE_CSInterface_Processing = 0x07, /**< Audio class specific control interface Processing Unit. */
uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface. */ AUDIO_DSUBTYPE_CSInterface_Extension = 0x08, /**< Audio class specific control interface Extension Unit. */
} USB_Audio_Descriptor_Interface_AC_t; };
/** \brief Audio class-specific Interface Descriptor (USB-IF naming conventions). /** Audio class specific interface description subtypes, for the Audio Streaming interface. */
* enum Audio_CSInterface_AS_SubTypes_t
* Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
* supply extra information about the audio device's layout to the host. See the USB Audio specification for more
* details.
*
* \see \ref USB_Audio_Descriptor_Interface_AC_t for the version of this type with non-standard LUFA specific
* element names.
*/
typedef struct
{ {
uint8_t bLength; /**< Size of the descriptor, in bytes. */ AUDIO_DSUBTYPE_CSInterface_General = 0x01, /**< Audio class specific streaming interface general descriptor. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value AUDIO_DSUBTYPE_CSInterface_FormatType = 0x02, /**< Audio class specific streaming interface format type descriptor. */
* given by the specific class. AUDIO_DSUBTYPE_CSInterface_FormatSpecific = 0x03, /**< Audio class specific streaming interface format information descriptor. */
*/ };
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
uint16_t bcdADC; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
uint16_t wTotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
uint8_t bInCollection; /**< Total number of audio class interfaces within this device. */
uint8_t bInterfaceNumbers[1]; /**< Interface numbers of each audio interface. */
} USB_Audio_StdDescriptor_Interface_AC_t;
/** \brief Audio class-specific Feature Unit Descriptor (LUFA naming conventions). /** Audio class specific endpoint description subtypes, for the Audio Streaming interface. */
* enum Audio_CSEndpoint_SubTypes_t
* 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
* specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_FeatureUnit_t for the version of this type with standard element names.
*/
typedef struct
{ {
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ AUDIO_DSUBTYPE_CSEndpoint_General = 0x01, /**< Audio class specific endpoint general descriptor. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ };
uint8_t UnitID; /**< ID value of this feature unit - must be a unique value within the device. */
uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit. */
uint8_t ControlSize; /**< Size of each element in the ChanelControlls array. */
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. */
} USB_Audio_Descriptor_FeatureUnit_t;
/** \brief Audio class-specific Feature Unit Descriptor (USB-IF naming conventions).
*
* 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
* specification for more details.
*
* \see \ref USB_Audio_Descriptor_FeatureUnit_t for the version of this type with non-standard LUFA specific
* element names.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
uint8_t bUnitID; /**< ID value of this feature unit - must be a unique value within the device. */
uint8_t bSourceID; /**< Source ID value of the audio source input into this feature unit. */
uint8_t bControlSize; /**< Size of each element in the ChanelControlls array. */
uint8_t bmaControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
uint8_t iFeature; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_StdDescriptor_FeatureUnit_t;
/* Type Defines: */
/** \brief Audio class-specific Input Terminal Descriptor (LUFA naming conventions). /** \brief Audio class-specific Input Terminal Descriptor (LUFA naming conventions).
* *
* 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
@ -341,7 +249,9 @@
typedef struct typedef struct
{ {
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_InputTerminal.
*/
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */ uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */ uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */
@ -371,7 +281,9 @@
* given by the specific class. * given by the specific class.
*/ */
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_InputTerminal.
*/
uint8_t bTerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */ uint8_t bTerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t wTerminalType; /**< Type of terminal, a TERMINAL_* mask. */ uint16_t wTerminalType; /**< Type of terminal, a TERMINAL_* mask. */
uint8_t bAssocTerminal; /**< ID of associated output terminal, for physically grouped terminals uint8_t bAssocTerminal; /**< ID of associated output terminal, for physically grouped terminals
@ -395,7 +307,9 @@
typedef struct typedef struct
{ {
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_OutputTerminal.
*/
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */ uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */ uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */
@ -419,11 +333,13 @@
typedef struct typedef struct
{ {
uint8_t bLength; /**< Size of the descriptor, in bytes. */ uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value uint8_t bDescriptorType; /**< Sub type value used to distinguish between audio class-specific descriptors,
* given by the specific class. * must be \ref AUDIO_DSUBTYPE_CSInterface_OutputTerminal.
*/ */
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AC_SubTypes_t enum.
*/
uint8_t bTerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */ uint8_t bTerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
uint16_t wTerminalType; /**< Type of terminal, a TERMINAL_* mask. */ uint16_t wTerminalType; /**< Type of terminal, a TERMINAL_* mask. */
uint8_t bAssocTerminal; /**< ID of associated input terminal, for physically grouped terminals uint8_t bAssocTerminal; /**< ID of associated input terminal, for physically grouped terminals
@ -434,6 +350,108 @@
uint8_t iTerminal; /**< Index of a string descriptor describing this descriptor within the device. */ uint8_t iTerminal; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_StdDescriptor_OutputTerminal_t; } USB_Audio_StdDescriptor_OutputTerminal_t;
/** \brief Audio class-specific Interface Descriptor (LUFA naming conventions).
*
* Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
* supply extra information about the audio device's layout to the host. See the USB Audio specification for more
* details.
*
* \see \ref USB_Audio_StdDescriptor_Interface_AC_t for the version of this type with standard element names.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint16_t ACSpecification; /**< 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. */
uint8_t InCollection; /**< Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1). */
uint8_t InterfaceNumber; /**< Interface number of the associated Audio Streaming interface. */
} USB_Audio_Descriptor_Interface_AC_t;
/** \brief Audio class-specific Interface Descriptor (USB-IF naming conventions).
*
* Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
* supply extra information about the audio device's layout to the host. See the USB Audio specification for more
* details.
*
* \see \ref USB_Audio_Descriptor_Interface_AC_t for the version of this type with non-standard LUFA specific
* element names.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubtype;/**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint16_t bcdADC; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
uint16_t wTotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
uint8_t bInCollection; /**< Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1). */
uint8_t bInterfaceNumbers; /**< Interface number of the associated Audio Streaming interface. */
} USB_Audio_StdDescriptor_Interface_AC_t;
/** \brief Audio class-specific Feature Unit Descriptor (LUFA naming conventions).
*
* 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
* specification for more details.
*
* \see \ref USB_Audio_StdDescriptor_FeatureUnit_t for the version of this type with standard element names.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_Feature.
*/
uint8_t UnitID; /**< ID value of this feature unit - must be a unique value within the device. */
uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit. */
uint8_t ControlSize; /**< Size of each element in the ChanelControlls array. */
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. */
} USB_Audio_Descriptor_FeatureUnit_t;
/** \brief Audio class-specific Feature Unit Descriptor (USB-IF naming conventions).
*
* 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
* specification for more details.
*
* \see \ref USB_Audio_Descriptor_FeatureUnit_t for the version of this type with non-standard LUFA specific
* element names.
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_Feature.
*/
uint8_t bUnitID; /**< ID value of this feature unit - must be a unique value within the device. */
uint8_t bSourceID; /**< Source ID value of the audio source input into this feature unit. */
uint8_t bControlSize; /**< Size of each element in the ChanelControlls array. */
uint8_t bmaControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
uint8_t iFeature; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_Audio_StdDescriptor_FeatureUnit_t;
/** \brief Audio class-specific Streaming Audio Interface Descriptor (LUFA naming conventions). /** \brief Audio class-specific Streaming Audio Interface Descriptor (LUFA naming conventions).
* *
* 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
@ -444,7 +462,9 @@
typedef struct typedef struct
{ {
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint8_t TerminalLink; /**< ID value of the output terminal this descriptor is describing. */ uint8_t TerminalLink; /**< ID value of the output terminal this descriptor is describing. */
@ -467,7 +487,9 @@
* given by the specific class. * given by the specific class.
*/ */
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint8_t bTerminalLink; /**< ID value of the output terminal this descriptor is describing. */ uint8_t bTerminalLink; /**< ID value of the output terminal this descriptor is describing. */
@ -497,7 +519,9 @@
typedef struct typedef struct
{ {
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* must be \ref AUDIO_DSUBTYPE_CSInterface_FormatType.
*/
uint8_t FormatType; /**< Format of the audio stream, see Audio Device Formats specification. */ uint8_t FormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
uint8_t Channels; /**< Total number of discrete channels in the stream. */ uint8_t Channels; /**< Total number of discrete channels in the stream. */
@ -521,11 +545,13 @@
typedef struct typedef struct
{ {
uint8_t bLength; /**< Size of the descriptor, in bytes. */ uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value uint8_t bDescriptorType; /**< Sub type value used to distinguish between audio class-specific descriptors,
* given by the specific class. * must be \ref AUDIO_DSUBTYPE_CSInterface_FormatType.
*/ */
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t bDescriptorSubtype;/**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
*/
uint8_t bFormatType; /**< Format of the audio stream, see Audio Device Formats specification. */ uint8_t bFormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
uint8_t bNrChannels; /**< Total number of discrete channels in the stream. */ uint8_t bNrChannels; /**< Total number of discrete channels in the stream. */
@ -594,7 +620,9 @@
typedef struct typedef struct
{ {
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */ USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSEndpoint_SubTypes_t enum.
*/
uint8_t Attributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */ uint8_t Attributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */
@ -618,7 +646,9 @@
* given by the specific class. * given by the specific class.
*/ */
uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
* a value from the \ref Audio_CSEndpoint_SubTypes_t enum.
*/
uint8_t bmAttributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */ uint8_t bmAttributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */

@ -66,30 +66,6 @@
#endif #endif
/* Macros: */ /* Macros: */
/** CDC class-specific request to get the current virtual serial port configuration settings. */
#define REQ_GetLineEncoding 0x21
/** CDC class-specific request to set the current virtual serial port configuration settings. */
#define REQ_SetLineEncoding 0x20
/** CDC class-specific request to set the current virtual serial port handshake line states. */
#define REQ_SetControlLineState 0x22
/** CDC class-specific request to send a break to the receiver via the carrier channel. */
#define REQ_SendBreak 0x23
/** CDC class-specific request to send an encapsulated command to the device. */
#define REQ_SendEncapsulatedCommand 0x00
/** CDC class-specific request to retrieve an encapsulated command response from the device. */
#define REQ_GetEncapsulatedResponse 0x01
/** Notification type constant for a change in the virtual serial port handshake line states, for
* use with a USB_Notification_Header_t notification structure when sent to the host via the CDC
* notification endpoint.
*/
#define NOTIF_SerialState 0x20
/** Mask for the DTR handshake line for use with the REQ_SetControlLineState class-specific request /** Mask for the DTR handshake line for use with the REQ_SetControlLineState class-specific request
* from the host, to indicate that the DTR line state should be high. * from the host, to indicate that the DTR line state should be high.
*/ */
@ -151,6 +127,49 @@
} }
/* Enums: */ /* Enums: */
/** Enum for the CDC class specific control requests that can be issued by the USB bus host. */
enum CDC_ClassRequests_t
{
CDC_REQ_SendEncapsulatedCommand = 0x00, /**< CDC class-specific request to send an encapsulated command to the device. */
CDC_REQ_GetEncapsulatedResponse = 0x01, /**< CDC class-specific request to retrieve an encapsulated command response from the device. */
CDC_REQ_SetLineEncoding = 0x20, /**< CDC class-specific request to set the current virtual serial port configuration settings. */
CDC_REQ_GetLineEncoding = 0x21, /**< CDC class-specific request to get the current virtual serial port configuration settings. */
CDC_REQ_SetControlLineState = 0x22, /**< CDC class-specific request to set the current virtual serial port handshake line states. */
CDC_REQ_SendBreak = 0x23, /**< CDC class-specific request to send a break to the receiver via the carrier channel. */
};
/** Enum for the CDC class specific notification requests that can be issued by a CDC device to a host. */
enum CDC_ClassNotifications_t
{
CDC_NOTIF_SerialState = 0x20, /**< Notification type constant for a change in the virtual serial port
* handshake line states, for use with a USB_Notification_Header_t
* notification structure when sent to the host via the CDC notification
* endpoint.
*/
};
/** Enum for the CDC class specific interface descriptor subtypes. */
enum CDC_DescriptorSubtypes_t
{
CDC_DSUBTYPE_CSInterface_Header = 0x00, /**< CDC class-specific Header functional descriptor. */
CDC_DSUBTYPE_CSInterface_CallManagement = 0x01, /**< CDC class-specific Call Managment functional descriptor. */
CDC_DSUBTYPE_CSInterface_ACM = 0x02, /**< CDC class-specific Abstract Control Model functional descriptor. */
CDC_DSUBTYPE_CSInterface_DirectLine = 0x03, /**< CDC class-specific Direct Line functional descriptor. */
CDC_DSUBTYPE_CSInterface_TelephoneRinger = 0x04, /**< CDC class-specific Telephone Ringer functional descriptor. */
CDC_DSUBTYPE_CSInterface_TelephoneCall = 0x05, /**< CDC class-specific Telephone Call functional descriptor. */
CDC_DSUBTYPE_CSInterface_Union = 0x06, /**< CDC class-specific Union functional descriptor. */
CDC_DSUBTYPE_CSInterface_CountrySelection = 0x07, /**< CDC class-specific Country Selection functional descriptor. */
CDC_DSUBTYPE_CSInterface_TelephoneOpModes = 0x08, /**< CDC class-specific Telephone Operation Modes functional descriptor. */
CDC_DSUBTYPE_CSInterface_USBTerminal = 0x09, /**< CDC class-specific USB Terminal functional descriptor. */
CDC_DSUBTYPE_CSInterface_NetworkChannel = 0x0A, /**< CDC class-specific Network Channel functional descriptor. */
CDC_DSUBTYPE_CSInterface_ProtocolUnit = 0x0B, /**< CDC class-specific Protocol Unit functional descriptor. */
CDC_DSUBTYPE_CSInterface_ExtensionUnit = 0x0C, /**< CDC class-specific Extension Unit functional descriptor. */
CDC_DSUBTYPE_CSInterface_MultiChannel = 0x0D, /**< CDC class-specific Multi-Channel Management functional descriptor. */
CDC_DSUBTYPE_CSInterface_CAPI = 0x0E, /**< CDC class-specific Common ISDN API functional descriptor. */
CDC_DSUBTYPE_CSInterface_Ethernet = 0x0F, /**< CDC class-specific Ethernet functional descriptor. */
CDC_DSUBTYPE_CSInterface_ATM = 0x10, /**< CDC class-specific Asynchronous Transfer Mode functional descriptor. */
};
/** Enum for the possible line encoding formats of a virtual serial port. */ /** Enum for the possible line encoding formats of a virtual serial port. */
enum CDC_LineEncodingFormats_t enum CDC_LineEncodingFormats_t
{ {
@ -169,6 +188,127 @@
CDC_PARITY_Space = 4, /**< Space parity bit mode on each frame. */ CDC_PARITY_Space = 4, /**< Space parity bit mode on each frame. */
}; };
/* Type Defines: */
/** \brief CDC class-specific Functional Header Descriptor (LUFA naming conventions).
*
* Type define for a CDC class-specific functional header descriptor. This indicates to the host that the device
* contains one or more CDC functional data descriptors, which give the CDC interface's capabilities and configuration.
* See the CDC class specification for more details.
*
* \see \ref USB_CDC_StdDescriptor_FunctionalHeader_t for the version of this type with standard element names.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between CDC class-specific descriptors,
* must be \ref CDC_DSUBTYPE_CSInterface_Header.
*/
uint16_t CDCSpecification; /**< Version number of the CDC specification implemented by the device,
* encoded in BCD format.
*/
} USB_CDC_Descriptor_FunctionalHeader_t;
/** \brief CDC class-specific Functional Header Descriptor (USB-IF naming conventions).
*
* Type define for a CDC class-specific functional header descriptor. This indicates to the host that the device
* contains one or more CDC functional data descriptors, which give the CDC interface's capabilities and configuration.
* See the CDC class specification for more details.
*
* \see \ref USB_CDC_Descriptor_FunctionalHeader_t for the version of this type with non-standard LUFA specific
* element names.
*/
typedef struct
{
uint8_t bFunctionLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubType; /**< Sub type value used to distinguish between CDC class-specific descriptors,
* must be \ref CDC_DSUBTYPE_CSInterface_Header.
*/
uint16_t bcdCDC; /**< Version number of the CDC specification implemented by the device, encoded in BCD format. */
} USB_CDC_StdDescriptor_FunctionalHeader_t;
/** \brief CDC class-specific Functional ACM Descriptor (LUFA naming conventions).
*
* Type define for a CDC class-specific functional ACM descriptor. This indicates to the host that the CDC interface
* supports the CDC ACM subclass of the CDC specification. See the CDC class specification for more details.
*
* \see \ref USB_CDC_StdDescriptor_FunctionalACM_t for the version of this type with standard element names.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between CDC class-specific descriptors,
* must be \ref CDC_DSUBTYPE_CSInterface_ACM.
*/
uint8_t Capabilities; /**< Capabilities of the ACM interface, given as a bit mask. For most devices,
* this should be set to a fixed value of 0x06 - for other capabiltiies, refer
* to the CDC ACM specification.
*/
} USB_CDC_Descriptor_FunctionalACM_t;
/** \brief CDC class-specific Functional ACM Descriptor (USB-IF naming conventions).
*
* Type define for a CDC class-specific functional ACM descriptor. This indicates to the host that the CDC interface
* supports the CDC ACM subclass of the CDC specification. See the CDC class specification for more details.
*
* \see \ref USB_CDC_Descriptor_FunctionalACM_t for the version of this type with non-standard LUFA specific
* element names.
*/
typedef struct
{
uint8_t bFunctionLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubType; /**< Sub type value used to distinguish between CDC class-specific descriptors,
* must be \ref CDC_DSUBTYPE_CSInterface_ACM.
*/
uint8_t bmCapabilities; /**< Capabilities of the ACM interface, given as a bit mask. For most devices,
* this should be set to a fixed value of 0x06 - for other capabiltiies, refer
* to the CDC ACM specification.
*/
} USB_CDC_StdDescriptor_FunctionalACM_t;
/** \brief CDC class-specific Functional Union Descriptor (LUFA naming conventions).
*
* Type define for a CDC class-specific functional Union descriptor. This indicates to the host that specific
* CDC control and data interfaces are related. See the CDC class specification for more details.
*
* \see \ref USB_CDC_StdDescriptor_FunctionalUnion_t for the version of this type with standard element names.
*/
typedef struct
{
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
uint8_t Subtype; /**< Sub type value used to distinguish between CDC class-specific descriptors,
* must be \ref CDC_DSUBTYPE_CSInterface_Union.
*/
uint8_t MasterInterfaceNumber; /**< Interface number of the CDC Control interface. */
uint8_t SlaveInterfaceNumber; /**< Interface number of the CDC Data interface. */
} USB_CDC_Descriptor_FunctionalUnion_t;
/** \brief CDC class-specific Functional Union Descriptor (USB-IF naming conventions).
*
* Type define for a CDC class-specific functional Union descriptor. This indicates to the host that specific
* CDC control and data interfaces are related. See the CDC class specification for more details.
*
* \see \ref USB_CDC_Descriptor_FunctionalUnion_t for the version of this type with non-standard LUFA specific
* element names.
*/
typedef struct
{
uint8_t bFunctionLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bDescriptorSubType; /**< Sub type value used to distinguish between CDC class-specific descriptors,
* must be \ref CDC_DSUBTYPE_CSInterface_Union.
*/
uint8_t bMasterInterface; /**< Interface number of the CDC Control interface. */
uint8_t bSlaveInterface0; /**< Interface number of the CDC Data interface. */
} USB_CDC_StdDescriptor_FunctionalUnion_t;
/* Disable C linkage for C++ Compilers: */ /* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)
} }

@ -61,45 +61,6 @@
#endif #endif
/* Macros: */ /* Macros: */
/** HID class-specific Request to get the current HID report from the device. */
#define REQ_GetReport 0x01
/** HID class-specific Request to get the current device idle count. */
#define REQ_GetIdle 0x02
/** HID class-specific Request to set the current HID report to the device. */
#define REQ_SetReport 0x09
/** HID class-specific Request to set the device's idle count. */
#define REQ_SetIdle 0x0A
/** HID class-specific Request to get the current HID report protocol mode. */
#define REQ_GetProtocol 0x03
/** HID class-specific Request to set the current HID report protocol mode. */
#define REQ_SetProtocol 0x0B
/** Descriptor header type value, to indicate a HID class HID descriptor. */
#define DTYPE_HID 0x21
/** Descriptor header type value, to indicate a HID class HID report descriptor. */
#define DTYPE_Report 0x22
/** Constant for the protocol value of a HID interface descriptor, indicating that the interface does not support
* any HID class boot protocol (see HID Class Specification).
*/
#define HID_NON_BOOT_PROTOCOL 0x00
/** Constant for the protocol value of a HID interface descriptor, indicating that the interface supports the
* HID class Keyboard boot protocol (see HID Class Specification).
*/
#define HID_BOOT_KEYBOARD_PROTOCOL 0x01
/** Constant for the protocol value of a HID interface descriptor, indicating that the interface supports the
* HID class Mouse boot protocol (see HID Class Specification).
*/
#define HID_BOOT_MOUSE_PROTOCOL 0x02
/** Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed. */ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed. */
#define HID_KEYBOARD_MODIFER_LEFTCTRL (1 << 0) #define HID_KEYBOARD_MODIFER_LEFTCTRL (1 << 0)
@ -137,12 +98,47 @@
#define HID_KEYBOARD_LED_KATANA (1 << 3) #define HID_KEYBOARD_LED_KATANA (1 << 3)
/* Type Defines: */ /* Type Defines: */
/** Enum for the HID class specific control requests that can be issued by the USB bus host. */
enum HID_ClassRequests_t
{
HID_REQ_GetReport = 0x01, /**< HID class-specific Request to get the current HID report from the device. */
HID_REQ_GetIdle = 0x02, /**< HID class-specific Request to get the current device idle count. */
HID_REQ_SetReport = 0x09, /**< HID class-specific Request to set the current HID report to the device. */
HID_REQ_SetIdle = 0x0A, /**< HID class-specific Request to set the device's idle count. */
HID_REQ_GetProtocol = 0x03, /**< HID class-specific Request to get the current HID report protocol mode. */
HID_REQ_SetProtocol = 0x0B, /**< HID class-specific Request to set the current HID report protocol mode. */
};
/** Enum for the HID class specific descriptor types. */
enum HID_DescriptorTypes_t
{
HID_DTYPE_HID = 0x21, /**< Descriptor header type value, to indicate a HID class HID descriptor. */
HID_DTYPE_Report = 0x22, /**< Descriptor header type value, to indicate a HID class HID report descriptor. */
};
/** Enum for the HID class boot protocols that may be supported by HID devices. */
enum HID_BootProtocols_t
{
HID_BOOTP_NonBootProtocol = 0x00, /**< Constant for the protocol value of a HID interface descriptor, indicating
* that the interface does not support any HID class boot protocol (see HID
* Class Specification).
*/
HID_BOOTP_KeyboardBootProtocol = 0x01, /**< Constant for the protocol value of a HID interface descriptor, indicating
* that the interface supports the HID class Keyboard boot protocol (see HID
* Class Specification).
*/
HID_BOOTP_MouseBootProtocol = 0x02, /**< Constant for the protocol value of a HID interface descriptor, indicating
* that the interface supports the HID class Mouse boot protocol (see HID Class
* Specification).
*/
};
/** Enum for the different types of HID reports. */ /** Enum for the different types of HID reports. */
enum HID_ReportItemTypes_t enum HID_ReportItemTypes_t
{ {
REPORT_ITEM_TYPE_In = 0, /**< Indicates that the item is an IN report type. */ HID_REPORT_ITEM_In = 0, /**< Indicates that the item is an IN report type. */
REPORT_ITEM_TYPE_Out = 1, /**< Indicates that the item is an OUT report type. */ HID_REPORT_ITEM_Out = 1, /**< Indicates that the item is an OUT report type. */
REPORT_ITEM_TYPE_Feature = 2, /**< Indicates that the item is a FEATURE report type. */ HID_REPORT_ITEM_Feature = 2, /**< Indicates that the item is a FEATURE report type. */
}; };
/** \brief HID class-specific HID Descriptor (LUFA naming conventions). /** \brief HID class-specific HID Descriptor (LUFA naming conventions).
@ -161,7 +157,7 @@
uint8_t TotalReportDescriptors; /**< Total number of HID report descriptors for the interface. */ uint8_t TotalReportDescriptors; /**< Total number of HID report descriptors for the interface. */
uint8_t HIDReportType; /**< Type of HID report, set to \ref DTYPE_Report. */ uint8_t HIDReportType; /**< Type of HID report, set to \ref HID_DTYPE_Report. */
uint16_t HIDReportLength; /**< Length of the associated HID report descriptor, in bytes. */ uint16_t HIDReportLength; /**< Length of the associated HID report descriptor, in bytes. */
} USB_HID_Descriptor_HID_t; } USB_HID_Descriptor_HID_t;
@ -185,7 +181,7 @@
uint8_t bNumDescriptors; /**< Total number of HID report descriptors for the interface. */ uint8_t bNumDescriptors; /**< Total number of HID report descriptors for the interface. */
uint8_t bDescriptorType2; /**< Type of HID report, set to \ref DTYPE_Report. */ uint8_t bDescriptorType2; /**< Type of HID report, set to \ref HID_DTYPE_Report. */
uint16_t wDescriptorLength; /**< Length of the associated HID report descriptor, in bytes. */ uint16_t wDescriptorLength; /**< Length of the associated HID report descriptor, in bytes. */
} USB_HID_StdDescriptor_HID_t; } USB_HID_StdDescriptor_HID_t;

@ -70,18 +70,6 @@
#endif #endif
/* Macros: */ /* Macros: */
/** Audio class descriptor subtype value for a Audio class-specific MIDI input jack descriptor. */
#define DSUBTYPE_InputJack 0x02
/** Audio class descriptor subtype value for a Audio class-specific MIDI output jack descriptor. */
#define DSUBTYPE_OutputJack 0x03
/** Audio class descriptor jack type value for an embedded (logical) MIDI input or output jack. */
#define MIDI_JACKTYPE_EMBEDDED 0x01
/** Audio class descriptor jack type value for an external (physical) MIDI input or output jack. */
#define MIDI_JACKTYPE_EXTERNAL 0x02
/** MIDI command for a note on (activation) event. */ /** MIDI command for a note on (activation) event. */
#define MIDI_COMMAND_NOTE_ON 0x90 #define MIDI_COMMAND_NOTE_ON 0x90
@ -98,6 +86,13 @@
*/ */
#define MIDI_CHANNEL(channel) ((channel) - 1) #define MIDI_CHANNEL(channel) ((channel) - 1)
/* Enums: */
enum MIDI_JackTypes_t
{
MIDI_JACKTYPE_Embedded = 0x01, /**< MIDI class descriptor jack type value for an embedded (logical) MIDI input or output jack. */
MIDI_JACKTYPE_External = 0x02, /**< MIDI class descriptor jack type value for an external (physical) MIDI input or output jack. */
};
/* Type Defines: */ /* Type Defines: */
/** \brief MIDI class-specific Streaming Interface Descriptor (LUFA naming conventions). /** \brief MIDI class-specific Streaming Interface Descriptor (LUFA naming conventions).
* *
@ -158,7 +153,6 @@
uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */ uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
} USB_MIDI_Descriptor_InputJack_t; } USB_MIDI_Descriptor_InputJack_t;
/** \brief MIDI class-specific Input Jack Descriptor (USB-IF naming conventions). /** \brief MIDI class-specific Input Jack Descriptor (USB-IF naming conventions).
* *
* 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

@ -66,12 +66,6 @@
#endif #endif
/* Macros: */ /* Macros: */
/** Mass Storage class-specific request to reset the Mass Storage interface, ready for the next command. */
#define REQ_MassStorageReset 0xFF
/** Mass Storage class-specific request to retrieve the total number of Logical Units (drives) in the SCSI device. */
#define REQ_GetMaxLUN 0xFE
/** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */ /** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */
#define MS_CBW_SIGNATURE 0x43425355UL #define MS_CBW_SIGNATURE 0x43425355UL
@ -210,7 +204,29 @@
/** SCSI Additional Sense Qualifier Code to indicate that an operation is currently in progress. */ /** SCSI Additional Sense Qualifier Code to indicate that an operation is currently in progress. */
#define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07 #define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07
/* Type defines: */ /* Enums: */
/** Enum for the Mass Storage class specific control requests that can be issued by the USB bus host. */
enum MS_ClassRequests_t
{
MS_REQ_GetMaxLUN = 0xFE, /**< Mass Storage class-specific request to retrieve the total number of Logical
* Units (drives) in the SCSI device.
*/
MS_REQ_MassStorageReset = 0xFF, /**< Mass Storage class-specific request to reset the Mass Storage interface,
* ready for the next command.
*/
};
/** Enum for the possible command status wrapper return status codes. */
enum MS_CommandStatusCodes_t
{
MS_SCSI_COMMAND_Pass = 0, /**< Command completed with no error */
MS_SCSI_COMMAND_Fail = 1, /**< Command failed to complete - host may check the exact error via a
* SCSI REQUEST SENSE command.
*/
MS_SCSI_COMMAND_PhaseError = 2, /**< Command failed due to being invalid in the current phase. */
};
/* Type Defines: */
/** \brief Mass Storage Class Command Block Wrapper. /** \brief Mass Storage Class Command Block Wrapper.
* *
* Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */ * Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
@ -306,17 +322,6 @@
uint8_t RevisionID[4]; uint8_t RevisionID[4];
} SCSI_Inquiry_Response_t; } SCSI_Inquiry_Response_t;
/* Enums: */
/** Enum for the possible command status wrapper return status codes. */
enum MassStorage_CommandStatusCodes_t
{
SCSI_Command_Pass = 0, /**< Command completed with no error */
SCSI_Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a
* SCSI REQUEST SENSE command.
*/
SCSI_Phase_Error = 2 /**< Command failed due to being invalid in the current phase. */
};
/* Disable C linkage for C++ Compilers: */ /* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)
} }

@ -77,12 +77,6 @@
/** Implemented RNDIS Version Minor. */ /** Implemented RNDIS Version Minor. */
#define REMOTE_NDIS_VERSION_MINOR 0x00 #define REMOTE_NDIS_VERSION_MINOR 0x00
/** RNDIS request to issue a host-to-device NDIS command. */
#define REQ_SendEncapsulatedCommand 0x00
/** RNDIS request to issue a device-to-host NDIS response. */
#define REQ_GetEncapsulatedResponse 0x01
/** Maximum size in bytes of a RNDIS control message which can be sent or received. */ /** Maximum size in bytes of a RNDIS control message which can be sent or received. */
#define RNDIS_MESSAGE_BUFFER_SIZE 128 #define RNDIS_MESSAGE_BUFFER_SIZE 128
@ -93,6 +87,13 @@
#define NOTIF_ResponseAvailable 1 #define NOTIF_ResponseAvailable 1
/* Enums: */ /* Enums: */
/** Enum for the RNDIS class specific control requests that can be issued by the USB bus host. */
enum RNDIS_ClassRequests_t
{
RNDIS_REQ_SendEncapsulatedCommand = 0x00, /**< RNDIS request to issue a host-to-device NDIS command. */
RNDIS_REQ_GetEncapsulatedResponse = 0x01, /**< RNDIS request to issue a device-to-host NDIS response. */
};
/** Enum for the possible NDIS adapter states. */ /** Enum for the possible NDIS adapter states. */
enum RNDIS_States_t enum RNDIS_States_t
{ {

@ -79,44 +79,42 @@
* *
* \param[in] Params Number of parameters which are to be sent in the Param field of the container. * \param[in] Params Number of parameters which are to be sent in the Param field of the container.
*/ */
#define PIMA_COMMAND_SIZE(Params) ((sizeof(SI_PIMA_Container_t) - 12) + \ #define PIMA_COMMAND_SIZE(Params) ((sizeof(SI_PIMA_Container_t) - 12) + ((Params) * sizeof(uint32_t)))
((Params) * sizeof(uint32_t)))
/** Used in the DataLength field of a PIMA container, to give the total container size in bytes for /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
* a data container. * a data container.
* *
* \param[in] DataLen Length in bytes of the data in the container. * \param[in] DataLen Length in bytes of the data in the container.
*/ */
#define PIMA_DATA_SIZE(DataLen) ((sizeof(SI_PIMA_Container_t) - 12) + \ #define PIMA_DATA_SIZE(DataLen) ((sizeof(SI_PIMA_Container_t) - 12) + (DataLen))
(DataLen))
/* Enums: */ /* Enums: */
/** Enum for the possible PIMA contains types. */ /** Enum for the possible PIMA contains types. */
enum SI_PIMA_Container_Types_t enum SI_PIMA_Container_Types_t
{ {
CType_Undefined = 0, /**< Undefined container type. */ SI_PIMA_CONTAINER_Undefined = 0, /**< Undefined container type. */
CType_CommandBlock = 1, /**< Command Block container type. */ SI_PIMA_CONTAINER_CommandBlock = 1, /**< Command Block container type. */
CType_DataBlock = 2, /**< Data Block container type. */ SI_PIMA_CONTAINER_DataBlock = 2, /**< Data Block container type. */
CType_ResponseBlock = 3, /**< Response container type. */ SI_PIMA_CONTAINER_ResponseBlock = 3, /**< Response container type. */
CType_EventBlock = 4, /**< Event Block container type. */ SI_PIMA_CONTAINER_EventBlock = 4, /**< Event Block container type. */
}; };
/* Enums: */ /* Enums: */
/** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */ /** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */
enum SI_PIMA_ResponseCodes_t enum SI_PIMA_ResponseCodes_t
{ {
PIMA_RESPONSE_OK = 1, /**< Response code indicating no error in the issued command. */ SI_PIMA_RESPONSE_OK = 1, /**< Response code indicating no error in the issued command. */
PIMA_RESPONSE_GeneralError = 2, /**< Response code indicating a general error while processing the SI_PIMA_RESPONSE_GeneralError = 2, /**< Response code indicating a general error while processing the
* issued command. * issued command.
*/ */
PIMA_RESPONSE_SessionNotOpen = 3, /**< Response code indicating that the sent command requires an open SI_PIMA_RESPONSE_SessionNotOpen = 3, /**< Response code indicating that the sent command requires an open
* session before being issued. * session before being issued.
*/ */
PIMA_RESPONSE_InvalidTransaction = 4, /**< Response code indicating an invalid transaction occurred. */ SI_PIMA_RESPONSE_InvalidTransaction = 4, /**< Response code indicating an invalid transaction occurred. */
PIMA_RESPONSE_OperationNotSupported = 5, /**< Response code indicating that the issued command is not supported SI_PIMA_RESPONSE_OperationNotSupported = 5, /**< Response code indicating that the issued command is not supported
* by the attached device. * by the attached device.
*/ */
PIMA_RESPONSE_ParameterNotSupported = 6, /**< Response code indicating that one or more of the issued command's SI_PIMA_RESPONSE_ParameterNotSupported = 6, /**< Response code indicating that one or more of the issued command's
* parameters are not supported by the device. * parameters are not supported by the device.
*/ */
}; };

@ -51,7 +51,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
switch (USB_ControlRequest.bRequest) switch (USB_ControlRequest.bRequest)
{ {
case REQ_GetLineEncoding: case CDC_REQ_GetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -60,7 +60,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
} }
break; break;
case REQ_SetLineEncoding: case CDC_REQ_SetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -71,7 +71,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
} }
break; break;
case REQ_SetControlLineState: case CDC_REQ_SetControlLineState:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -83,7 +83,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
} }
break; break;
case REQ_SendBreak: case CDC_REQ_SendBreak:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -248,7 +248,7 @@ void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDC
USB_Request_Header_t Notification = (USB_Request_Header_t) USB_Request_Header_t Notification = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = NOTIF_SerialState, .bRequest = CDC_NOTIF_SerialState,
.wValue = 0, .wValue = 0,
.wIndex = 0, .wIndex = 0,
.wLength = sizeof(CDCInterfaceInfo->State.ControlLineStates.DeviceToHost), .wLength = sizeof(CDCInterfaceInfo->State.ControlLineStates.DeviceToHost),

@ -45,7 +45,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
switch (USB_ControlRequest.bRequest) switch (USB_ControlRequest.bRequest)
{ {
case REQ_GetReport: case HID_REQ_GetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
uint16_t ReportSize = 0; uint16_t ReportSize = 0;
@ -68,7 +68,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
} }
break; break;
case REQ_SetReport: case HID_REQ_SetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
uint16_t ReportSize = USB_ControlRequest.wLength; uint16_t ReportSize = USB_ControlRequest.wLength;
@ -84,7 +84,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
} }
break; break;
case REQ_GetProtocol: case HID_REQ_GetProtocol:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -94,7 +94,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
} }
break; break;
case REQ_SetProtocol: case HID_REQ_SetProtocol:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -104,7 +104,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
} }
break; break;
case REQ_SetIdle: case HID_REQ_SetIdle:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -114,7 +114,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
} }
break; break;
case REQ_GetIdle: case HID_REQ_GetIdle:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -158,7 +158,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
memset(ReportINData, 0, sizeof(ReportINData)); memset(ReportINData, 0, sizeof(ReportINData));
bool ForceSend = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, REPORT_ITEM_TYPE_In, bool ForceSend = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, HID_REPORT_ITEM_In,
ReportINData, &ReportINSize); ReportINData, &ReportINSize);
bool StatesChanged = false; bool StatesChanged = false;
bool IdlePeriodElapsed = (HIDInterfaceInfo->State.IdleCount && !(HIDInterfaceInfo->State.IdleMSRemaining)); bool IdlePeriodElapsed = (HIDInterfaceInfo->State.IdleCount && !(HIDInterfaceInfo->State.IdleMSRemaining));

@ -156,7 +156,7 @@
* \param[in,out] ReportID If preset to a non-zero value, this is the report ID being requested by the host. If zero, * \param[in,out] ReportID If preset to a non-zero value, this is the report ID being requested by the host. If zero,
* this should be set to the report ID of the generated HID input report (if any). If multiple * this should be set to the report ID of the generated HID input report (if any). If multiple
* reports are not sent via the given HID interface, this parameter should be ignored. * reports are not sent via the given HID interface, this parameter should be ignored.
* \param[in] ReportType Type of HID report to generate, either \ref REPORT_ITEM_TYPE_In or \ref REPORT_ITEM_TYPE_Feature. * \param[in] ReportType Type of HID report to generate, either \ref HID_REPORT_ITEM_In or \ref HID_REPORT_ITEM_Feature.
* \param[out] ReportData Pointer to a buffer where the generated HID report should be stored. * \param[out] ReportData Pointer to a buffer where the generated HID report should be stored.
* \param[out] ReportSize Number of bytes in the generated input report, or zero if no report is to be sent. * \param[out] ReportSize Number of bytes in the generated input report, or zero if no report is to be sent.
* *
@ -177,7 +177,7 @@
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state. * \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
* \param[in] ReportID Report ID of the received output report. If multiple reports are not received via the given HID * \param[in] ReportID Report ID of the received output report. If multiple reports are not received via the given HID
* interface, this parameter should be ignored. * interface, this parameter should be ignored.
* \param[in] ReportType Type of received HID report, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature. * \param[in] ReportType Type of received HID report, either \ref HID_REPORT_ITEM_Out or \ref HID_REPORT_ITEM_Feature.
* \param[in] ReportData Pointer to a buffer where the received HID report is stored. * \param[in] ReportData Pointer to a buffer where the received HID report is stored.
* \param[in] ReportSize Size in bytes of the received report from the host. * \param[in] ReportSize Size in bytes of the received report from the host.
*/ */

@ -48,7 +48,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac
switch (USB_ControlRequest.bRequest) switch (USB_ControlRequest.bRequest)
{ {
case REQ_MassStorageReset: case MS_REQ_MassStorageReset:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -58,7 +58,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac
} }
break; break;
case REQ_GetMaxLUN: case MS_REQ_GetMaxLUN:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -107,12 +107,12 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber); Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
MSInterfaceInfo->State.CommandStatus.Status = CALLBACK_MS_Device_SCSICommandReceived(MSInterfaceInfo) ? MSInterfaceInfo->State.CommandStatus.Status = CALLBACK_MS_Device_SCSICommandReceived(MSInterfaceInfo) ?
SCSI_Command_Pass : SCSI_Command_Fail; MS_SCSI_COMMAND_Pass : MS_SCSI_COMMAND_Fail;
MSInterfaceInfo->State.CommandStatus.Signature = MS_CSW_SIGNATURE; MSInterfaceInfo->State.CommandStatus.Signature = MS_CSW_SIGNATURE;
MSInterfaceInfo->State.CommandStatus.Tag = MSInterfaceInfo->State.CommandBlock.Tag; MSInterfaceInfo->State.CommandStatus.Tag = MSInterfaceInfo->State.CommandBlock.Tag;
MSInterfaceInfo->State.CommandStatus.DataTransferResidue = MSInterfaceInfo->State.CommandBlock.DataTransferLength; MSInterfaceInfo->State.CommandStatus.DataTransferResidue = MSInterfaceInfo->State.CommandBlock.DataTransferLength;
if ((MSInterfaceInfo->State.CommandStatus.Status == SCSI_Command_Fail) && if ((MSInterfaceInfo->State.CommandStatus.Status == MS_SCSI_COMMAND_Fail) &&
(MSInterfaceInfo->State.CommandStatus.DataTransferResidue)) (MSInterfaceInfo->State.CommandStatus.DataTransferResidue))
{ {
Endpoint_StallTransaction(); Endpoint_StallTransaction();

@ -77,7 +77,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
switch (USB_ControlRequest.bRequest) switch (USB_ControlRequest.bRequest)
{ {
case REQ_SendEncapsulatedCommand: case RNDIS_REQ_SendEncapsulatedCommand:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
@ -88,7 +88,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
} }
break; break;
case REQ_GetEncapsulatedResponse: case RNDIS_REQ_GetEncapsulatedResponse:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;

@ -212,7 +212,7 @@ void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
USB_Request_Header_t Notification; USB_Request_Header_t Notification;
Pipe_Read_Stream_LE(&Notification, sizeof(USB_Request_Header_t), NO_STREAM_CALLBACK); Pipe_Read_Stream_LE(&Notification, sizeof(USB_Request_Header_t), NO_STREAM_CALLBACK);
if ((Notification.bRequest == NOTIF_SerialState) && if ((Notification.bRequest == CDC_NOTIF_SerialState) &&
(Notification.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))) (Notification.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)))
{ {
Pipe_Read_Stream_LE(&CDCInterfaceInfo->State.ControlLineStates.DeviceToHost, Pipe_Read_Stream_LE(&CDCInterfaceInfo->State.ControlLineStates.DeviceToHost,
@ -239,7 +239,7 @@ uint8_t CDC_Host_SetLineEncoding(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInf
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SetLineEncoding, .bRequest = CDC_REQ_SetLineEncoding,
.wValue = 0, .wValue = 0,
.wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber, .wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber,
.wLength = sizeof(CDCInterfaceInfo->State.LineEncoding), .wLength = sizeof(CDCInterfaceInfo->State.LineEncoding),
@ -255,7 +255,7 @@ uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCI
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SetControlLineState, .bRequest = CDC_REQ_SetControlLineState,
.wValue = CDCInterfaceInfo->State.ControlLineStates.HostToDevice, .wValue = CDCInterfaceInfo->State.ControlLineStates.HostToDevice,
.wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber, .wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber,
.wLength = 0, .wLength = 0,
@ -272,7 +272,7 @@ uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SendBreak, .bRequest = CDC_REQ_SendBreak,
.wValue = Duration, .wValue = Duration,
.wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber, .wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber,
.wLength = 0, .wLength = 0,

@ -62,12 +62,10 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
(CurrentHIDInterface->Protocol != HIDInterfaceInfo->Config.HIDInterfaceProtocol)); (CurrentHIDInterface->Protocol != HIDInterfaceInfo->Config.HIDInterfaceProtocol));
HIDInterfaceInfo->State.InterfaceNumber = CurrentHIDInterface->InterfaceNumber; HIDInterfaceInfo->State.InterfaceNumber = CurrentHIDInterface->InterfaceNumber;
HIDInterfaceInfo->State.SupportsBootProtocol = (CurrentHIDInterface->SubClass != HID_NON_BOOT_PROTOCOL); HIDInterfaceInfo->State.SupportsBootProtocol = (CurrentHIDInterface->SubClass != HID_BOOTP_NonBootProtocol);
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, DCOMP_HID_NextHID) != DESCRIPTOR_SEARCH_COMP_Found) if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, DCOMP_HID_NextHID) != DESCRIPTOR_SEARCH_COMP_Found)
{
return HID_ENUMERROR_NoHIDDescriptorFound; return HID_ENUMERROR_NoHIDDescriptorFound;
}
HIDInterfaceInfo->State.HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_HID_Descriptor_HID_t).HIDReportLength; HIDInterfaceInfo->State.HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_HID_Descriptor_HID_t).HIDReportLength;
@ -127,7 +125,7 @@ static uint8_t DCOMP_HID_Host_NextHIDInterface(void* const CurrentDescriptor)
static uint8_t DCOMP_HID_NextHID(void* const CurrentDescriptor) static uint8_t DCOMP_HID_NextHID(void* const CurrentDescriptor)
{ {
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID) if (DESCRIPTOR_TYPE(CurrentDescriptor) == HID_DTYPE_HID)
return DESCRIPTOR_SEARCH_Found; return DESCRIPTOR_SEARCH_Found;
else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
return DESCRIPTOR_SEARCH_Fail; return DESCRIPTOR_SEARCH_Fail;
@ -161,10 +159,10 @@ uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SetReport, .bRequest = HID_REQ_SetReport,
.wValue = ((REPORT_ITEM_TYPE_In + 1) << 8) | ReportID, .wValue = ((HID_REPORT_ITEM_In + 1) << 8) | ReportID,
.wIndex = HIDInterfaceInfo->State.InterfaceNumber, .wIndex = HIDInterfaceInfo->State.InterfaceNumber,
.wLength = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In), .wLength = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, HID_REPORT_ITEM_In),
}; };
Pipe_SelectPipe(PIPE_CONTROLPIPE); Pipe_SelectPipe(PIPE_CONTROLPIPE);
@ -198,7 +196,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
*(BufferPos++) = ReportID; *(BufferPos++) = ReportID;
} }
ReportSize = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In); ReportSize = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, HID_REPORT_ITEM_In);
} }
else else
#endif #endif
@ -227,7 +225,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
if ((USB_HostState != HOST_STATE_Configured) || !(HIDInterfaceInfo->State.IsActive)) if ((USB_HostState != HOST_STATE_Configured) || !(HIDInterfaceInfo->State.IsActive))
return false; return false;
if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == REPORT_ITEM_TYPE_Out)) if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == HID_REPORT_ITEM_Out))
{ {
uint8_t ErrorCode; uint8_t ErrorCode;
@ -251,7 +249,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SetReport, .bRequest = HID_REQ_SetReport,
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
.wValue = ((ReportType + 1) << 8) | ReportID, .wValue = ((ReportType + 1) << 8) | ReportID,
#else #else
@ -291,7 +289,7 @@ uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInf
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SetProtocol, .bRequest = HID_REQ_SetProtocol,
.wValue = 0, .wValue = 0,
.wIndex = HIDInterfaceInfo->State.InterfaceNumber, .wIndex = HIDInterfaceInfo->State.InterfaceNumber,
.wLength = 0, .wLength = 0,
@ -322,7 +320,7 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
{ {
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE), .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
.bRequest = REQ_GetDescriptor, .bRequest = REQ_GetDescriptor,
.wValue = (DTYPE_Report << 8), .wValue = (HID_DTYPE_Report << 8),
.wIndex = HIDInterfaceInfo->State.InterfaceNumber, .wIndex = HIDInterfaceInfo->State.InterfaceNumber,
.wLength = HIDInterfaceInfo->State.HIDReportSize, .wLength = HIDInterfaceInfo->State.HIDReportSize,
}; };
@ -337,7 +335,7 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SetProtocol, .bRequest = HID_REQ_SetProtocol,
.wValue = 1, .wValue = 1,
.wIndex = HIDInterfaceInfo->State.InterfaceNumber, .wIndex = HIDInterfaceInfo->State.InterfaceNumber,
.wLength = 0, .wLength = 0,

@ -92,9 +92,8 @@
bool DataOUTPipeDoubleBank; /**< Indicates if the HID interface's OUT data pipe should use double banking. */ bool DataOUTPipeDoubleBank; /**< Indicates if the HID interface's OUT data pipe should use double banking. */
uint8_t HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific uint8_t HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific
* boot subclass protocol is required, either \ref HID_BOOT_MOUSE_PROTOCOL, * boot subclass protocol is required, a value from the \ref HID_BootProtocols_t
* \ref HID_BOOT_KEYBOARD_PROTOCOL or \ref HID_NON_BOOT_PROTOCOL if any * enum.
* HID device should be enumerated by the interface.
*/ */
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol
@ -212,7 +211,7 @@
* *
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state. * \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
* \param[in] ReportID Report ID of the report to send to the device, or 0 if the device does not use report IDs. * \param[in] ReportID Report ID of the report to send to the device, or 0 if the device does not use report IDs.
* \param[in] ReportType Type of report to issue to the device, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature. * \param[in] ReportType Type of report to issue to the device, either \ref HID_REPORT_ITEM_Out or \ref HID_REPORT_ITEM_Feature.
* \param[in] Buffer Buffer containing the report to send to the attached device. * \param[in] Buffer Buffer containing the report to send to the attached device.
* \param[in] ReportSize Report size in bytes to send to the attached device. * \param[in] ReportSize Report size in bytes to send to the attached device.
* *

@ -244,11 +244,11 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
uint8_t ItemTag = (HIDReportItem & TAG_MASK); uint8_t ItemTag = (HIDReportItem & TAG_MASK);
if (ItemTag == TAG_MAIN_INPUT) if (ItemTag == TAG_MAIN_INPUT)
NewReportItem.ItemType = REPORT_ITEM_TYPE_In; NewReportItem.ItemType = HID_REPORT_ITEM_In;
else if (ItemTag == TAG_MAIN_OUTPUT) else if (ItemTag == TAG_MAIN_OUTPUT)
NewReportItem.ItemType = REPORT_ITEM_TYPE_Out; NewReportItem.ItemType = HID_REPORT_ITEM_Out;
else else
NewReportItem.ItemType = REPORT_ITEM_TYPE_Feature; NewReportItem.ItemType = HID_REPORT_ITEM_Feature;
NewReportItem.BitOffset = CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType]; NewReportItem.BitOffset = CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType];

@ -284,7 +284,7 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* const MSInterf
Pipe_ClearIN(); Pipe_ClearIN();
Pipe_Freeze(); Pipe_Freeze();
if (SCSICommandStatus->Status != SCSI_Command_Pass) if (SCSICommandStatus->Status != MS_SCSI_COMMAND_Pass)
ErrorCode = MS_ERROR_LOGICAL_CMD_FAILED; ErrorCode = MS_ERROR_LOGICAL_CMD_FAILED;
return ErrorCode; return ErrorCode;

@ -202,7 +202,7 @@ static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const R
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SendEncapsulatedCommand, .bRequest = RNDIS_REQ_SendEncapsulatedCommand,
.wValue = 0, .wValue = 0,
.wIndex = RNDISInterfaceInfo->State.ControlInterfaceNumber, .wIndex = RNDISInterfaceInfo->State.ControlInterfaceNumber,
.wLength = Length, .wLength = Length,
@ -219,7 +219,7 @@ static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const R
USB_ControlRequest = (USB_Request_Header_t) USB_ControlRequest = (USB_Request_Header_t)
{ {
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE), .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_GetEncapsulatedResponse, .bRequest = RNDIS_REQ_GetEncapsulatedResponse,
.wValue = 0, .wValue = 0,
.wIndex = RNDISInterfaceInfo->State.ControlInterfaceNumber, .wIndex = RNDISInterfaceInfo->State.ControlInterfaceNumber,
.wLength = Length, .wLength = Length,

@ -36,7 +36,7 @@
#define __INCLUDE_FROM_SI_DRIVER #define __INCLUDE_FROM_SI_DRIVER
#include "StillImage.h" #include "StillImage.h"
uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
uint16_t ConfigDescriptorSize, uint16_t ConfigDescriptorSize,
void* DeviceConfigDescriptor) void* DeviceConfigDescriptor)
{ {
@ -145,7 +145,7 @@ uint8_t DCOMP_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor)
return DESCRIPTOR_SEARCH_NotFound; return DESCRIPTOR_SEARCH_NotFound;
} }
uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader) SI_PIMA_Container_t* const PIMAHeader)
{ {
uint8_t ErrorCode; uint8_t ErrorCode;
@ -176,7 +176,7 @@ uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceIn
return PIPE_RWSTREAM_NoError; return PIPE_RWSTREAM_NoError;
} }
uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader) SI_PIMA_Container_t* const PIMAHeader)
{ {
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS; uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
@ -226,7 +226,7 @@ uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfac
Pipe_Read_Stream_LE(PIMAHeader, PIMA_COMMAND_SIZE(0), NO_STREAM_CALLBACK); Pipe_Read_Stream_LE(PIMAHeader, PIMA_COMMAND_SIZE(0), NO_STREAM_CALLBACK);
if (PIMAHeader->Type == CType_ResponseBlock) if (PIMAHeader->Type == SI_PIMA_CONTAINER_ResponseBlock)
{ {
uint8_t ParamBytes = (PIMAHeader->DataLength - PIMA_COMMAND_SIZE(0)); uint8_t ParamBytes = (PIMAHeader->DataLength - PIMA_COMMAND_SIZE(0));
@ -241,7 +241,7 @@ uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfac
return PIPE_RWSTREAM_NoError; return PIPE_RWSTREAM_NoError;
} }
uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
void* Buffer, void* Buffer,
const uint16_t Bytes) const uint16_t Bytes)
{ {
@ -261,7 +261,7 @@ uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
return ErrorCode; return ErrorCode;
} }
uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
void* Buffer, void* Buffer,
const uint16_t Bytes) const uint16_t Bytes)
{ {
@ -280,7 +280,7 @@ uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
return ErrorCode; return ErrorCode;
} }
bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) bool SI_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
{ {
bool IsEventReceived = false; bool IsEventReceived = false;
@ -298,7 +298,7 @@ bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
return IsEventReceived; return IsEventReceived;
} }
uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader) SI_PIMA_Container_t* const PIMAHeader)
{ {
uint8_t ErrorCode; uint8_t ErrorCode;
@ -317,7 +317,7 @@ uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfac
return ErrorCode; return ErrorCode;
} }
uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) uint8_t SI_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
{ {
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive)) if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return HOST_SENDCONTROL_DeviceDisconnected; return HOST_SENDCONTROL_DeviceDisconnected;
@ -330,18 +330,18 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t) SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
{ {
.DataLength = PIMA_COMMAND_SIZE(1), .DataLength = PIMA_COMMAND_SIZE(1),
.Type = CType_CommandBlock, .Type = SI_PIMA_CONTAINER_CommandBlock,
.Code = 0x1002, .Code = 0x1002,
.Params = {1}, .Params = {1},
}; };
if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
if ((ErrorCode = SImage_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
if ((PIMABlock.Type != CType_ResponseBlock) || (PIMABlock.Code != 0x2001)) if ((PIMABlock.Type != SI_PIMA_CONTAINER_ResponseBlock) || (PIMABlock.Code != 0x2001))
return SI_ERROR_LOGICAL_CMD_FAILED; return SI_ERROR_LOGICAL_CMD_FAILED;
SIInterfaceInfo->State.IsSessionOpen = true; SIInterfaceInfo->State.IsSessionOpen = true;
@ -349,7 +349,7 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
return PIPE_RWSTREAM_NoError; return PIPE_RWSTREAM_NoError;
} }
uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) uint8_t SI_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
{ {
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive)) if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return HOST_SENDCONTROL_DeviceDisconnected; return HOST_SENDCONTROL_DeviceDisconnected;
@ -359,26 +359,26 @@ uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t) SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
{ {
.DataLength = PIMA_COMMAND_SIZE(1), .DataLength = PIMA_COMMAND_SIZE(1),
.Type = CType_CommandBlock, .Type = SI_PIMA_CONTAINER_CommandBlock,
.Code = 0x1003, .Code = 0x1003,
.Params = {1}, .Params = {1},
}; };
if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
if ((ErrorCode = SImage_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
SIInterfaceInfo->State.IsSessionOpen = false; SIInterfaceInfo->State.IsSessionOpen = false;
if ((PIMABlock.Type != CType_ResponseBlock) || (PIMABlock.Code != 0x2001)) if ((PIMABlock.Type != SI_PIMA_CONTAINER_ResponseBlock) || (PIMABlock.Code != 0x2001))
return SI_ERROR_LOGICAL_CMD_FAILED; return SI_ERROR_LOGICAL_CMD_FAILED;
return PIPE_RWSTREAM_NoError; return PIPE_RWSTREAM_NoError;
} }
uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
const uint16_t Operation, const uint16_t Operation,
const uint8_t TotalParams, const uint8_t TotalParams,
uint32_t* const Params) uint32_t* const Params)
@ -391,19 +391,19 @@ uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t) SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
{ {
.DataLength = PIMA_COMMAND_SIZE(TotalParams), .DataLength = PIMA_COMMAND_SIZE(TotalParams),
.Type = CType_CommandBlock, .Type = SI_PIMA_CONTAINER_CommandBlock,
.Code = Operation, .Code = Operation,
}; };
memcpy(&PIMABlock.Params, Params, sizeof(uint32_t) * TotalParams); memcpy(&PIMABlock.Params, Params, sizeof(uint32_t) * TotalParams);
if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
return PIPE_RWSTREAM_NoError; return PIPE_RWSTREAM_NoError;
} }
uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) uint8_t SI_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
{ {
uint8_t ErrorCode; uint8_t ErrorCode;
SI_PIMA_Container_t PIMABlock; SI_PIMA_Container_t PIMABlock;
@ -411,10 +411,10 @@ uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceIn
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive)) if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
return HOST_SENDCONTROL_DeviceDisconnected; return HOST_SENDCONTROL_DeviceDisconnected;
if ((ErrorCode = SImage_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
if ((PIMABlock.Type != CType_ResponseBlock) || (PIMABlock.Code != 0x2001)) if ((PIMABlock.Type != SI_PIMA_CONTAINER_ResponseBlock) || (PIMABlock.Code != 0x2001))
return SI_ERROR_LOGICAL_CMD_FAILED; return SI_ERROR_LOGICAL_CMD_FAILED;
return PIPE_RWSTREAM_NoError; return PIPE_RWSTREAM_NoError;

@ -97,7 +97,7 @@
struct struct
{ {
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
* after \ref SImage_Host_ConfigurePipes() is called and the Host state machine is in the * after \ref SI_Host_ConfigurePipes() is called and the Host state machine is in the
* Configured state. * Configured state.
*/ */
@ -114,7 +114,7 @@
} USB_ClassInfo_SI_Host_t; } USB_ClassInfo_SI_Host_t;
/* Enums: */ /* Enums: */
/** Enum for the possible error codes returned by the \ref SImage_Host_ConfigurePipes() function. */ /** Enum for the possible error codes returned by the \ref SI_Host_ConfigurePipes() function. */
enum SIHost_EnumerationFailure_ErrorCodes_t enum SIHost_EnumerationFailure_ErrorCodes_t
{ {
SI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */ SI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
@ -140,7 +140,7 @@
* *
* \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum. * \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum.
*/ */
uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
uint16_t ConfigDescriptorSize, uint16_t ConfigDescriptorSize,
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3); void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
@ -155,7 +155,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
* returned a logical command failure. * returned a logical command failure.
*/ */
uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); uint8_t SI_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Closes an already opened PIMA session with the attached device. This should be used after all session-orientated /** Closes an already opened PIMA session with the attached device. This should be used after all session-orientated
* PIMA commands have been issued to the device. * PIMA commands have been issued to the device.
@ -168,7 +168,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
* returned a logical command failure. * returned a logical command failure.
*/ */
uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); uint8_t SI_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Sends a raw PIMA block header to the device, filling out the transaction ID automatically. This can be used to send /** Sends a raw PIMA block header to the device, filling out the transaction ID automatically. This can be used to send
* arbitrary PIMA blocks to the device with or without parameters. * arbitrary PIMA blocks to the device with or without parameters.
@ -181,7 +181,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(2); ATTR_NON_NULL_PTR_ARG(2);
@ -196,7 +196,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(2); ATTR_NON_NULL_PTR_ARG(2);
@ -213,7 +213,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
* returned a logical command failure. * returned a logical command failure.
*/ */
uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
const uint16_t Operation, const uint16_t Operation,
const uint8_t TotalParams, const uint8_t TotalParams,
uint32_t* const Params) ATTR_NON_NULL_PTR_ARG(1); uint32_t* const Params) ATTR_NON_NULL_PTR_ARG(1);
@ -229,7 +229,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
* returned a logical command failure. * returned a logical command failure.
*/ */
uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); uint8_t SI_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Indicates if the device has issued a PIMA event block to the host via the asynchronous events pipe. /** Indicates if the device has issued a PIMA event block to the host via the asynchronous events pipe.
* *
@ -240,7 +240,7 @@
* *
* \return Boolean true if an event is waiting to be read, false otherwise. * \return Boolean true if an event is waiting to be read, false otherwise.
*/ */
bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); bool SI_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Receives an asynchronous event block from the device via the asynchronous events pipe. /** Receives an asynchronous event block from the device via the asynchronous events pipe.
* *
@ -253,7 +253,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
* returned a logical command failure. * returned a logical command failure.
*/ */
uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
ATTR_NON_NULL_PTR_ARG(2); ATTR_NON_NULL_PTR_ARG(2);
@ -269,7 +269,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
void* Buffer, void* Buffer,
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
@ -285,7 +285,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
void* Buffer, void* Buffer,
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
@ -296,8 +296,8 @@
* *
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state. * \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
*/ */
static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); static inline void SI_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) static inline void SI_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
{ {
(void)SIInterfaceInfo; (void)SIInterfaceInfo;
} }

@ -212,6 +212,8 @@
DTYPE_Other = 0x07, /**< Indicates that the descriptor is of other type. */ DTYPE_Other = 0x07, /**< Indicates that the descriptor is of other type. */
DTYPE_InterfacePower = 0x08, /**< Indicates that the descriptor is an interface power descriptor. */ DTYPE_InterfacePower = 0x08, /**< Indicates that the descriptor is an interface power descriptor. */
DTYPE_InterfaceAssociation = 0x0B, /**< Indicates that the descriptor is an interface association descriptor. */ DTYPE_InterfaceAssociation = 0x0B, /**< Indicates that the descriptor is an interface association descriptor. */
DTYPE_CSInterface = 0x24, /**< Indicates that the descriptor is a class specific interface descriptor. */
DTYPE_CSEndpoint = 0x25, /**< Indicates that the descriptor is a class specific endpoint descriptor. */
}; };
/* Type Defines: */ /* Type Defines: */

@ -42,6 +42,7 @@
* to free up the Start of Frame flag for interrupt use in the user application * to free up the Start of Frame flag for interrupt use in the user application
* - All project makefiles now correctly clean intermediate build files from assembly and C++ sources (thanks to Daniel Czigany) * - All project makefiles now correctly clean intermediate build files from assembly and C++ sources (thanks to Daniel Czigany)
* - Removed the EVENT_USB_InitFailure() event, not specifying a USB mode now defaults to UID selection mode * - Removed the EVENT_USB_InitFailure() event, not specifying a USB mode now defaults to UID selection mode
* - Renamed and moved class driver common constant definitions to make the naming scheme more uniform
* *
* <b>Fixed:</b> * <b>Fixed:</b>
* - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist * - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist

@ -18,11 +18,11 @@
* -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error * -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error
* -# Change makefiles to allow for absolute LUFA location to be used * -# Change makefiles to allow for absolute LUFA location to be used
* -# Re-add interrupt Pipe/Endpoint support * -# Re-add interrupt Pipe/Endpoint support
* -# Fix intermittent device mode enumeration errors
* - Documentation/Support * - Documentation/Support
* -# Add detailed overviews of how each demo works * -# Add detailed overviews of how each demo works
* -# Add board overviews * -# Add board overviews
* -# Write LUFA tutorials * -# Write LUFA tutorials
* -# Add makefile template
* - Demos/Projects * - Demos/Projects
* -# Multiple-Report HID device * -# Multiple-Report HID device
* -# Device/Host USB bridge * -# Device/Host USB bridge
@ -31,6 +31,7 @@
* -# Finish BluetoothHost demo * -# Finish BluetoothHost demo
* -# Finish SideShow demo * -# Finish SideShow demo
* -# Finish StandaloneProgrammer project * -# Finish StandaloneProgrammer project
* -# Arduino Uno compatible USB-MIDI, USB-HID
* - Ports * - Ports
* -# AVR32 UC3B series microcontrollers * -# AVR32 UC3B series microcontrollers
* -# Atmel ARM7 series microcontrollers * -# Atmel ARM7 series microcontrollers

@ -32,6 +32,8 @@
* replace all references to the obsolete function name with the new function name. * replace all references to the obsolete function name with the new function name.
* - The names of the class specific descriptor type defines in the USB Class drivers have changed - refer to the driver documentation * - The names of the class specific descriptor type defines in the USB Class drivers have changed - refer to the driver documentation
* for each class driver for the new class specific descriptor type names. * for each class driver for the new class specific descriptor type names.
* - The Still Image Host class' function prefix has been changed from "SImage_" to "SI_", to remain consistent with the rest of the
* driver's enums, type defines and constants.
* *
* \section Sec_Migration100807 Migrating from 100513 to 100807 * \section Sec_Migration100807 Migrating from 100513 to 100807
* *
@ -120,7 +122,7 @@
* *
* <b>Host Mode</b> * <b>Host Mode</b>
* - The Still Image Host Class driver SI_Host_USBTask() and SI_Host_ConfigurePipes() functions were misnamed, and are * - The Still Image Host Class driver SI_Host_USBTask() and SI_Host_ConfigurePipes() functions were misnamed, and are
* now named \ref SImage_Host_USBTask() and \ref SImage_Host_ConfigurePipes() respectively. * now named SImage_Host_USBTask() and SImage_Host_ConfigurePipes() respectively.
* - The HOST_SENDCONTROL_DeviceDisconnect enum value has been renamed to \ref HOST_SENDCONTROL_DeviceDisconnected to be in * - The HOST_SENDCONTROL_DeviceDisconnect enum value has been renamed to \ref HOST_SENDCONTROL_DeviceDisconnected to be in
* line with the rest of the library error codes. * line with the rest of the library error codes.
* - The HID Parser item usages no longer contain separate minimum and maximum values, as this was a violation of the HID * - The HID Parser item usages no longer contain separate minimum and maximum values, as this was a violation of the HID

@ -102,28 +102,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.CDC_Functional_IntHeader = .CDC_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC_Functional_AbstractControlManagement = .CDC_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x06} .Capabilities = 0x06,
}, },
.CDC_Functional_Union = .CDC_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x00, 0x01} .MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
}, },
.CDC_NotificationEndpoint = .CDC_NotificationEndpoint =

@ -67,9 +67,9 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t CDC_CCI_Interface; USB_Descriptor_Interface_t CDC_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;

@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.CDC_Functional_IntHeader = .CDC_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC_Functional_AbstractControlManagement = .CDC_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x06} .Capabilities = 0x06,
}, },
.CDC_Functional_Union = .CDC_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x00, 0x01} .MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
}, },
.CDC_NotificationEndpoint = .CDC_NotificationEndpoint =

@ -67,9 +67,9 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t CDC_CCI_Interface; USB_Descriptor_Interface_t CDC_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;

@ -138,12 +138,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.HID_KeyboardHID = .HID_KeyboardHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(KeyboardReport) .HIDReportLength = sizeof(KeyboardReport)
}, },
@ -234,11 +234,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_KeyboardHID; Address = &ConfigurationDescriptor.HID_KeyboardHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &KeyboardReport; Address = &KeyboardReport;
Size = sizeof(KeyboardReport); Size = sizeof(KeyboardReport);
break; break;

@ -165,7 +165,7 @@ void EVENT_USB_Device_StartOfFrame(void)
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -209,7 +209,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID interface structure for the HID interface being referenced * \param[in] HIDInterfaceInfo Pointer to the HID interface structure for the HID interface being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to the report buffer where the received report is stored * \param[in] ReportData Pointer to the report buffer where the received report is stored
* \param[in] ReportSize Size in bytes of the report received from the host * \param[in] ReportSize Size in bytes of the report received from the host
*/ */

@ -171,19 +171,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Class = 0x03, .Class = 0x03,
.SubClass = 0x00, .SubClass = 0x00,
.Protocol = HID_NON_BOOT_PROTOCOL, .Protocol = HID_BOOTP_NonBootProtocol,
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.HID_GenericHID = .HID_GenericHID =
{ {
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID}, .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11), .HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00, .CountryCode = 0x00,
.TotalReportDescriptors = 1, .TotalReportDescriptors = 1,
.HIDReportType = DTYPE_Report, .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(GenericReport) .HIDReportLength = sizeof(GenericReport)
}, },
@ -275,11 +275,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
} }
break; break;
case DTYPE_HID: case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_GenericHID; Address = &ConfigurationDescriptor.HID_GenericHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break; break;
case DTYPE_Report: case HID_DTYPE_Report:
Address = &GenericReport; Address = &GenericReport;
Size = sizeof(GenericReport); Size = sizeof(GenericReport);
break; break;

@ -272,7 +272,7 @@ bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSI
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the
* generated report ID * generated report ID
* \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature * \param[in] ReportType Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
* \param[out] ReportData Pointer to a buffer where the created report should be stored * \param[out] ReportData Pointer to a buffer where the created report should be stored
* \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent
* *
@ -299,7 +299,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* *
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host * \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
* \param[in] ReportData Pointer to a buffer where the created report has been stored * \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report * \param[in] ReportSize Size in bytes of the received HID report
*/ */

@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.CDC_Functional_IntHeader = .CDC_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC_Functional_AbstractControlManagement = .CDC_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x06} .Capabilities = 0x06,
}, },
.CDC_Functional_Union = .CDC_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x00, 0x01} .MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
}, },
.CDC_NotificationEndpoint = .CDC_NotificationEndpoint =

@ -67,9 +67,9 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t CDC_CCI_Interface; USB_Descriptor_Interface_t CDC_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;

@ -114,28 +114,29 @@ USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor =
.InterfaceStrIndex = NO_DESCRIPTOR .InterfaceStrIndex = NO_DESCRIPTOR
}, },
.CDC_Functional_IntHeader = .CDC_Functional_Header =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.SubType = 0x00, .Subtype = CDC_DSUBTYPE_CSInterface_Header,
.Data = {0x01, 0x10} .CDCSpecification = VERSION_BCD(01.10),
}, },
.CDC_Functional_AbstractControlManagement = .CDC_Functional_ACM =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
.SubType = 0x02, .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
.Data = {0x06} .Capabilities = 0x06,
}, },
.CDC_Functional_Union = .CDC_Functional_Union =
{ {
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.SubType = 0x06, .Subtype = CDC_DSUBTYPE_CSInterface_Union,
.Data = {0x00, 0x01} .MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
}, },
.CDC_NotificationEndpoint = .CDC_NotificationEndpoint =

@ -67,9 +67,9 @@
{ {
USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t CDC_CCI_Interface; USB_Descriptor_Interface_t CDC_CCI_Interface;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Interface_t CDC_DCI_Interface;
USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;

Loading…
Cancel
Save