diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-09-28 12:14:06 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-09-28 12:14:06 +0000 |
commit | 713670043a1edb714461fc83c2b8817f3db99961 (patch) | |
tree | 9c45545908c0ad14ad8e136e34de00867fc569a7 /Projects | |
parent | 800485bd95de4287006a0d0aa099bc510e929531 (diff) | |
download | lufa-713670043a1edb714461fc83c2b8817f3db99961.tar.gz lufa-713670043a1edb714461fc83c2b8817f3db99961.tar.bz2 lufa-713670043a1edb714461fc83c2b8817f3db99961.zip |
Move out many of the common class driver constants into grouped enums, to make them more managable.
Add new CDC descriptor structs to the CDC class driver, so that the CDC demos can use human readable field names.
Rename prefix for Still Image Host class driver functions from "SImage_" to "SI_" to remain consistent with the rest of the driver.
Diffstat (limited to 'Projects')
-rw-r--r-- | Projects/Benito/Descriptors.c | 23 | ||||
-rw-r--r-- | Projects/Benito/Descriptors.h | 6 | ||||
-rw-r--r-- | Projects/LEDNotifier/Descriptors.c | 23 | ||||
-rw-r--r-- | Projects/LEDNotifier/Descriptors.h | 6 | ||||
-rw-r--r-- | Projects/Magstripe/Descriptors.c | 8 | ||||
-rw-r--r-- | Projects/Magstripe/Magstripe.c | 4 | ||||
-rw-r--r-- | Projects/TempDataLogger/Descriptors.c | 10 | ||||
-rw-r--r-- | Projects/TempDataLogger/TempDataLogger.c | 4 | ||||
-rw-r--r-- | Projects/USBtoSerial/Descriptors.c | 23 | ||||
-rw-r--r-- | Projects/USBtoSerial/Descriptors.h | 6 | ||||
-rw-r--r-- | Projects/XPLAINBridge/USARTDescriptors.c | 23 | ||||
-rw-r--r-- | Projects/XPLAINBridge/USARTDescriptors.h | 6 |
12 files changed, 73 insertions, 69 deletions
diff --git a/Projects/Benito/Descriptors.c b/Projects/Benito/Descriptors.c index 282bbdcc8..a4af11c3d 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 ce29816f1..361fe9032 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 71d7813e6..90085844d 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 1c1f4694d..159d8d265 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 41c1c4bda..a041760c1 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 afc0b9354..9a551a18a 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 1b8a4a2f9..deb88ab1d 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 607e2259e..bf5fd3940 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 7fa6ab990..a7275ae56 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 0bd07d326..787796bc8 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 2baedd4ab..e0a78e370 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 10713556a..cac0a987d 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; |