diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.c b/Demos/Device/ClassDriver/AudioInput/Descriptors.c index ba8c00182c..991b33e302 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.c @@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_ControlInterface_SPC = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_Header, + .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_Header, .ACSpecification = VERSION_BCD(01.00), .TotalLength = (sizeof(USB_Audio_Descriptor_Interface_AC_t) + @@ -113,13 +113,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = sizeof(USB_Audio_Descriptor_OutputTerminal_t)), .InCollection = 1, - .InterfaceNumbers = {1}, + .InterfaceNumber = 1, }, .Audio_InputTerminal = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_InputTerminal, + .Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, .TerminalID = 0x01, .TerminalType = TERMINAL_IN_MIC, @@ -134,8 +134,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_OutputTerminal = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_OutputTerminal, + .Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, .TerminalID = 0x02, .TerminalType = TERMINAL_STREAMING, @@ -180,8 +180,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_StreamInterface_SPC = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_General, + .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_General, .TerminalLink = 0x02, @@ -191,8 +191,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_AudioFormat = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_Format, + .Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_FormatType, .FormatType = 0x01, .Channels = 0x01, @@ -222,8 +222,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_StreamEndpoint_SPC = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, - .Subtype = DSUBTYPE_General, + .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint}, + .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, .Attributes = 0x00, diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c index 9f385017ad..57668f2dfe 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c @@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_ControlInterface_SPC = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_Header, + .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_Header, .ACSpecification = VERSION_BCD(01.00), .TotalLength = (sizeof(USB_Audio_Descriptor_Interface_AC_t) + @@ -113,13 +113,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = sizeof(USB_Audio_Descriptor_OutputTerminal_t)), .InCollection = 1, - .InterfaceNumbers = {1}, + .InterfaceNumber = 1, }, .Audio_InputTerminal = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_InputTerminal, + .Header = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, .TerminalID = 0x01, .TerminalType = TERMINAL_STREAMING, @@ -134,8 +134,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_OutputTerminal = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_OutputTerminal, + .Header = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, .TerminalID = 0x02, .TerminalType = TERMINAL_OUT_SPEAKER, @@ -180,8 +180,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_StreamInterface_SPC = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_General, + .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_General, .TerminalLink = 0x01, @@ -191,8 +191,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_AudioFormat = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_Format, + .Header = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_FormatType, .FormatType = 0x01, .Channels = 0x02, @@ -222,8 +222,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_StreamEndpoint_SPC = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint}, - .Subtype = DSUBTYPE_General, + .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint}, + .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, .Attributes = EP_ACCEPTS_SMALL_PACKETS, diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c index 617cebd46e..20ba4936ce 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c @@ -128,28 +128,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC1_Functional_IntHeader = + .CDC1_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC1_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC1_ManagementEndpoint = @@ -228,28 +229,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC2_Functional_IntHeader = + .CDC2_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC2_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x02, 0x03} + .MasterInterfaceNumber = 2, + .SlaveInterfaceNumber = 3, }, .CDC2_ManagementEndpoint = diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h index fd6735ec06..5c1bf53bb4 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h @@ -77,18 +77,18 @@ USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_Association_t CDC1_IAD; USB_Descriptor_Interface_t CDC1_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC1_Functional_IntHeader; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC1_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC1_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC1_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC1_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC1_Functional_Union; USB_Descriptor_Endpoint_t CDC1_ManagementEndpoint; USB_Descriptor_Interface_t CDC1_DCI_Interface; USB_Descriptor_Endpoint_t CDC1_DataOutEndpoint; USB_Descriptor_Endpoint_t CDC1_DataInEndpoint; USB_Descriptor_Interface_Association_t CDC2_IAD; USB_Descriptor_Interface_t CDC2_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC2_Functional_IntHeader; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC2_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC2_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC2_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC2_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC2_Functional_Union; USB_Descriptor_Endpoint_t CDC2_ManagementEndpoint; USB_Descriptor_Interface_t CDC2_DCI_Interface; USB_Descriptor_Endpoint_t CDC2_DataOutEndpoint; diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.c b/Demos/Device/ClassDriver/GenericHID/Descriptors.c index 26d672c458..1964d533c9 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.c +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.c @@ -123,19 +123,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x00, - .Protocol = HID_NON_BOOT_PROTOCOL, + .Protocol = HID_BOOTP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(GenericReport) }, @@ -227,11 +227,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_GenericHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &GenericReport; Size = sizeof(GenericReport); break; diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c index 4fe58a8a2e..d64c1648e1 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c index 217016fd3c..8696e207e6 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.c +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c @@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x00, - .Protocol = HID_NON_BOOT_PROTOCOL, + .Protocol = HID_BOOTP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(JoystickReport) }, @@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_JoystickHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &JoystickReport; Size = sizeof(JoystickReport); break; diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c index 622106fd4e..c759e1346f 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.c +++ b/Demos/Device/ClassDriver/Joystick/Joystick.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.c b/Demos/Device/ClassDriver/Keyboard/Descriptors.c index 63114b1820..ed2cb6c49f 100644 --- a/Demos/Device/ClassDriver/Keyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.c @@ -139,19 +139,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x01, - .Protocol = HID_BOOT_KEYBOARD_PROTOCOL, + .Protocol = HID_BOOTP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(KeyboardReport) }, @@ -243,11 +243,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_KeyboardHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &KeyboardReport; Size = sizeof(KeyboardReport); break; diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index 8d8503031c..755c25a725 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c index 4f7c55b099..bba7ca20dd 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c @@ -172,19 +172,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x01, - .Protocol = HID_BOOT_KEYBOARD_PROTOCOL, + .Protocol = HID_BOOTP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(KeyboardReport) }, @@ -209,19 +209,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x01, - .Protocol = HID_BOOT_MOUSE_PROTOCOL, + .Protocol = HID_BOOTP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(MouseReport) }, @@ -313,7 +313,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: if (!(wIndex)) { Address = &ConfigurationDescriptor.HID1_KeyboardHID; @@ -325,7 +325,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, Size = sizeof(USB_HID_Descriptor_HID_t); } break; - case DTYPE_Report: + case HID_DTYPE_Report: if (!(wIndex)) { Address = &KeyboardReport; diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c index 6ba7ce3d0c..96c430a228 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.c b/Demos/Device/ClassDriver/MIDI/Descriptors.c index 34595419df..b842bd27ea 100644 --- a/Demos/Device/ClassDriver/MIDI/Descriptors.c +++ b/Demos/Device/ClassDriver/MIDI/Descriptors.c @@ -104,14 +104,14 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_ControlInterface_SPC = { - .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_Header, + .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_Header, .ACSpecification = VERSION_BCD(01.00), .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t), .InCollection = 1, - .InterfaceNumbers = {1}, + .InterfaceNumber = 1, }, .Audio_StreamInterface = @@ -132,8 +132,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_StreamInterface_SPC = { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_General, + .Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_General, .AudioSpecification = VERSION_BCD(01.00), @@ -143,10 +143,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .MIDI_In_Jack_Emb = { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_InputJack, + .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, - .JackType = MIDI_JACKTYPE_EMBEDDED, + .JackType = MIDI_JACKTYPE_Embedded, .JackID = 0x01, .JackStrIndex = NO_DESCRIPTOR @@ -154,10 +154,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .MIDI_In_Jack_Ext = { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_InputJack, + .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, - .JackType = MIDI_JACKTYPE_EXTERNAL, + .JackType = MIDI_JACKTYPE_External, .JackID = 0x02, .JackStrIndex = NO_DESCRIPTOR @@ -165,10 +165,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .MIDI_Out_Jack_Emb = { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_OutputJack, + .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, - .JackType = MIDI_JACKTYPE_EMBEDDED, + .JackType = MIDI_JACKTYPE_Embedded, .JackID = 0x03, .NumberOfPins = 1, @@ -180,10 +180,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .MIDI_Out_Jack_Ext = { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_OutputJack, + .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, - .JackType = MIDI_JACKTYPE_EXTERNAL, + .JackType = MIDI_JACKTYPE_External, .JackID = 0x04, .NumberOfPins = 1, @@ -211,8 +211,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .MIDI_In_Jack_Endpoint_SPC = { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint}, - .Subtype = DSUBTYPE_General, + .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint}, + .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, .TotalEmbeddedJacks = 0x01, .AssociatedJackID = {0x01} @@ -236,8 +236,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .MIDI_Out_Jack_Endpoint_SPC = { - .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint}, - .Subtype = DSUBTYPE_General, + .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint}, + .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, .TotalEmbeddedJacks = 0x01, .AssociatedJackID = {0x03} diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c index c14e4c7c9f..12422ad132 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c @@ -188,19 +188,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x01, - .Protocol = 0x01, + .Protocol = HID_BOOTP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(KeyboardReport) }, @@ -292,11 +292,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_KeyboardHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &KeyboardReport; Size = sizeof(KeyboardReport); break; diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c index ba62130767..e5dbfb6758 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.c b/Demos/Device/ClassDriver/Mouse/Descriptors.c index 830255570d..6a699b03d7 100644 --- a/Demos/Device/ClassDriver/Mouse/Descriptors.c +++ b/Demos/Device/ClassDriver/Mouse/Descriptors.c @@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x01, - .Protocol = HID_BOOT_MOUSE_PROTOCOL, + .Protocol = HID_BOOTP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(MouseReport) }, @@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_MouseHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &MouseReport; Size = sizeof(MouseReport); break; diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c index 6efdb9973a..aabd96138f 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.c +++ b/Demos/Device/ClassDriver/Mouse/Mouse.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index 174880962d..d259390c3e 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -104,26 +104,27 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .CDC_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x00} + .Capabilities = 0x00, }, - + .CDC_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC_NotificationEndpoint = diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h index ed4d274b20..26bd57127e 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h @@ -67,9 +67,9 @@ { USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_t CDC_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Header; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Endpoint_t RNDIS_DataOutEndpoint; diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c index 3deaf6d4b5..2e47069fd0 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c @@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC_Functional_IntHeader = + .CDC_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC_NotificationEndpoint = diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h index 1c1f4694d5..159d8d2659 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h @@ -67,9 +67,9 @@ { USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_t CDC_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c index 7d383a4cca..72e89ef278 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c @@ -164,28 +164,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC_Functional_IntHeader = + .CDC_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC_NotificationEndpoint = @@ -245,19 +246,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x01, - .Protocol = HID_BOOT_MOUSE_PROTOCOL, + .Protocol = HID_BOOTP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(MouseReport) }, @@ -349,11 +350,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_MouseHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &MouseReport; Size = sizeof(MouseReport); break; diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h index dfe6c11476..6b6178a93d 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h @@ -75,9 +75,9 @@ USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_Association_t CDC_IAD; USB_Descriptor_Interface_t CDC_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c index 86cdb4e7a4..8372d4e1bc 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.c b/Demos/Device/LowLevel/AudioInput/Descriptors.c index 46b43acabd..3074396114 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.c @@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_ControlInterface_SPC = { - .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_Header, + .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface}, + .Subtype = DSUBTYPE_AudioHeader, .ACSpecification = VERSION_BCD(01.00), .TotalLength = (sizeof(USB_Audio_Interface_AC_t) + @@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .TerminalID = 0x01, @@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .TerminalID = 0x02, @@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .TerminalLink = 0x02, @@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .FormatType = 0x01, @@ -223,7 +223,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .Attributes = 0x00, diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.h b/Demos/Device/LowLevel/AudioInput/Descriptors.h index 1b700a6d3f..d154f01a47 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.h @@ -42,14 +42,8 @@ #include /* 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. */ - #define DSUBTYPE_Header 0x01 + #define DSUBTYPE_AudioHeader 0x01 /** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */ #define DSUBTYPE_InputTerminal 0x02 diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.c b/Demos/Device/LowLevel/AudioOutput/Descriptors.c index 20ce79eaa0..2d749fcd36 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.c @@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_ControlInterface_SPC = { - .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_Header, + .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface}, + .Subtype = DSUBTYPE_AudioHeader, .ACSpecification = VERSION_BCD(01.00), .TotalLength = (sizeof(USB_Audio_Interface_AC_t) + @@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .TerminalID = 0x01, @@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .TerminalID = 0x02, @@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .TerminalLink = 0x01, @@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .FormatType = 0x01, @@ -223,7 +223,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .Attributes = EP_ACCEPTS_SMALL_PACKETS, diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.h b/Demos/Device/LowLevel/AudioOutput/Descriptors.h index 112b900790..cd6b2b8cf9 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.h @@ -42,14 +42,8 @@ #include /* 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. */ - #define DSUBTYPE_Header 0x01 + #define DSUBTYPE_AudioHeader 0x01 /** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */ #define DSUBTYPE_InputTerminal 0x02 diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.c b/Demos/Device/LowLevel/MIDI/Descriptors.c index 33fba26b96..af52cba438 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.c +++ b/Demos/Device/LowLevel/MIDI/Descriptors.c @@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Audio_ControlInterface_SPC = { - .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface}, - .Subtype = DSUBTYPE_Header, + .Header = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface}, + .Subtype = DSUBTYPE_AudioHeader, .ACSpecification = VERSION_BCD(01.00), .TotalLength = sizeof(USB_Audio_Interface_AC_t), @@ -132,7 +132,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .AudioSpecification = VERSION_BCD(01.00), @@ -143,7 +143,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .JackType = JACKTYPE_EMBEDDED, @@ -154,7 +154,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .JackType = JACKTYPE_EXTERNAL, @@ -165,7 +165,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .JackType = JACKTYPE_EMBEDDED, @@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .JackType = JACKTYPE_EXTERNAL, @@ -211,7 +211,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .TotalEmbeddedJacks = 0x01, @@ -236,7 +236,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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, .TotalEmbeddedJacks = 0x01, diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.h b/Demos/Device/LowLevel/MIDI/Descriptors.h index ba65a89cd8..5aebd8fdb3 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.h +++ b/Demos/Device/LowLevel/MIDI/Descriptors.h @@ -42,14 +42,8 @@ #include /* 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. */ - #define DSUBTYPE_Header 0x01 + #define DSUBTYPE_AudioHeader 0x01 /** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */ #define DSUBTYPE_InputJack 0x02 diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.h b/Demos/Device/LowLevel/MassStorage/MassStorage.h index 97b9de04f2..5a5c5f8001 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.h +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.h @@ -89,7 +89,7 @@ /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ #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. */ typedef struct { diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c index 830255570d..6a699b03d7 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c @@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x01, - .Protocol = HID_BOOT_MOUSE_PROTOCOL, + .Protocol = HID_BOOTP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(MouseReport) }, @@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_MouseHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &MouseReport; Size = sizeof(MouseReport); break; diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c index e2a2128e93..be01a2d6b8 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c index dfd67ae62e..4e794dcf28 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c @@ -47,7 +47,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Host_Interface = .DataINPipeNumber = 1, .DataOUTPipeNumber = 2, - .HIDInterfaceProtocol = HID_BOOT_MOUSE_PROTOCOL, + .HIDInterfaceProtocol = HID_BOOTP_MouseBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c index 8420d05ab1..fb48c2b179 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c @@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Joystick_HID_Interface = .DataOUTPipeNumber = 2, .DataOUTPipeDoubleBank = false, - .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, + .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol, .HIDParserData = &HIDReportInfo }, @@ -138,7 +138,7 @@ int main(void) /* Determine what report item is being tested, process updated value as needed */ if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) && - (ReportItem->ItemType == REPORT_ITEM_TYPE_In)) + (ReportItem->ItemType == HID_REPORT_ITEM_In)) { if (ReportItem->Value) LEDMask = LEDS_ALL_LEDS; @@ -146,7 +146,7 @@ int main(void) else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && ((ReportItem->Attributes.Usage.Usage == USAGE_X) || (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); diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index 8bdf2b6ec4..ddce64c244 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c @@ -50,7 +50,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = .DataOUTPipeNumber = 2, .DataOUTPipeDoubleBank = false, - .HIDInterfaceProtocol = HID_BOOT_KEYBOARD_PROTOCOL, + .HIDInterfaceProtocol = HID_BOOTP_KeyboardBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index 9135e53ebc..3fd23f0514 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = .DataOUTPipeNumber = 2, .DataOUTPipeDoubleBank = false, - .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, + .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol, .HIDParserData = &HIDReportInfo }, @@ -138,7 +138,7 @@ int main(void) if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) && (ReportItem->Attributes.BitSize == 8) && (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 */ uint8_t KeyCode = (uint8_t)ReportItem->Value; diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c index a03381cc6a..d76f048d90 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c @@ -50,7 +50,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface = .DataOUTPipeNumber = 2, .DataOUTPipeDoubleBank = false, - .HIDInterfaceProtocol = HID_BOOT_MOUSE_PROTOCOL, + .HIDInterfaceProtocol = HID_BOOTP_MouseBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index 7482b01b01..d02424c7b1 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c @@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface = .DataOUTPipeNumber = 2, .DataOUTPipeDoubleBank = false, - .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL, + .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol, .HIDParserData = &HIDReportInfo }, @@ -138,14 +138,14 @@ int main(void) /* Determine what report item is being tested, process updated value as needed */ if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) && - (ReportItem->ItemType == REPORT_ITEM_TYPE_In)) + (ReportItem->ItemType == HID_REPORT_ITEM_In)) { if (ReportItem->Value) LEDMask = LEDS_ALL_LEDS; } else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && (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); @@ -155,7 +155,7 @@ int main(void) else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && ((ReportItem->Attributes.Usage.Usage == USAGE_X) || (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); diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c index 152639fef8..f5d1b23fd1 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c @@ -86,8 +86,8 @@ int main(void) break; } - if (SImage_Host_ConfigurePipes(&DigitalCamera_SI_Interface, - ConfigDescriptorSize, ConfigDescriptorData) != SI_ENUMERROR_NoError) + if (SI_Host_ConfigurePipes(&DigitalCamera_SI_Interface, + ConfigDescriptorSize, ConfigDescriptorData) != SI_ENUMERROR_NoError) { puts_P(PSTR("Attached Device Not a Valid Still Image Class Device.\r\n")); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); @@ -110,7 +110,7 @@ int main(void) case HOST_STATE_Configured: 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")); USB_HostState = HOST_STATE_WaitForDeviceRemoval; @@ -119,8 +119,8 @@ int main(void) puts_P(PSTR("Turning off Device...\r\n")); - SImage_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, NULL); - if (SImage_Host_ReceiveResponse(&DigitalCamera_SI_Interface)) + SI_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, NULL); + if (SI_Host_ReceiveResponse(&DigitalCamera_SI_Interface)) { puts_P(PSTR("Could not turn off device.\r\n")); USB_HostState = HOST_STATE_WaitForDeviceRemoval; @@ -131,7 +131,7 @@ int main(void) 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")); USB_HostState = HOST_STATE_WaitForDeviceRemoval; @@ -143,7 +143,7 @@ int main(void) break; } - SImage_Host_USBTask(&DigitalCamera_SI_Interface); + SI_Host_USBTask(&DigitalCamera_SI_Interface); USB_USBTask(); } } diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c index e92c242d26..cf469ffec7 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c @@ -193,9 +193,9 @@ void Joystick_HID_Task(void) { HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i]; - uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In]; - uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out]; - uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature]; + uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In]; + uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out]; + uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature]; /* 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"), @@ -258,7 +258,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport) bool FoundData; 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 */ FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem); @@ -274,7 +274,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport) else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && ((ReportItem->Attributes.Usage.Usage == USAGE_X) || (ReportItem->Attributes.Usage.Usage == USAGE_Y)) && - (ReportItem->ItemType == REPORT_ITEM_TYPE_In)) + (ReportItem->ItemType == HID_REPORT_ITEM_In)) { /* Get the joystick relative position value */ FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem); diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c index dfb1a4a087..94aca2fef0 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -194,9 +194,9 @@ void Keyboard_HID_Task(void) { HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i]; - uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In]; - uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out]; - uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature]; + uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In]; + uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out]; + uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature]; /* 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"), @@ -258,7 +258,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport) if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) && (ReportItem->Attributes.BitSize == 8) && (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 */ bool FoundData = USB_GetHIDReportItemInfo(KeyboardReport, ReportItem); diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h index d9e90a8da5..bb038f1c56 100644 --- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h +++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h @@ -75,7 +75,7 @@ /** Additional error code for Mass Storage functions when a device returns a logical command failure. */ #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 * commands for transport over the USB bulk endpoints to the device. */ diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c index 38e4b2564a..5536d872b5 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c @@ -194,9 +194,9 @@ void Mouse_HID_Task(void) { HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i]; - uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In]; - uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out]; - uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature]; + uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In]; + uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out]; + uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature]; /* 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"), @@ -259,7 +259,7 @@ void ProcessMouseReport(uint8_t* MouseReport) bool FoundData; 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 */ FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem); @@ -274,7 +274,7 @@ void ProcessMouseReport(uint8_t* MouseReport) } else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) && (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 * 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) && ((ReportItem->Attributes.Usage.Usage == USAGE_X) || (ReportItem->Attributes.Usage.Usage == USAGE_Y)) && - (ReportItem->ItemType == REPORT_ITEM_TYPE_In)) + (ReportItem->ItemType == HID_REPORT_ITEM_In)) { /* Get the mouse relative position value */ FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem); diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h index 8ee5fa2cbd..f4b7849080 100644 --- a/LUFA/Drivers/USB/Class/Common/Audio.h +++ b/LUFA/Drivers/USB/Class/Common/Audio.h @@ -73,30 +73,6 @@ #define AUDIO_TOTAL_SAMPLE_RATES 1 #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. */ #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. */ #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. */ #define FEATURE_AUTOMATIC_GAIN (1 << 6) @@ -223,7 +197,7 @@ * * \param[in] freq Required audio sampling frequency in HZ */ - #define AUDIO_SAMPLE_FREQ(freq) {LowWord: ((uint32_t)freq & 0x00FFFF), HighByte: (((uint32_t)freq >> 16) & 0x0000FF)} + #define AUDIO_SAMPLE_FREQ(freq) {LowWord: ((uint32_t)freq & 0x00FFFF), HighByte: (((uint32_t)freq >> 16) & 0x0000FF)} /** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint * accepts only filled endpoint packets of audio samples. @@ -234,102 +208,36 @@ * will accept partially filled endpoint packets of audio samples. */ #define EP_ACCEPTS_SMALL_PACKETS (0 << 7) - - /* Type Defines: */ - /** \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 + + /* Enums: */ + /** Audio class specific interface description subtypes, for the Audio Control interface. */ + enum Audio_CSInterface_AC_SubTypes_t { - 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. */ - - 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 class interfaces within this device. */ - uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio 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. */ - - 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). - * - * 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 + AUDIO_DSUBTYPE_CSInterface_Header = 0x01, /**< Audio class specific control interface header. */ + AUDIO_DSUBTYPE_CSInterface_InputTerminal = 0x02, /**< Audio class specific control interface Input Terminal. */ + AUDIO_DSUBTYPE_CSInterface_OutputTerminal = 0x03, /**< Audio class specific control interface Output Terminal. */ + AUDIO_DSUBTYPE_CSInterface_Mixer = 0x04, /**< Audio class specific control interface Mixer Unit. */ + AUDIO_DSUBTYPE_CSInterface_Selector = 0x05, /**< Audio class specific control interface Selector Unit. */ + AUDIO_DSUBTYPE_CSInterface_Feature = 0x06, /**< Audio class specific control interface Feature Unit. */ + AUDIO_DSUBTYPE_CSInterface_Processing = 0x07, /**< Audio class specific control interface Processing Unit. */ + AUDIO_DSUBTYPE_CSInterface_Extension = 0x08, /**< Audio class specific control interface Extension Unit. */ + }; + + /** Audio class specific interface description subtypes, for the Audio Streaming interface. */ + enum Audio_CSInterface_AS_SubTypes_t { - 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 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; + AUDIO_DSUBTYPE_CSInterface_General = 0x01, /**< Audio class specific streaming interface general descriptor. */ + AUDIO_DSUBTYPE_CSInterface_FormatType = 0x02, /**< Audio class specific streaming interface format type descriptor. */ + AUDIO_DSUBTYPE_CSInterface_FormatSpecific = 0x03, /**< Audio class specific streaming interface format information descriptor. */ + }; - /** \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 + /** Audio class specific endpoint description subtypes, for the Audio Streaming interface. */ + enum Audio_CSEndpoint_SubTypes_t { - 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; - + AUDIO_DSUBTYPE_CSEndpoint_General = 0x01, /**< Audio class specific endpoint general descriptor. */ + }; + + /* Type Defines: */ /** \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 @@ -341,8 +249,10 @@ 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. */ - + 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. */ uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */ uint8_t AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals @@ -371,7 +281,9 @@ * 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. */ uint16_t wTerminalType; /**< Type of terminal, a TERMINAL_* mask. */ uint8_t bAssocTerminal; /**< ID of associated output terminal, for physically grouped terminals @@ -395,7 +307,9 @@ 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. */ + 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. */ uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */ @@ -419,11 +333,13 @@ 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 bDescriptorType; /**< Sub type value used to distinguish between audio class-specific descriptors, + * 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. */ uint16_t wTerminalType; /**< Type of terminal, a TERMINAL_* mask. */ uint8_t bAssocTerminal; /**< ID of associated input terminal, for physically grouped terminals @@ -433,6 +349,108 @@ uint8_t iTerminal; /**< Index of a string descriptor describing this descriptor within the device. */ } 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). * @@ -444,7 +462,9 @@ 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. */ + 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. */ @@ -467,7 +487,9 @@ * 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. */ @@ -482,8 +504,8 @@ */ typedef struct { - uint16_t LowWord; /**< Low 16 bits of the 24-bit value. */ - uint8_t HighByte; /**< Upper 8 bits of the 24-bit value. */ + uint16_t LowWord; /**< Low 16 bits of the 24-bit value. */ + uint8_t HighByte; /**< Upper 8 bits of the 24-bit value. */ } USB_Audio_SampleFreq_t; /** \brief Audio class-specific Format Descriptor (LUFA naming conventions). @@ -497,8 +519,10 @@ 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. */ - + 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 Channels; /**< Total number of discrete channels in the stream. */ @@ -520,21 +544,23 @@ */ 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 bLength; /**< Size of the descriptor, in bytes. */ + uint8_t bDescriptorType; /**< Sub type value used to distinguish between audio class-specific descriptors, + * 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 bNrChannels; /**< Total number of discrete channels in the stream. */ + 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 bSubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */ - uint8_t bBitResolution; /**< Bits of resolution of each channel's samples in the stream. */ + uint8_t bSubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */ + uint8_t bBitResolution; /**< Bits of resolution of each channel's samples in the stream. */ - uint8_t bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. */ - uint8_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES * 3]; /**< Sample frequencies supported by the device (must be 24-bit). */ + uint8_t bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. */ + uint8_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES * 3]; /**< Sample frequencies supported by the device (must be 24-bit). */ } USB_Audio_StdDescriptor_Format_t; /** \brief Audio class-specific Streaming Endpoint Descriptor (LUFA naming conventions). @@ -593,13 +619,15 @@ */ 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. */ + 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_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. */ - uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */ - uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry. */ + uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */ + uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry. */ } USB_Audio_Descriptor_StreamEndpoint_Spc_t; /** \brief Audio class-specific Extended Endpoint Descriptor (USB-IF naming conventions). @@ -618,7 +646,9 @@ * 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. */ diff --git a/LUFA/Drivers/USB/Class/Common/CDC.h b/LUFA/Drivers/USB/Class/Common/CDC.h index c41907f088..99a1d8f9cd 100644 --- a/LUFA/Drivers/USB/Class/Common/CDC.h +++ b/LUFA/Drivers/USB/Class/Common/CDC.h @@ -66,30 +66,6 @@ #endif /* 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 * from the host, to indicate that the DTR line state should be high. */ @@ -149,8 +125,51 @@ uint8_t SubType; \ uint8_t Data[DataSize]; \ } - + /* 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 CDC_LineEncodingFormats_t { @@ -162,13 +181,134 @@ /** Enum for the possible line encoding parity settings of a virtual serial port. */ enum CDC_LineEncodingParity_t { - CDC_PARITY_None = 0, /**< No parity bit mode on each frame. */ - CDC_PARITY_Odd = 1, /**< Odd parity bit mode on each frame. */ - CDC_PARITY_Even = 2, /**< Even parity bit mode on each frame. */ - CDC_PARITY_Mark = 3, /**< Mark parity bit mode on each frame. */ - CDC_PARITY_Space = 4, /**< Space parity bit mode on each frame. */ + CDC_PARITY_None = 0, /**< No parity bit mode on each frame. */ + CDC_PARITY_Odd = 1, /**< Odd parity bit mode on each frame. */ + CDC_PARITY_Even = 2, /**< Even parity bit mode on each frame. */ + CDC_PARITY_Mark = 3, /**< Mark 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: */ #if defined(__cplusplus) } diff --git a/LUFA/Drivers/USB/Class/Common/HID.h b/LUFA/Drivers/USB/Class/Common/HID.h index 59e262a22b..822a8b5027 100644 --- a/LUFA/Drivers/USB/Class/Common/HID.h +++ b/LUFA/Drivers/USB/Class/Common/HID.h @@ -60,46 +60,7 @@ #error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead. #endif - /* 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 - + /* Macros: */ /** 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) @@ -137,12 +98,47 @@ #define HID_KEYBOARD_LED_KATANA (1 << 3) /* 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 HID_ReportItemTypes_t { - REPORT_ITEM_TYPE_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. */ - REPORT_ITEM_TYPE_Feature = 2, /**< Indicates that the item is a FEATURE report type. */ + HID_REPORT_ITEM_In = 0, /**< Indicates that the item is an IN report type. */ + HID_REPORT_ITEM_Out = 1, /**< Indicates that the item is an OUT 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). @@ -161,7 +157,7 @@ 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. */ } USB_HID_Descriptor_HID_t; @@ -185,7 +181,7 @@ 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. */ } USB_HID_StdDescriptor_HID_t; diff --git a/LUFA/Drivers/USB/Class/Common/MIDI.h b/LUFA/Drivers/USB/Class/Common/MIDI.h index da7b2bd769..b3a40385c0 100644 --- a/LUFA/Drivers/USB/Class/Common/MIDI.h +++ b/LUFA/Drivers/USB/Class/Common/MIDI.h @@ -70,18 +70,6 @@ #endif /* 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. */ #define MIDI_COMMAND_NOTE_ON 0x90 @@ -97,6 +85,13 @@ * \param[in] channel MIDI channel number to address. */ #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: */ /** \brief MIDI class-specific Streaming Interface Descriptor (LUFA naming conventions). @@ -113,8 +108,8 @@ uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */ uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class - * specification version. - */ + * specification version. + */ uint16_t TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */ } USB_MIDI_Descriptor_AudioInterface_AS_t; @@ -158,7 +153,6 @@ uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */ } USB_MIDI_Descriptor_InputJack_t; - /** \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 diff --git a/LUFA/Drivers/USB/Class/Common/MassStorage.h b/LUFA/Drivers/USB/Class/Common/MassStorage.h index 9a391ee07a..2dc83d9d4e 100644 --- a/LUFA/Drivers/USB/Class/Common/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Common/MassStorage.h @@ -66,12 +66,6 @@ #endif /* 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. */ #define MS_CBW_SIGNATURE 0x43425355UL @@ -209,8 +203,30 @@ /** SCSI Additional Sense Qualifier Code to indicate that an operation is currently in progress. */ #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. * * Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */ @@ -256,13 +272,13 @@ unsigned char EOM : 1; unsigned char FileMark : 1; - uint8_t Information[4]; - uint8_t AdditionalLength; - uint8_t CmdSpecificInformation[4]; - uint8_t AdditionalSenseCode; - uint8_t AdditionalSenseQualifier; - uint8_t FieldReplaceableUnitCode; - uint8_t SenseKeySpecific[3]; + uint8_t Information[4]; + uint8_t AdditionalLength; + uint8_t CmdSpecificInformation[4]; + uint8_t AdditionalSenseCode; + uint8_t AdditionalSenseQualifier; + uint8_t FieldReplaceableUnitCode; + uint8_t SenseKeySpecific[3]; } SCSI_Request_Sense_Response_t; /** \brief Mass Storage Class SCSI Inquiry Structure. @@ -281,7 +297,7 @@ unsigned char Reserved : 7; unsigned char Removable : 1; - uint8_t Version; + uint8_t Version; unsigned char ResponseDataFormat : 4; unsigned char Reserved2 : 1; @@ -289,8 +305,8 @@ unsigned char TrmTsk : 1; unsigned char AERC : 1; - uint8_t AdditionalLength; - uint8_t Reserved3[2]; + uint8_t AdditionalLength; + uint8_t Reserved3[2]; unsigned char SoftReset : 1; unsigned char CmdQue : 1; @@ -301,21 +317,10 @@ unsigned char WideBus32Bit : 1; unsigned char RelAddr : 1; - uint8_t VendorID[8]; - uint8_t ProductID[16]; - uint8_t RevisionID[4]; + uint8_t VendorID[8]; + uint8_t ProductID[16]; + uint8_t RevisionID[4]; } 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: */ #if defined(__cplusplus) diff --git a/LUFA/Drivers/USB/Class/Common/RNDIS.h b/LUFA/Drivers/USB/Class/Common/RNDIS.h index a6549c5e3d..98d41a2c41 100644 --- a/LUFA/Drivers/USB/Class/Common/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Common/RNDIS.h @@ -76,13 +76,7 @@ /** Implemented RNDIS Version Minor. */ #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. */ #define RNDIS_MESSAGE_BUFFER_SIZE 128 @@ -93,6 +87,13 @@ #define NOTIF_ResponseAvailable 1 /* 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 RNDIS_States_t { diff --git a/LUFA/Drivers/USB/Class/Common/StillImage.h b/LUFA/Drivers/USB/Class/Common/StillImage.h index 434d65a1e4..01cffbddb6 100644 --- a/LUFA/Drivers/USB/Class/Common/StillImage.h +++ b/LUFA/Drivers/USB/Class/Common/StillImage.h @@ -72,53 +72,51 @@ * * \return Number of bytes of the given unicode string. */ - #define UNICODE_STRING_LENGTH(Chars) ((Chars) << 1) + #define UNICODE_STRING_LENGTH(Chars) ((Chars) << 1) /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for * a command 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) + \ - ((Params) * sizeof(uint32_t))) + #define PIMA_COMMAND_SIZE(Params) ((sizeof(SI_PIMA_Container_t) - 12) + ((Params) * sizeof(uint32_t))) /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for * a data container. * * \param[in] DataLen Length in bytes of the data in the container. */ - #define PIMA_DATA_SIZE(DataLen) ((sizeof(SI_PIMA_Container_t) - 12) + \ - (DataLen)) + #define PIMA_DATA_SIZE(DataLen) ((sizeof(SI_PIMA_Container_t) - 12) + (DataLen)) /* Enums: */ /** Enum for the possible PIMA contains types. */ enum SI_PIMA_Container_Types_t { - CType_Undefined = 0, /**< Undefined container type. */ - CType_CommandBlock = 1, /**< Command Block container type. */ - CType_DataBlock = 2, /**< Data Block container type. */ - CType_ResponseBlock = 3, /**< Response container type. */ - CType_EventBlock = 4, /**< Event Block container type. */ + SI_PIMA_CONTAINER_Undefined = 0, /**< Undefined container type. */ + SI_PIMA_CONTAINER_CommandBlock = 1, /**< Command Block container type. */ + SI_PIMA_CONTAINER_DataBlock = 2, /**< Data Block container type. */ + SI_PIMA_CONTAINER_ResponseBlock = 3, /**< Response container type. */ + SI_PIMA_CONTAINER_EventBlock = 4, /**< Event Block container type. */ }; /* Enums: */ /** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */ enum SI_PIMA_ResponseCodes_t { - 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 - * issued command. - */ - PIMA_RESPONSE_SessionNotOpen = 3, /**< Response code indicating that the sent command requires an open - * session before being issued. - */ - 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 - * by the attached device. - */ - PIMA_RESPONSE_ParameterNotSupported = 6, /**< Response code indicating that one or more of the issued command's - * parameters are not supported by the device. - */ + SI_PIMA_RESPONSE_OK = 1, /**< Response code indicating no error in the issued command. */ + SI_PIMA_RESPONSE_GeneralError = 2, /**< Response code indicating a general error while processing the + * issued command. + */ + SI_PIMA_RESPONSE_SessionNotOpen = 3, /**< Response code indicating that the sent command requires an open + * session before being issued. + */ + SI_PIMA_RESPONSE_InvalidTransaction = 4, /**< Response code indicating an invalid transaction occurred. */ + SI_PIMA_RESPONSE_OperationNotSupported = 5, /**< Response code indicating that the issued command is not supported + * by the attached device. + */ + SI_PIMA_RESPONSE_ParameterNotSupported = 6, /**< Response code indicating that one or more of the issued command's + * parameters are not supported by the device. + */ }; /* Type Defines: */ diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index a5a296debe..44d1caa09a 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -51,7 +51,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter switch (USB_ControlRequest.bRequest) { - case REQ_GetLineEncoding: + case CDC_REQ_GetLineEncoding: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -60,7 +60,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter } break; - case REQ_SetLineEncoding: + case CDC_REQ_SetLineEncoding: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -71,7 +71,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter } break; - case REQ_SetControlLineState: + case CDC_REQ_SetControlLineState: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -83,7 +83,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter } break; - case REQ_SendBreak: + case CDC_REQ_SendBreak: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { 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) { .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = NOTIF_SerialState, + .bRequest = CDC_NOTIF_SerialState, .wValue = 0, .wIndex = 0, .wLength = sizeof(CDCInterfaceInfo->State.ControlLineStates.DeviceToHost), diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c index 1953d9fbcd..5111eba59e 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.c +++ b/LUFA/Drivers/USB/Class/Device/HID.c @@ -45,7 +45,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter switch (USB_ControlRequest.bRequest) { - case REQ_GetReport: + case HID_REQ_GetReport: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { uint16_t ReportSize = 0; @@ -68,7 +68,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter } break; - case REQ_SetReport: + case HID_REQ_SetReport: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { uint16_t ReportSize = USB_ControlRequest.wLength; @@ -84,7 +84,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter } break; - case REQ_GetProtocol: + case HID_REQ_GetProtocol: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -94,7 +94,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter } break; - case REQ_SetProtocol: + case HID_REQ_SetProtocol: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -104,7 +104,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter } break; - case REQ_SetIdle: + case HID_REQ_SetIdle: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -114,7 +114,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter } break; - case REQ_GetIdle: + case HID_REQ_GetIdle: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -158,7 +158,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) 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); bool StatesChanged = false; bool IdlePeriodElapsed = (HIDInterfaceInfo->State.IdleCount && !(HIDInterfaceInfo->State.IdleMSRemaining)); diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h index 638dac1597..e90f15d1f7 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.h +++ b/LUFA/Drivers/USB/Class/Device/HID.h @@ -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, * 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. - * \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] 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] ReportID Report ID of the received output report. If multiple reports are not received via the given HID * 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] ReportSize Size in bytes of the received report from the host. */ diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.c b/LUFA/Drivers/USB/Class/Device/MassStorage.c index 096a222c27..06ad2c85ac 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Device/MassStorage.c @@ -48,7 +48,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac switch (USB_ControlRequest.bRequest) { - case REQ_MassStorageReset: + case MS_REQ_MassStorageReset: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -58,7 +58,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac } break; - case REQ_GetMaxLUN: + case MS_REQ_GetMaxLUN: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -107,12 +107,12 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber); 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.Tag = MSInterfaceInfo->State.CommandBlock.Tag; 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)) { Endpoint_StallTransaction(); diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.c b/LUFA/Drivers/USB/Class/Device/RNDIS.c index ea9e8cf998..394827ed2b 100644 --- a/LUFA/Drivers/USB/Class/Device/RNDIS.c +++ b/LUFA/Drivers/USB/Class/Device/RNDIS.c @@ -77,7 +77,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI switch (USB_ControlRequest.bRequest) { - case REQ_SendEncapsulatedCommand: + case RNDIS_REQ_SendEncapsulatedCommand: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); @@ -88,7 +88,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI } break; - case REQ_GetEncapsulatedResponse: + case RNDIS_REQ_GetEncapsulatedResponse: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index b9e4c9ebfe..5a87c77eed 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -212,7 +212,7 @@ void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) USB_Request_Header_t Notification; 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))) { 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) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_SetLineEncoding, + .bRequest = CDC_REQ_SetLineEncoding, .wValue = 0, .wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber, .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) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_SetControlLineState, + .bRequest = CDC_REQ_SetControlLineState, .wValue = CDCInterfaceInfo->State.ControlLineStates.HostToDevice, .wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber, .wLength = 0, @@ -272,7 +272,7 @@ uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, USB_ControlRequest = (USB_Request_Header_t) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_SendBreak, + .bRequest = CDC_REQ_SendBreak, .wValue = Duration, .wIndex = CDCInterfaceInfo->State.ControlInterfaceNumber, .wLength = 0, diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index 0642ecd405..bbb32cb552 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -62,12 +62,10 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo (CurrentHIDInterface->Protocol != HIDInterfaceInfo->Config.HIDInterfaceProtocol)); 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) - { - return HID_ENUMERROR_NoHIDDescriptorFound; - } + return HID_ENUMERROR_NoHIDDescriptorFound; 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) { - if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID) + if (DESCRIPTOR_TYPE(CurrentDescriptor) == HID_DTYPE_HID) return DESCRIPTOR_SEARCH_Found; else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) 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) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_SetReport, - .wValue = ((REPORT_ITEM_TYPE_In + 1) << 8) | ReportID, + .bRequest = HID_REQ_SetReport, + .wValue = ((HID_REPORT_ITEM_In + 1) << 8) | ReportID, .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); @@ -198,7 +196,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, *(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 #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)) return false; - if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == REPORT_ITEM_TYPE_Out)) + if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == HID_REPORT_ITEM_Out)) { 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) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_SetReport, + .bRequest = HID_REQ_SetReport, #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) .wValue = ((ReportType + 1) << 8) | ReportID, #else @@ -291,7 +289,7 @@ uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInf USB_ControlRequest = (USB_Request_Header_t) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_SetProtocol, + .bRequest = HID_REQ_SetProtocol, .wValue = 0, .wIndex = HIDInterfaceInfo->State.InterfaceNumber, .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), .bRequest = REQ_GetDescriptor, - .wValue = (DTYPE_Report << 8), + .wValue = (HID_DTYPE_Report << 8), .wIndex = HIDInterfaceInfo->State.InterfaceNumber, .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) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_SetProtocol, + .bRequest = HID_REQ_SetProtocol, .wValue = 1, .wIndex = HIDInterfaceInfo->State.InterfaceNumber, .wLength = 0, diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h index 88d16640c2..914d432784 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.h +++ b/LUFA/Drivers/USB/Class/Host/HID.h @@ -92,9 +92,8 @@ 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 - * boot subclass protocol is required, either \ref HID_BOOT_MOUSE_PROTOCOL, - * \ref HID_BOOT_KEYBOARD_PROTOCOL or \ref HID_NON_BOOT_PROTOCOL if any - * HID device should be enumerated by the interface. + * boot subclass protocol is required, a value from the \ref HID_BootProtocols_t + * enum. */ #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) 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] 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] ReportSize Report size in bytes to send to the attached device. * diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c index 49f9452ba6..58ee000591 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c @@ -244,11 +244,11 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint8_t ItemTag = (HIDReportItem & TAG_MASK); if (ItemTag == TAG_MAIN_INPUT) - NewReportItem.ItemType = REPORT_ITEM_TYPE_In; + NewReportItem.ItemType = HID_REPORT_ITEM_In; else if (ItemTag == TAG_MAIN_OUTPUT) - NewReportItem.ItemType = REPORT_ITEM_TYPE_Out; + NewReportItem.ItemType = HID_REPORT_ITEM_Out; else - NewReportItem.ItemType = REPORT_ITEM_TYPE_Feature; + NewReportItem.ItemType = HID_REPORT_ITEM_Feature; NewReportItem.BitOffset = CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType]; diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c index dfa954c5c5..0366703bb8 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c @@ -284,7 +284,7 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* const MSInterf Pipe_ClearIN(); Pipe_Freeze(); - if (SCSICommandStatus->Status != SCSI_Command_Pass) + if (SCSICommandStatus->Status != MS_SCSI_COMMAND_Pass) ErrorCode = MS_ERROR_LOGICAL_CMD_FAILED; return ErrorCode; diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.c b/LUFA/Drivers/USB/Class/Host/RNDIS.c index cddd5cbb58..b3d0f3070a 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDIS.c +++ b/LUFA/Drivers/USB/Class/Host/RNDIS.c @@ -202,7 +202,7 @@ static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const R USB_ControlRequest = (USB_Request_Header_t) { .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_SendEncapsulatedCommand, + .bRequest = RNDIS_REQ_SendEncapsulatedCommand, .wValue = 0, .wIndex = RNDISInterfaceInfo->State.ControlInterfaceNumber, .wLength = Length, @@ -219,7 +219,7 @@ static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const R USB_ControlRequest = (USB_Request_Header_t) { .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE), - .bRequest = REQ_GetEncapsulatedResponse, + .bRequest = RNDIS_REQ_GetEncapsulatedResponse, .wValue = 0, .wIndex = RNDISInterfaceInfo->State.ControlInterfaceNumber, .wLength = Length, diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.c b/LUFA/Drivers/USB/Class/Host/StillImage.c index e08fc76af3..3883d3bad5 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.c +++ b/LUFA/Drivers/USB/Class/Host/StillImage.c @@ -36,9 +36,9 @@ #define __INCLUDE_FROM_SI_DRIVER #include "StillImage.h" -uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - uint16_t ConfigDescriptorSize, - void* DeviceConfigDescriptor) +uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + uint16_t ConfigDescriptorSize, + void* DeviceConfigDescriptor) { uint8_t FoundEndpoints = 0; @@ -145,8 +145,8 @@ uint8_t DCOMP_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor) return DESCRIPTOR_SEARCH_NotFound; } -uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - SI_PIMA_Container_t* const PIMAHeader) +uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + SI_PIMA_Container_t* const PIMAHeader) { uint8_t ErrorCode; @@ -176,8 +176,8 @@ uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceIn return PIPE_RWSTREAM_NoError; } -uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - SI_PIMA_Container_t* const PIMAHeader) +uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + SI_PIMA_Container_t* const PIMAHeader) { uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS; uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber(); @@ -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); - if (PIMAHeader->Type == CType_ResponseBlock) + if (PIMAHeader->Type == SI_PIMA_CONTAINER_ResponseBlock) { uint8_t ParamBytes = (PIMAHeader->DataLength - PIMA_COMMAND_SIZE(0)); @@ -241,9 +241,9 @@ uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfac return PIPE_RWSTREAM_NoError; } -uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - void* Buffer, - const uint16_t Bytes) +uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + void* Buffer, + const uint16_t Bytes) { uint8_t ErrorCode; @@ -261,9 +261,9 @@ uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, return ErrorCode; } -uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - void* Buffer, - const uint16_t Bytes) +uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + void* Buffer, + const uint16_t Bytes) { uint8_t ErrorCode; @@ -280,7 +280,7 @@ uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, 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; @@ -298,8 +298,8 @@ bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) return IsEventReceived; } -uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - SI_PIMA_Container_t* const PIMAHeader) +uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + SI_PIMA_Container_t* const PIMAHeader) { uint8_t ErrorCode; @@ -317,7 +317,7 @@ uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfac 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)) return HOST_SENDCONTROL_DeviceDisconnected; @@ -328,20 +328,20 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) SIInterfaceInfo->State.IsSessionOpen = false; SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t) - { - .DataLength = PIMA_COMMAND_SIZE(1), - .Type = CType_CommandBlock, - .Code = 0x1002, - .Params = {1}, - }; - - if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) + { + .DataLength = PIMA_COMMAND_SIZE(1), + .Type = SI_PIMA_CONTAINER_CommandBlock, + .Code = 0x1002, + .Params = {1}, + }; + + if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) return ErrorCode; - if ((ErrorCode = SImage_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) 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; SIInterfaceInfo->State.IsSessionOpen = true; @@ -349,7 +349,7 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) 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)) return HOST_SENDCONTROL_DeviceDisconnected; @@ -357,31 +357,31 @@ uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) uint8_t ErrorCode; SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t) - { - .DataLength = PIMA_COMMAND_SIZE(1), - .Type = CType_CommandBlock, - .Code = 0x1003, - .Params = {1}, - }; - - if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) + { + .DataLength = PIMA_COMMAND_SIZE(1), + .Type = SI_PIMA_CONTAINER_CommandBlock, + .Code = 0x1003, + .Params = {1}, + }; + + if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) return ErrorCode; - if ((ErrorCode = SImage_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError) return ErrorCode; 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 PIPE_RWSTREAM_NoError; } -uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - const uint16_t Operation, - const uint8_t TotalParams, - uint32_t* const Params) +uint8_t SI_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + const uint16_t Operation, + const uint8_t TotalParams, + uint32_t* const Params) { if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive)) return HOST_SENDCONTROL_DeviceDisconnected; @@ -389,21 +389,21 @@ uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t ErrorCode; SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t) - { - .DataLength = PIMA_COMMAND_SIZE(TotalParams), - .Type = CType_CommandBlock, - .Code = Operation, - }; + { + .DataLength = PIMA_COMMAND_SIZE(TotalParams), + .Type = SI_PIMA_CONTAINER_CommandBlock, + .Code = Operation, + }; 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 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; 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)) 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; - 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 PIPE_RWSTREAM_NoError; diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h index a15091b6a8..c215f10726 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.h +++ b/LUFA/Drivers/USB/Class/Host/StillImage.h @@ -97,7 +97,7 @@ struct { 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. */ @@ -114,7 +114,7 @@ } USB_ClassInfo_SI_Host_t; /* 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 { SI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */ @@ -140,9 +140,9 @@ * * \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum. */ - uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - uint16_t ConfigDescriptorSize, - void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3); + uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + uint16_t ConfigDescriptorSize, + void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3); /** Opens a new PIMA session with the attached device. This should be used before any session-orientated PIMA commands * are issued to the device. Only one session can be open at the one time. @@ -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 * 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 * 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 * 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 * arbitrary PIMA blocks to the device with or without parameters. @@ -181,9 +181,9 @@ * * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. */ - uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) - ATTR_NON_NULL_PTR_ARG(2); + uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) + ATTR_NON_NULL_PTR_ARG(2); /** Receives a raw PIMA block header to the device. This can be used to receive arbitrary PIMA blocks from the device with * or without parameters. @@ -196,9 +196,9 @@ * * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. */ - uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) - ATTR_NON_NULL_PTR_ARG(2); + uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) + ATTR_NON_NULL_PTR_ARG(2); /** Sends a given PIMA command to the attached device, filling out the PIMA command header's Transaction ID automatically. * @@ -213,10 +213,10 @@ * \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. */ - uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - const uint16_t Operation, - const uint8_t TotalParams, - uint32_t* const Params) ATTR_NON_NULL_PTR_ARG(1); + uint8_t SI_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + const uint16_t Operation, + const uint8_t TotalParams, + uint32_t* const Params) ATTR_NON_NULL_PTR_ARG(1); /** Receives and checks a response block from the attached PIMA device, once a command has been issued and all data * associated with the command has been transferred. @@ -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 * 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. * @@ -240,7 +240,7 @@ * * \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. * @@ -253,9 +253,9 @@ * \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. */ - uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) - ATTR_NON_NULL_PTR_ARG(2); + uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1) + ATTR_NON_NULL_PTR_ARG(2); /** Sends arbitrary data to the attached device, for use in the data phase of PIMA commands which require data * transfer beyond the regular PIMA command block parameters. @@ -269,9 +269,9 @@ * * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. */ - uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - void* Buffer, - const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + void* Buffer, + const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); /** Receives arbitrary data from the attached device, for use in the data phase of PIMA commands which require data * transfer beyond the regular PIMA command block parameters. @@ -285,9 +285,9 @@ * * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. */ - uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, - void* Buffer, - const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, + void* Buffer, + const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); /* Inline Functions: */ /** General management task for a given Still Image host class interface, required for the correct operation of the @@ -296,8 +296,8 @@ * * \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 SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) + static inline void SI_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) { (void)SIInterfaceInfo; } diff --git a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h index 4339479977..00b60c3d3a 100644 --- a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h +++ b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h @@ -198,7 +198,7 @@ * \see The USB specification for more details on the possible Endpoint usage attributes. */ #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4) - + /* Enums: */ /** Enum for the possible standard descriptor types, as given in each descriptor's header. */ enum USB_DescriptorTypes_t @@ -212,6 +212,8 @@ DTYPE_Other = 0x07, /**< Indicates that the descriptor is of other type. */ 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_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: */ diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 21bc8738fe..b826830921 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -42,6 +42,7 @@ * 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) * - 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 * * Fixed: * - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist diff --git a/LUFA/ManPages/FutureChanges.txt b/LUFA/ManPages/FutureChanges.txt index 6e77effbf5..b1196d70d4 100644 --- a/LUFA/ManPages/FutureChanges.txt +++ b/LUFA/ManPages/FutureChanges.txt @@ -18,11 +18,11 @@ * -# 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 * -# Re-add interrupt Pipe/Endpoint support + * -# Fix intermittent device mode enumeration errors * - Documentation/Support * -# Add detailed overviews of how each demo works * -# Add board overviews * -# Write LUFA tutorials - * -# Add makefile template * - Demos/Projects * -# Multiple-Report HID device * -# Device/Host USB bridge @@ -31,6 +31,7 @@ * -# Finish BluetoothHost demo * -# Finish SideShow demo * -# Finish StandaloneProgrammer project + * -# Arduino Uno compatible USB-MIDI, USB-HID * - Ports * -# AVR32 UC3B series microcontrollers * -# Atmel ARM7 series microcontrollers diff --git a/LUFA/ManPages/MigrationInformation.txt b/LUFA/ManPages/MigrationInformation.txt index 414a4a31e0..40a7ec6dbf 100644 --- a/LUFA/ManPages/MigrationInformation.txt +++ b/LUFA/ManPages/MigrationInformation.txt @@ -32,6 +32,8 @@ * 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 * 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 * @@ -120,7 +122,7 @@ * * Host Mode * - 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 * 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 diff --git a/Projects/Benito/Descriptors.c b/Projects/Benito/Descriptors.c index 282bbdcc8d..a4af11c3d5 100644 --- a/Projects/Benito/Descriptors.c +++ b/Projects/Benito/Descriptors.c @@ -102,28 +102,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC_Functional_IntHeader = + .CDC_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC_NotificationEndpoint = diff --git a/Projects/Benito/Descriptors.h b/Projects/Benito/Descriptors.h index ce29816f12..361fe90324 100644 --- a/Projects/Benito/Descriptors.h +++ b/Projects/Benito/Descriptors.h @@ -67,9 +67,9 @@ { USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_t CDC_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; diff --git a/Projects/LEDNotifier/Descriptors.c b/Projects/LEDNotifier/Descriptors.c index 71d7813e61..90085844d8 100644 --- a/Projects/LEDNotifier/Descriptors.c +++ b/Projects/LEDNotifier/Descriptors.c @@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC_Functional_IntHeader = + .CDC_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC_NotificationEndpoint = diff --git a/Projects/LEDNotifier/Descriptors.h b/Projects/LEDNotifier/Descriptors.h index 1c1f4694d5..159d8d2659 100644 --- a/Projects/LEDNotifier/Descriptors.h +++ b/Projects/LEDNotifier/Descriptors.h @@ -67,9 +67,9 @@ { USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_t CDC_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; diff --git a/Projects/Magstripe/Descriptors.c b/Projects/Magstripe/Descriptors.c index 41c1c4bda4..a041760c16 100644 --- a/Projects/Magstripe/Descriptors.c +++ b/Projects/Magstripe/Descriptors.c @@ -138,12 +138,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(KeyboardReport) }, @@ -234,11 +234,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_KeyboardHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &KeyboardReport; Size = sizeof(KeyboardReport); break; diff --git a/Projects/Magstripe/Magstripe.c b/Projects/Magstripe/Magstripe.c index afc0b93543..9a551a18a9 100644 --- a/Projects/Magstripe/Magstripe.c +++ b/Projects/Magstripe/Magstripe.c @@ -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,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] 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] 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] ReportSize Size in bytes of the report received from the host */ diff --git a/Projects/TempDataLogger/Descriptors.c b/Projects/TempDataLogger/Descriptors.c index 1b8a4a2f92..deb88ab1d5 100644 --- a/Projects/TempDataLogger/Descriptors.c +++ b/Projects/TempDataLogger/Descriptors.c @@ -171,19 +171,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Class = 0x03, .SubClass = 0x00, - .Protocol = HID_NON_BOOT_PROTOCOL, + .Protocol = HID_BOOTP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, .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), .CountryCode = 0x00, .TotalReportDescriptors = 1, - .HIDReportType = DTYPE_Report, + .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(GenericReport) }, @@ -275,11 +275,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, } break; - case DTYPE_HID: + case HID_DTYPE_HID: Address = &ConfigurationDescriptor.HID_GenericHID; Size = sizeof(USB_HID_Descriptor_HID_t); break; - case DTYPE_Report: + case HID_DTYPE_Report: Address = &GenericReport; Size = sizeof(GenericReport); break; diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c index 607e2259ed..bf5fd39405 100644 --- a/Projects/TempDataLogger/TempDataLogger.c +++ b/Projects/TempDataLogger/TempDataLogger.c @@ -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,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] 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] 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] ReportSize Size in bytes of the received HID report */ diff --git a/Projects/USBtoSerial/Descriptors.c b/Projects/USBtoSerial/Descriptors.c index 7fa6ab990d..a7275ae567 100644 --- a/Projects/USBtoSerial/Descriptors.c +++ b/Projects/USBtoSerial/Descriptors.c @@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC_Functional_IntHeader = + .CDC_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC_NotificationEndpoint = diff --git a/Projects/USBtoSerial/Descriptors.h b/Projects/USBtoSerial/Descriptors.h index 0bd07d3264..787796bc8a 100644 --- a/Projects/USBtoSerial/Descriptors.h +++ b/Projects/USBtoSerial/Descriptors.h @@ -67,9 +67,9 @@ { USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_t CDC_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; diff --git a/Projects/XPLAINBridge/USARTDescriptors.c b/Projects/XPLAINBridge/USARTDescriptors.c index 2baedd4ab3..e0a78e3706 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.c +++ b/Projects/XPLAINBridge/USARTDescriptors.c @@ -114,28 +114,29 @@ USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC_Functional_IntHeader = + .CDC_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .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}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC_NotificationEndpoint = diff --git a/Projects/XPLAINBridge/USARTDescriptors.h b/Projects/XPLAINBridge/USARTDescriptors.h index 10713556ac..cac0a987d4 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.h +++ b/Projects/XPLAINBridge/USARTDescriptors.h @@ -67,9 +67,9 @@ { USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_t CDC_CCI_Interface; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; - CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; - CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; USB_Descriptor_Interface_t CDC_DCI_Interface; USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;