diff --git a/Bootloaders/CDC/Descriptors.c b/Bootloaders/CDC/Descriptors.c index ae04fbd674..b527454d97 100644 --- a/Bootloaders/CDC/Descriptors.c +++ b/Bootloaders/CDC/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -146,9 +146,9 @@ USB_Descriptor_Configuration_t ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Bootloaders/DFU/Descriptors.c b/Bootloaders/DFU/Descriptors.c index e7051a75a1..25df7fc4af 100644 --- a/Bootloaders/DFU/Descriptors.c +++ b/Bootloaders/DFU/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.c b/Demos/Device/ClassDriver/AudioInput/Descriptors.c index 8ac88bd82c..2e10012819 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(02.00), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x01, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_ControlSubclass, + .Protocol = AUDIO_CSCP_ControlProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -155,9 +155,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x02, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_AudioStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -171,9 +171,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x01, - .SubClass = 0x02, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_AudioStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c index 35ceeb29ab..020c3b518d 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(02.00), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x01, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_ControlSubclass, + .Protocol = AUDIO_CSCP_ControlProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -155,9 +155,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x02, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_AudioStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -171,9 +171,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x01, - .SubClass = 0x02, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_AudioStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c index 775ab08287..96bb080d8e 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0xEF, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = USB_CSCP_IADDeviceClass, + .SubClass = USB_CSCP_IADDeviceSubclass, + .Protocol = USB_CSCP_IADDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -105,9 +105,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .FirstInterfaceIndex = 0, .TotalInterfaces = 2, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .IADStrIndex = NO_DESCRIPTOR }, @@ -121,9 +121,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -172,9 +172,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -206,9 +206,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .FirstInterfaceIndex = 2, .TotalInterfaces = 2, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .IADStrIndex = NO_DESCRIPTOR }, @@ -222,9 +222,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -273,9 +273,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.c b/Demos/Device/ClassDriver/GenericHID/Descriptors.c index 1e78837cde..37a2d74f05 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.c +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.c @@ -73,9 +73,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -121,9 +121,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x00, - .Protocol = HID_BOOTP_NonBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c index 4b8dae4f56..4a86e17f15 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.c +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c @@ -83,9 +83,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -131,9 +131,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x00, - .Protocol = HID_BOOTP_NonBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.c b/Demos/Device/ClassDriver/Keyboard/Descriptors.c index 90952ef178..d0431b20ec 100644 --- a/Demos/Device/ClassDriver/Keyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.c @@ -89,9 +89,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -137,9 +137,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = HID_BOOTP_KeyboardBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c index b18920fa6a..dba514e35d 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c @@ -122,9 +122,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -170,9 +170,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = HID_BOOTP_KeyboardBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -207,9 +207,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = HID_BOOTP_MouseBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.c b/Demos/Device/ClassDriver/MIDI/Descriptors.c index d6092bbd4b..266ec2a9cf 100644 --- a/Demos/Device/ClassDriver/MIDI/Descriptors.c +++ b/Demos/Device/ClassDriver/MIDI/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x01, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_ControlSubclass, + .Protocol = AUDIO_CSCP_ControlProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -123,9 +123,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x01, - .SubClass = 0x03, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_MIDIStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.c b/Demos/Device/ClassDriver/MassStorage/Descriptors.c index d061610492..b755e67f80 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -107,9 +107,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x08, - .SubClass = 0x06, - .Protocol = 0x50, + .Class = MS_CSCP_MassStorageClass, + .SubClass = MS_CSCP_SCSITransparentSubclass, + .Protocol = MS_CSCP_BulkOnlyTransportProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c index 2d286a6030..430f3e55fe 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c @@ -102,9 +102,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -150,9 +150,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x08, - .SubClass = 0x06, - .Protocol = 0x50, + .Class = MS_CSCP_MassStorageClass, + .SubClass = MS_CSCP_SCSITransparentSubclass, + .Protocol = MS_CSCP_BulkOnlyTransportProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -186,9 +186,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = HID_BOOTP_KeyboardBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.c b/Demos/Device/ClassDriver/Mouse/Descriptors.c index 866ba272f7..ee20dda245 100644 --- a/Demos/Device/ClassDriver/Mouse/Descriptors.c +++ b/Demos/Device/ClassDriver/Mouse/Descriptors.c @@ -83,9 +83,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -131,9 +131,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = HID_BOOTP_MouseBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index 33f1dfe93e..933fd1afcd 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0xFF, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_VendorSpecificProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -146,9 +146,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h index 4f7beb1ef3..6ebba31dc7 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h @@ -64,15 +64,15 @@ */ typedef struct { - USB_Descriptor_Configuration_Header_t Config; - USB_Descriptor_Interface_t CDC_CCI_Interface; - 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; - USB_Descriptor_Endpoint_t RNDIS_DataInEndpoint; + USB_Descriptor_Configuration_Header_t Config; + USB_Descriptor_Interface_t CDC_CCI_Interface; + 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; + USB_Descriptor_Endpoint_t RNDIS_DataInEndpoint; } USB_Descriptor_Configuration_t; /* Function Prototypes: */ diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c index 1d98fbb814..2b650334e8 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -107,9 +107,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -158,9 +158,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c index 8591195cf2..4cade08031 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c @@ -95,9 +95,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0xEF, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = USB_CSCP_IADDeviceClass, + .SubClass = USB_CSCP_IADDeviceSubclass, + .Protocol = USB_CSCP_IADDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -141,9 +141,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .FirstInterfaceIndex = 0, .TotalInterfaces = 2, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .IADStrIndex = NO_DESCRIPTOR }, @@ -157,9 +157,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -208,9 +208,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -244,9 +244,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = HID_BOOTP_MouseBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.c b/Demos/Device/LowLevel/AudioInput/Descriptors.c index 85599fbc48..db731d56fe 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x01, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_ControlSubclass, + .Protocol = AUDIO_CSCP_ControlProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -155,9 +155,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x02, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_AudioStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -171,9 +171,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x01, - .SubClass = 0x02, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_AudioStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.c b/Demos/Device/LowLevel/AudioOutput/Descriptors.c index d177c31c33..bb6c5fcaa1 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x01, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_ControlSubclass, + .Protocol = AUDIO_CSCP_ControlProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -155,9 +155,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x02, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_AudioStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -171,9 +171,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x01, - .SubClass = 0x02, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_AudioStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c index 775ab08287..96bb080d8e 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0xEF, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = USB_CSCP_IADDeviceClass, + .SubClass = USB_CSCP_IADDeviceSubclass, + .Protocol = USB_CSCP_IADDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -105,9 +105,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .FirstInterfaceIndex = 0, .TotalInterfaces = 2, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .IADStrIndex = NO_DESCRIPTOR }, @@ -121,9 +121,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -172,9 +172,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -206,9 +206,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .FirstInterfaceIndex = 2, .TotalInterfaces = 2, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .IADStrIndex = NO_DESCRIPTOR }, @@ -222,9 +222,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -273,9 +273,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.c b/Demos/Device/LowLevel/GenericHID/Descriptors.c index 79cecb587e..bb1330d83a 100644 --- a/Demos/Device/LowLevel/GenericHID/Descriptors.c +++ b/Demos/Device/LowLevel/GenericHID/Descriptors.c @@ -73,9 +73,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -121,9 +121,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x03, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.c b/Demos/Device/LowLevel/Joystick/Descriptors.c index fac68871e3..96387bd998 100644 --- a/Demos/Device/LowLevel/Joystick/Descriptors.c +++ b/Demos/Device/LowLevel/Joystick/Descriptors.c @@ -83,9 +83,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -131,9 +131,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/Keyboard/Descriptors.c b/Demos/Device/LowLevel/Keyboard/Descriptors.c index 711d0ff7e3..5cb1fb55b4 100644 --- a/Demos/Device/LowLevel/Keyboard/Descriptors.c +++ b/Demos/Device/LowLevel/Keyboard/Descriptors.c @@ -90,9 +90,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -138,9 +138,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = 0x01, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c index 39d6c73e80..6c617f5fe8 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c +++ b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c @@ -123,9 +123,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -171,9 +171,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = 0x01, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -218,9 +218,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = 0x02, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.c b/Demos/Device/LowLevel/MIDI/Descriptors.c index d6092bbd4b..266ec2a9cf 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.c +++ b/Demos/Device/LowLevel/MIDI/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 0, - .Class = 0x01, - .SubClass = 0x01, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_ControlSubclass, + .Protocol = AUDIO_CSCP_ControlProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -123,9 +123,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x01, - .SubClass = 0x03, - .Protocol = 0x00, + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_MIDIStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.c b/Demos/Device/LowLevel/MassStorage/Descriptors.c index d061610492..b755e67f80 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.c +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -107,9 +107,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x08, - .SubClass = 0x06, - .Protocol = 0x50, + .Class = MS_CSCP_MassStorageClass, + .SubClass = MS_CSCP_SCSITransparentSubclass, + .Protocol = MS_CSCP_BulkOnlyTransportProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.c b/Demos/Device/LowLevel/Mouse/Descriptors.c index dab5425e43..ee20dda245 100644 --- a/Demos/Device/LowLevel/Mouse/Descriptors.c +++ b/Demos/Device/LowLevel/Mouse/Descriptors.c @@ -83,9 +83,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -131,9 +131,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = 0x02, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c index 33f1dfe93e..933fd1afcd 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0xFF, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_VendorSpecificProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -146,9 +146,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h index 00ce869612..42cd995670 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h @@ -41,7 +41,6 @@ #include #include "RNDISEthernet.h" - #include "RNDISConstants.h" #include "Ethernet.h" /* External Variables: */ diff --git a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c index 1d98fbb814..2b650334e8 100644 --- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c +++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -107,9 +107,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -158,9 +158,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c index eec1c93100..ffa3508f74 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c @@ -83,9 +83,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -131,9 +131,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = HID_BOOTP_MouseBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_MouseBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c index 786713ac5b..338d8d6556 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_BOOTP_MouseBootProtocol, + .HIDInterfaceProtocol = HID_CSCP_MouseBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c index 8d87e88c26..08117460ff 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_BOOTP_NonBootProtocol, + .HIDInterfaceProtocol = HID_CSCP_NonBootProtocol, .HIDParserData = &HIDReportInfo }, diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index 9b7941e5fd..4f7b2b34fc 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_BOOTP_KeyboardBootProtocol, + .HIDInterfaceProtocol = HID_CSCP_KeyboardBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index 5f10d8bf7f..596eccc5a5 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_BOOTP_NonBootProtocol, + .HIDInterfaceProtocol = HID_CSCP_NonBootProtocol, .HIDParserData = &HIDReportInfo }, diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c index c34a2fcb67..ccb42ebb56 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_BOOTP_MouseBootProtocol, + .HIDInterfaceProtocol = HID_CSCP_MouseBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index 7948e2c492..1e82a662fd 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_BOOTP_NonBootProtocol, + .HIDInterfaceProtocol = HID_CSCP_NonBootProtocol, .HIDParserData = &HIDReportInfo }, diff --git a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c index 83eb301015..ccae367709 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c @@ -139,7 +139,7 @@ uint8_t DComp_NextHIDInterface(void* CurrentDescriptor) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Check the HID descriptor class, break out if correct class/protocol interface found */ - if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CLASS) + if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CSCP_HIDClass) { /* Indicate that the descriptor being searched for has been found */ return DESCRIPTOR_SEARCH_Found; diff --git a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h index bde9514397..ebd5a4e317 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h @@ -42,9 +42,6 @@ #include "GenericHIDHost.h" /* Macros: */ - /** Interface Class value for the Human Interface Device class. */ - #define HID_CLASS 0x03 - /** Pipe number for the HID data IN pipe. */ #define HID_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c index 33d77154ba..e419e7c359 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c @@ -133,9 +133,8 @@ uint8_t DComp_NextJoystickInterface(void* CurrentDescriptor) { if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == JOYSTICK_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == JOYSTICK_PROTOCOL)) + /* Check the HID descriptor class, break out if correct class interface found */ + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CSCP_HIDClass)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h index b401109636..d3461196d3 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h @@ -42,12 +42,6 @@ #include "HIDReport.h" /* Macros: */ - /** Interface Class value for the Human Interface Device class. */ - #define JOYSTICK_CLASS 0x03 - - /** Interface Protocol value for a Boot Protocol Mouse compliant device. */ - #define JOYSTICK_PROTOCOL 0x02 - /** Pipe number for the joystick report data pipe. */ #define JOYSTICK_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c index ea42a28abe..bf52a1462f 100644 --- a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c @@ -119,8 +119,8 @@ uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL)) + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CSCP_HIDClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == HID_CSCP_KeyboardBootProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h index 14f691b68b..b300c5138d 100644 --- a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h @@ -42,12 +42,6 @@ #include "KeyboardHost.h" /* Macros: */ - /** Interface Class value for the Human Interface Device class. */ - #define KEYBOARD_CLASS 0x03 - - /** Interface Protocol value for a Boot Protocol Keyboard compliant device. */ - #define KEYBOARD_PROTOCOL 0x01 - /** Pipe number for the keyboard data IN pipe. */ #define KEYBOARD_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c index dc2daf9ed3..132b97bfff 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c @@ -52,7 +52,7 @@ uint8_t ProcessConfigurationDescriptor(void) uint16_t CurrConfigBytesRem; USB_Descriptor_Interface_t* HIDInterface = NULL; - USB_Descriptor_HID_t* HIDDescriptor = NULL; + USB_HID_Descriptor_HID_t* HIDDescriptor = NULL; USB_Descriptor_Endpoint_t* DataINEndpoint = NULL; /* Retrieve the entire configuration descriptor into the allocated buffer */ @@ -95,7 +95,7 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Save the HID descriptor for later use */ - HIDDescriptor = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_HID_t); + HIDDescriptor = DESCRIPTOR_PCAST(CurrConfigLocation, USB_HID_Descriptor_HID_t); /* Skip the remainder of the loop as we have not found an endpoint yet */ continue; @@ -133,9 +133,8 @@ uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor) { if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL)) + /* Check the HID descriptor class, break out if correct class interface found */ + if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CSCP_HIDClass) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h index ab04b31055..245b5e30a4 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h @@ -42,12 +42,6 @@ #include "HIDReport.h" /* Macros: */ - /** Interface Class value for the Human Interface Device class. */ - #define KEYBOARD_CLASS 0x03 - - /** Interface Protocol value for a Boot Protocol Keyboard compliant device. */ - #define KEYBOARD_PROTOCOL 0x01 - /** Pipe number for the keyboard report data pipe. */ #define KEYBOARD_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.c b/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.c index d2dde64bda..1366a1e1ac 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.c @@ -51,7 +51,7 @@ uint8_t GetHIDReportData(void) { .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE), .bRequest = REQ_GetDescriptor, - .wValue = (DTYPE_Report << 8), + .wValue = (HID_DTYPE_Report << 8), .wIndex = 0, .wLength = HIDReportSize, }; diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.h b/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.h index cf409caf8a..1cb73e3720 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.h @@ -41,6 +41,10 @@ #include "KeyboardHostWithParser.h" + /* Macros: */ + /** HID Report Descriptor Usage Page value for a desktop keyboard. */ + #define USAGE_PAGE_KEYBOARD 0x07 + /* Enums: */ /** Enum for the possible return codes of the \ref GetHIDReportData() function. */ enum KeyboardHostWithParser_GetHIDReportDataCodes_t diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c index 874fa7a3ae..2d7248088c 100644 --- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c @@ -129,9 +129,9 @@ uint8_t DComp_NextMIDIStreamingInterface(void* CurrentDescriptor) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Check the MIDI descriptor class, subclass and protocol, break out if correct data interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == MIDI_STREAMING_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == MIDI_STREAMING_SUBCLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MIDI_STREAMING_PROTOCOL)) + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == AUDIO_CSCP_AudioClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == AUDIO_CSCP_MIDIStreamingSubclass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == AUDIO_CSCP_StreamingProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h index 57a36d9249..2fb9e473ea 100644 --- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h @@ -42,15 +42,6 @@ #include "MIDIHost.h" /* Macros: */ - /** Interface Class value for the MIDI Audio class. */ - #define MIDI_STREAMING_CLASS 0x01 - - /** Interface Class value for the MIDI Audio Streaming subclass. */ - #define MIDI_STREAMING_SUBCLASS 0x03 - - /** Interface Class value for the MIDI Audio Streaming protocol. */ - #define MIDI_STREAMING_PROTOCOL 0x00 - /** Pipe number for the MIDI data IN pipe. */ #define MIDI_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c index 1ab70077e8..ce616cb2af 100644 --- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c +++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c @@ -189,7 +189,7 @@ static uint8_t MassStore_SendReceiveData(MS_CommandBlockWrapper_t* const SCSICom uint16_t BytesRem = SCSICommandBlock->DataTransferLength; /* Check the direction of the SCSI command data stage */ - if (SCSICommandBlock->Flags & COMMAND_DIRECTION_DATA_IN) + if (SCSICommandBlock->Flags & MS_COMMAND_DIR_DATA_IN) { /* Wait until the device has replied with some data */ if ((ErrorCode = MassStore_WaitForDataReceived()) != PIPE_RWSTREAM_NoError) @@ -347,9 +347,9 @@ uint8_t MassStore_Inquiry(const uint8_t LUNIndex, /* Create a CBW with a SCSI command to issue INQUIRY command */ MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { - .Signature = CBW_SIGNATURE, + .Signature = MS_CBW_SIGNATURE, .DataTransferLength = sizeof(SCSI_Inquiry_Response_t), - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 6, .SCSICommandData = @@ -398,9 +398,9 @@ uint8_t MassStore_RequestSense(const uint8_t LUNIndex, /* Create a CBW with a SCSI command to issue REQUEST SENSE command */ MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { - .Signature = CBW_SIGNATURE, + .Signature = MS_CBW_SIGNATURE, .DataTransferLength = sizeof(SCSI_Request_Sense_Response_t), - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 6, .SCSICommandData = @@ -455,9 +455,9 @@ uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, /* Create a CBW with a SCSI command to read in the given blocks from the device */ MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { - .Signature = CBW_SIGNATURE, + .Signature = MS_CBW_SIGNATURE, .DataTransferLength = ((uint32_t)Blocks * BlockSize), - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 10, .SCSICommandData = @@ -516,9 +516,9 @@ uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, /* Create a CBW with a SCSI command to write the given blocks to the device */ MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { - .Signature = CBW_SIGNATURE, + .Signature = MS_CBW_SIGNATURE, .DataTransferLength = ((uint32_t)Blocks * BlockSize), - .Flags = COMMAND_DIRECTION_DATA_OUT, + .Flags = MS_COMMAND_DIR_DATA_OUT, .LUN = LUNIndex, .SCSICommandLength = 10, .SCSICommandData = @@ -569,9 +569,9 @@ uint8_t MassStore_TestUnitReady(const uint8_t LUNIndex) /* Create a CBW with a SCSI command to issue TEST UNIT READY command */ MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { - .Signature = CBW_SIGNATURE, + .Signature = MS_CBW_SIGNATURE, .DataTransferLength = 0, - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 6, .SCSICommandData = @@ -620,9 +620,9 @@ uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, /* Create a CBW with a SCSI command to issue READ CAPACITY command */ MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { - .Signature = CBW_SIGNATURE, + .Signature = MS_CBW_SIGNATURE, .DataTransferLength = sizeof(SCSI_Capacity_t), - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 10, .SCSICommandData = @@ -680,9 +680,9 @@ uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, /* Create a CBW with a SCSI command to issue PREVENT ALLOW MEDIUM REMOVAL command */ MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { - .Signature = CBW_SIGNATURE, + .Signature = MS_CBW_SIGNATURE, .DataTransferLength = 0, - .Flags = COMMAND_DIRECTION_DATA_OUT, + .Flags = MS_COMMAND_DIR_DATA_OUT, .LUN = LUNIndex, .SCSICommandLength = 6, .SCSICommandData = diff --git a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c index 83e0c53383..3a28802e2b 100644 --- a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c @@ -120,8 +120,8 @@ uint8_t DComp_NextMouseInterface(void* CurrentDescriptor) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == MOUSE_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL)) + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CSCP_HIDClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == HID_CSCP_MouseBootProtocol)) { /* Indicate that the descriptor being searched for has been found */ return DESCRIPTOR_SEARCH_Found; diff --git a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h index 57d71e692c..d482ad600f 100644 --- a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h @@ -42,12 +42,6 @@ #include "MouseHost.h" /* Macros: */ - /** Interface Class value for the Human Interface Device class. */ - #define MOUSE_CLASS 0x03 - - /** Interface Protocol value for a Boot Protocol Mouse compliant device. */ - #define MOUSE_PROTOCOL 0x02 - /** Pipe number for the mouse data IN pipe. */ #define MOUSE_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c index eb85e4a474..033c8ac7fb 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c @@ -133,9 +133,8 @@ uint8_t DComp_NextMouseInterface(void* CurrentDescriptor) { if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == MOUSE_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL)) + /* Check the HID descriptor class, break out if correct class interface found */ + if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CSCP_HIDClass) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h index 2e44b40689..b9d11ad65e 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h @@ -42,12 +42,6 @@ #include "HIDReport.h" /* Macros: */ - /** Interface Class value for the Human Interface Device class. */ - #define MOUSE_CLASS 0x03 - - /** Interface Protocol value for a Boot Protocol Mouse compliant device. */ - #define MOUSE_PROTOCOL 0x02 - /** Pipe number for the mouse report data pipe. */ #define MOUSE_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c index b269820e42..30096743fe 100644 --- a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c @@ -132,10 +132,10 @@ uint8_t DComp_NextBidirectionalPrinterInterface(void* CurrentDescriptor) { if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - /* Check the descriptor class and protocol, break out if correct class/protocol interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == PRINTER_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == PRINTER_SUBCLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == PRINTER_PROTOCOL)) + /* Check the descriptor class, subclass and protocol, break out if correct value interface found */ + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == PRNT_CSCP_PrinterClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == PRNT_CSCP_PrinterSubclass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == PRNT_CSCP_BidirectionalProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h index b25f3bdc7a..9b97503629 100644 --- a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h @@ -38,15 +38,6 @@ #include "Lib/PrinterCommands.h" /* Macros: */ - /** Interface Class value for the Printer Device class. */ - #define PRINTER_CLASS 0x07 - - /** Interface Subclass value for the Printer Device class. */ - #define PRINTER_SUBCLASS 0x01 - - /** Interface Protocol value for a Bidirectional communication encapsulation. */ - #define PRINTER_PROTOCOL 0x02 - /** Pipe number of the Printer data IN pipe. */ #define PRINTER_DATA_IN_PIPE 1 @@ -68,12 +59,12 @@ /** Interface index of the Bidirectional Printer interface within the device, once the Configuration * Descriptor has been processed. */ - uint8_t PrinterInterfaceNumber; + extern uint8_t PrinterInterfaceNumber; /** Interface Alternate Setting index of the Bidirectional Printer interface within the device, once * the Configuration Descriptor has been processed. */ - uint8_t PrinterAltSetting; + extern uint8_t PrinterAltSetting; /* Function Prototypes: */ uint8_t ProcessConfigurationDescriptor(void); diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c index 1190d28b77..88a15c69be 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c @@ -160,9 +160,9 @@ uint8_t DComp_NextCDCControlInterface(void* CurrentDescriptor) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Check the CDC descriptor class, subclass and protocol, break out if correct control interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_CONTROL_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CONTROL_SUBCLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CONTROL_PROTOCOL)) + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_CSCP_CDCClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CSCP_ACMSubclass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CSCP_VendorSpecificProtocol)) { return DESCRIPTOR_SEARCH_Found; } @@ -184,9 +184,9 @@ uint8_t DComp_NextCDCDataInterface(void* CurrentDescriptor) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Check the CDC descriptor class, subclass and protocol, break out if correct data interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_DATA_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_DATA_SUBCLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_DATA_PROTOCOL)) + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_CSCP_CDCDataClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CSCP_NoDataSubclass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CSCP_NoDataProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h index 740d73ef01..86ded05876 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h @@ -42,15 +42,6 @@ #include "RNDISEthernetHost.h" /* Macros: */ - /** Interface Class value for the CDC data class. */ - #define CDC_DATA_CLASS 0x0A - - /** Interface Class value for the CDC data subclass. */ - #define CDC_DATA_SUBCLASS 0x00 - - /** Interface Class value for the CDC data protocol. */ - #define CDC_DATA_PROTOCOL 0x00 - /** Pipe number for the RNDIS data IN pipe. */ #define RNDIS_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c index 2a00a7361d..ebb4002b97 100644 --- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c @@ -143,10 +143,10 @@ uint8_t DComp_NextStillImageInterface(void* CurrentDescriptor) { if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - /* Check the descriptor class and protocol, break out if correct class/protocol interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == SIMAGE_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == SIMAGE_SUBCLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == SIMAGE_PROTOCOL)) + /* Check the descriptor class, subclass and protocol, break out if correct interface found */ + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == SI_CSCP_StillImageClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == SI_CSCP_StillImageSubclass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == SI_CSCP_BulkOnlyProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h index bd31c6bf27..082e75e768 100644 --- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h @@ -42,15 +42,6 @@ #include "StillImageHost.h" /* Macros: */ - /** Interface Class value for the Still Image Device class. */ - #define SIMAGE_CLASS 0x06 - - /** Interface Class value for the Still Image Device subclass. */ - #define SIMAGE_SUBCLASS 0x01 - - /** Interface Class value for the Still Image Device protocol. */ - #define SIMAGE_PROTOCOL 0x01 - /** Pipe number of the Still Image data IN pipe. */ #define SIMAGE_DATA_IN_PIPE 1 diff --git a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c index 54eb99c84b..611399c1ea 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c @@ -160,9 +160,9 @@ uint8_t DComp_NextCDCControlInterface(void* CurrentDescriptor) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Check the CDC descriptor class, subclass and protocol, break out if correct control interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_CONTROL_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CONTROL_SUBCLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CONTROL_PROTOCOL)) + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_CSCP_CDCClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CSCP_ACMSubclass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CSCP_ATCommandProtocol)) { return DESCRIPTOR_SEARCH_Found; } @@ -184,9 +184,9 @@ uint8_t DComp_NextCDCDataInterface(void* CurrentDescriptor) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Check the CDC descriptor class, subclass and protocol, break out if correct data interface found */ - if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_DATA_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_DATA_SUBCLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_DATA_PROTOCOL)) + if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_CSCP_CDCDataClass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CSCP_NoDataSubclass) && + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CSCP_NoDataProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h index 270e130ae6..1da1035a6a 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h @@ -42,24 +42,6 @@ #include "VirtualSerialHost.h" /* Macros: */ - /** Interface Class value for the CDC class. */ - #define CDC_CONTROL_CLASS 0x02 - - /** Interface Class value for the CDC Communication Interface subclass. */ - #define CDC_CONTROL_SUBCLASS 0x02 - - /** Interface Class value for the CDC protocol. */ - #define CDC_CONTROL_PROTOCOL 0x01 - - /** Interface Class value for the CDC data class. */ - #define CDC_DATA_CLASS 0x0A - - /** Interface Class value for the CDC data subclass. */ - #define CDC_DATA_SUBCLASS 0x00 - - /** Interface Class value for the CDC data protocol. */ - #define CDC_DATA_PROTOCOL 0x00 - /** Pipe number for the CDC data IN pipe. */ #define CDC_DATA_IN_PIPE 1 diff --git a/LUFA.pnproj b/LUFA.pnproj index 37f5b2fec6..be0c1a14c2 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h index b848015e04..b5739c1d0e 100644 --- a/LUFA/Drivers/USB/Class/Common/Audio.h +++ b/LUFA/Drivers/USB/Class/Common/Audio.h @@ -210,6 +210,31 @@ #define AUDIO_EP_ACCEPTS_SMALL_PACKETS (0 << 7) /* Enums: */ + /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Audio + * device class. + */ + enum Audio_Descriptor_ClassSubclassProtocol_t + { + AUDIO_CSCP_AudioClass = 0x01, /**< Descriptor Class value indicating that the device or + * interface belongs to the USB Audio 1.0 class. + */ + AUDIO_CSCP_ControlSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or + * interface belongs to the Audio Control subclass. + */ + AUDIO_CSCP_ControlProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or + * interface belongs to the Audio Control protocol. + */ + AUDIO_CSCP_AudioStreamingSubclass = 0x02, /**< Descriptor Subclass value indicating that the device or + * interface belongs to the MIDI Streaming subclass. + */ + AUDIO_CSCP_MIDIStreamingSubclass = 0x03, /**< Descriptor Subclass value indicating that the device or + * interface belongs to the Audio streaming subclass. + */ + AUDIO_CSCP_StreamingProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or + * interface belongs to the Streaming Audio protocol. + */ + }; + /** Audio class specific interface description subtypes, for the Audio Control interface. */ enum Audio_CSInterface_AC_SubTypes_t { diff --git a/LUFA/Drivers/USB/Class/Common/CDC.h b/LUFA/Drivers/USB/Class/Common/CDC.h index eb6577e5ca..b4ce72ef8d 100644 --- a/LUFA/Drivers/USB/Class/Common/CDC.h +++ b/LUFA/Drivers/USB/Class/Common/CDC.h @@ -127,6 +127,40 @@ } /* Enums: */ + /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the CDC + * device class. + */ + enum CDC_Descriptor_ClassSubclassProtocol_t + { + CDC_CSCP_CDCClass = 0x02, /**< Descriptor Class value indicating that the device or interface + * belongs to the CDC class. + */ + CDC_CSCP_NoSpecificSubclass = 0x00, /**< Descriptor Subclass value indicating that the device or interface + * belongs to no specific subclass of the CDC class. + */ + CDC_CSCP_ACMSubclass = 0x02, /**< Descriptor Subclass value indicating that the device or interface + * belongs to the Abstract Control Model CDC subclass. + */ + CDC_CSCP_ATCommandProtocol = 0x01, /**< Descriptor Protocol value indicating that the device or interface + * belongs to the AT Command protocol of the CDC class. + */ + CDC_CSCP_NoSpecificProtocol = 0x00, /**< Descriptor Class value indicating that the device or interface + * belongs to no specific protocol of the CDC class. + */ + CDC_CSCP_VendorSpecificProtocol = 0xFF, /**< Descriptor Class value indicating that the device or interface + * belongs to a vendor-specific protocol of the CDC class. + */ + CDC_CSCP_CDCDataClass = 0x0A, /**< Descriptor Class value indicating that the device or interface + * belongs to the CDC Data class. + */ + CDC_CSCP_NoDataSubclass = 0x00, /**< Descriptor Subclass value indicating that the device or interface + * belongs to no specific subclass of the CDC data class. + */ + CDC_CSCP_NoDataProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or interface + * belongs to no specific protocol of the CDC data class. + */ + }; + /** Enum for the CDC class specific control requests that can be issued by the USB bus host. */ enum CDC_ClassRequests_t { diff --git a/LUFA/Drivers/USB/Class/Common/HID.h b/LUFA/Drivers/USB/Class/Common/HID.h index b5d095e084..0a7ada3a94 100644 --- a/LUFA/Drivers/USB/Class/Common/HID.h +++ b/LUFA/Drivers/USB/Class/Common/HID.h @@ -98,6 +98,31 @@ #define HID_KEYBOARD_LED_KATANA (1 << 3) /* Type Defines: */ + /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the HID + * device class. + */ + enum HID_Descriptor_ClassSubclassProtocol_t + { + HID_CSCP_HIDClass = 0x03, /**< Descriptor Class value indicating that the device or interface + * belongs to the HID class. + */ + HID_CSCP_NonBootSubclass = 0x00, /**< Descriptor Subclass value indicating that the device or interface + * does not implement a HID boot protocol. + */ + HID_CSCP_BootSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface + * implements a HID boot protocol. + */ + HID_CSCP_NonBootProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or interface + * does not belong to a HID boot protocol. + */ + HID_CSCP_KeyboardBootProtocol = 0x01, /**< Descriptor Protocol value indicating that the device or interface + * belongs to the Keyboard HID boot protocol. + */ + HID_CSCP_MouseBootProtocol = 0x02, /**< Descriptor Protocol value indicating that the device or interface + * belongs to the Mouse HID boot protocol. + */ + }; + /** Enum for the HID class specific control requests that can be issued by the USB bus host. */ enum HID_ClassRequests_t { @@ -116,23 +141,6 @@ 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 { diff --git a/LUFA/Drivers/USB/Class/Common/MIDI.h b/LUFA/Drivers/USB/Class/Common/MIDI.h index 22e32479fe..b92c5f962f 100644 --- a/LUFA/Drivers/USB/Class/Common/MIDI.h +++ b/LUFA/Drivers/USB/Class/Common/MIDI.h @@ -87,6 +87,7 @@ #define MIDI_CHANNEL(channel) ((channel) - 1) /* Enums: */ + /** Enum for the possible MIDI jack types in a MIDI device jack descriptor. */ enum MIDI_JackTypes_t { MIDI_JACKTYPE_Embedded = 0x01, /**< MIDI class descriptor jack type value for an embedded (logical) MIDI input or output jack. */ diff --git a/LUFA/Drivers/USB/Class/Common/MassStorage.h b/LUFA/Drivers/USB/Class/Common/MassStorage.h index e8693335d2..01e5c94452 100644 --- a/LUFA/Drivers/USB/Class/Common/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Common/MassStorage.h @@ -205,25 +205,42 @@ #define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07 /* Enums: */ + /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Mass + * Storage device class. + */ + enum MS_Descriptor_ClassSubclassProtocol_t + { + MS_CSCP_MassStorageClass = 0x08, /**< Descriptor Class value indicating that the device or interface + * belongs to the Mass Storage class. + */ + MS_CSCP_SCSITransparentSubclass = 0x06, /**< Descriptor Subclass value indicating that the device or interface + * belongs to the SCSI Transparent Command Set subclass of the Mass + * storage class. + */ + MS_CSCP_BulkOnlyTransportProtocol = 0x50, /**< Descriptor Protocol value indicating that the device or interface + * belongs to the Bulk Only Transport protocol of the Mass Storage class. + */ + }; + /** 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. - */ + 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. */ + 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: */ diff --git a/LUFA/Drivers/USB/Class/Common/Printer.h b/LUFA/Drivers/USB/Class/Common/Printer.h index 03ae12e590..6619ced04a 100644 --- a/LUFA/Drivers/USB/Class/Common/Printer.h +++ b/LUFA/Drivers/USB/Class/Common/Printer.h @@ -76,19 +76,35 @@ #define PRNT_PORTSTATUS_PAPEREMPTY (1 << 5) /* Enums: */ + /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Printer + * device class. + */ + enum PRNT_Descriptor_ClassSubclassProtocol_t + { + PRNT_CSCP_PrinterClass = 0x07, /**< Descriptor Class value indicating that the device or interface + * belongs to the Printer class. + */ + PRNT_CSCP_PrinterSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface + * belongs to the Printer subclass. + */ + PRNT_CSCP_BidirectionalProtocol = 0x02, /**< Descriptor Protocol value indicating that the device or interface + * belongs to the Bidirectional protocol of the Printer class. + */ + }; + /** Enum for the Printer class specific control requests that can be issued by the USB bus host. */ enum PRNT_ClassRequests_t { - PRNT_REQ_GetDeviceID = 0x00, /**< Printer class-specific request to retrieve the Unicode ID - * string of the device, containing the device's name, manufacturer - * and supported printer languages. - */ - PRNT_REQ_GetPortStatus = 0x01, /**< Printer class-specific request to get the current status of the - * virtual printer port, for device selection and ready states. - */ - PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new - * printer commands. - */ + PRNT_REQ_GetDeviceID = 0x00, /**< Printer class-specific request to retrieve the Unicode ID + * string of the device, containing the device's name, manufacturer + * and supported printer languages. + */ + PRNT_REQ_GetPortStatus = 0x01, /**< Printer class-specific request to get the current status of the + * virtual printer port, for device selection and ready states. + */ + PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new + * printer commands. + */ }; /* Disable C linkage for C++ Compilers: */ diff --git a/LUFA/Drivers/USB/Class/Common/StillImage.h b/LUFA/Drivers/USB/Class/Common/StillImage.h index bb9460934b..98dc7981c9 100644 --- a/LUFA/Drivers/USB/Class/Common/StillImage.h +++ b/LUFA/Drivers/USB/Class/Common/StillImage.h @@ -100,6 +100,22 @@ }; /* Enums: */ + /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the + * Still Image device class. + */ + enum SI_Descriptor_ClassSubclassProtocol_t + { + SI_CSCP_StillImageClass = 0x06, /**< Descriptor Class value indicating that the device or interface + * belongs to the Still Image class. + */ + SI_CSCP_StillImageSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface + * belongs to the Still Image subclass. + */ + SI_CSCP_BulkOnlyProtocol = 0x01, /**< Descriptor Protocol value indicating that the device or interface + * belongs to the Bulk Only Transport protocol of the Still Image class. + */ + }; + /** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */ enum PIMA_ResponseCodes_t { diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index 28d94e5945..ab5305f8ea 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -142,9 +142,9 @@ static uint8_t DCOMP_CDC_Host_NextCDCControlInterface(void* const CurrentDescrip USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if ((CurrentInterface->Class == CDC_CONTROL_CLASS) && - (CurrentInterface->SubClass == CDC_CONTROL_SUBCLASS) && - (CurrentInterface->Protocol == CDC_CONTROL_PROTOCOL)) + if ((CurrentInterface->Class == CDC_CSCP_CDCClass) && + (CurrentInterface->SubClass == CDC_CSCP_ACMSubclass) && + (CurrentInterface->Protocol == CDC_CSCP_ATCommandProtocol)) { return DESCRIPTOR_SEARCH_Found; } @@ -160,9 +160,9 @@ static uint8_t DCOMP_CDC_Host_NextCDCDataInterface(void* const CurrentDescriptor USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if ((CurrentInterface->Class == CDC_DATA_CLASS) && - (CurrentInterface->SubClass == CDC_DATA_SUBCLASS) && - (CurrentInterface->Protocol == CDC_DATA_PROTOCOL)) + if ((CurrentInterface->Class == CDC_CSCP_CDCDataClass) && + (CurrentInterface->SubClass == CDC_CSCP_NoDataSubclass) && + (CurrentInterface->Protocol == CDC_CSCP_NoDataProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/LUFA/Drivers/USB/Class/Host/CDC.h b/LUFA/Drivers/USB/Class/Host/CDC.h index 164e94f925..b9b468781c 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.h +++ b/LUFA/Drivers/USB/Class/Host/CDC.h @@ -306,14 +306,6 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) - /* Macros: */ - #define CDC_CONTROL_CLASS 0x02 - #define CDC_CONTROL_SUBCLASS 0x02 - #define CDC_CONTROL_PROTOCOL 0x01 - #define CDC_DATA_CLASS 0x0A - #define CDC_DATA_SUBCLASS 0x00 - #define CDC_DATA_PROTOCOL 0x00 - /* Function Prototypes: */ #if defined(__INCLUDE_FROM_CDC_HOST_C) static int CDC_Host_putchar(char c, diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index c387665004..60dec5a185 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -118,7 +118,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber; HIDInterfaceInfo->State.HIDReportSize = HIDDescriptor->HIDReportLength; - HIDInterfaceInfo->State.SupportsBootProtocol = (HIDInterface->SubClass != HID_BOOTP_NonBootProtocol); + HIDInterfaceInfo->State.SupportsBootProtocol = (HIDInterface->SubClass != HID_CSCP_NonBootProtocol); HIDInterfaceInfo->State.LargestReportSize = 8; HIDInterfaceInfo->State.IsActive = true; @@ -132,7 +132,7 @@ static uint8_t DCOMP_HID_Host_NextHIDInterface(void* const CurrentDescriptor) USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if (CurrentInterface->Class == HID_INTERFACE_CLASS) + if (CurrentInterface->Class == HID_CSCP_HIDClass) return DESCRIPTOR_SEARCH_Found; } diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h index 9c86e12405..af8407bb51 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.h +++ b/LUFA/Drivers/USB/Class/Host/HID.h @@ -297,9 +297,6 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) - /* Macros: */ - #define HID_INTERFACE_CLASS 0x03 - /* Function Prototypes: */ #if defined(__INCLUDE_FROM_HID_HOST_C) static uint8_t DCOMP_HID_Host_NextHIDInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.c b/LUFA/Drivers/USB/Class/Host/MIDI.c index 4483b5073e..c500240e7e 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDI.c +++ b/LUFA/Drivers/USB/Class/Host/MIDI.c @@ -110,9 +110,9 @@ static uint8_t DCOMP_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDes USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if ((CurrentInterface->Class == MIDI_STREAMING_CLASS) && - (CurrentInterface->SubClass == MIDI_STREAMING_SUBCLASS) && - (CurrentInterface->Protocol == MIDI_STREAMING_PROTOCOL)) + if ((CurrentInterface->Class == AUDIO_CSCP_AudioClass) && + (CurrentInterface->SubClass == AUDIO_CSCP_MIDIStreamingSubclass) && + (CurrentInterface->Protocol == AUDIO_CSCP_StreamingProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.h b/LUFA/Drivers/USB/Class/Host/MIDI.h index 34228121ff..a21bdbd52d 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDI.h +++ b/LUFA/Drivers/USB/Class/Host/MIDI.h @@ -188,11 +188,6 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) - /* Macros: */ - #define MIDI_STREAMING_CLASS 0x01 - #define MIDI_STREAMING_SUBCLASS 0x03 - #define MIDI_STREAMING_PROTOCOL 0x00 - /* Function Prototypes: */ #if defined(__INCLUDE_FROM_MIDI_HOST_C) static uint8_t DCOMP_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c index 97b0aba4d9..8cb1042bb2 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c @@ -110,9 +110,9 @@ static uint8_t DCOMP_MS_Host_NextMSInterface(void* const CurrentDescriptor) USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if ((CurrentInterface->Class == MASS_STORE_CLASS) && - (CurrentInterface->SubClass == MASS_STORE_SUBCLASS) && - (CurrentInterface->Protocol == MASS_STORE_PROTOCOL)) + if ((CurrentInterface->Class == MS_CSCP_MassStorageClass) && + (CurrentInterface->SubClass == MS_CSCP_SCSITransparentSubclass) && + (CurrentInterface->Protocol == MS_CSCP_BulkOnlyTransportProtocol)) { return DESCRIPTOR_SEARCH_Found; } @@ -150,7 +150,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; - SCSICommandBlock->Signature = CBW_SIGNATURE; + SCSICommandBlock->Signature = MS_CBW_SIGNATURE; SCSICommandBlock->Tag = ++MSInterfaceInfo->State.TransactionTag; if (MSInterfaceInfo->State.TransactionTag == 0xFFFFFFFF) @@ -180,7 +180,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) { - uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS; + uint16_t TimeoutMSRem = MS_COMMAND_DATA_TIMEOUT_MS; uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber(); Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber); @@ -240,7 +240,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfac uint8_t ErrorCode = PIPE_RWSTREAM_NoError; uint16_t BytesRem = SCSICommandBlock->DataTransferLength; - if (SCSICommandBlock->Flags & COMMAND_DIRECTION_DATA_IN) + if (SCSICommandBlock->Flags & MS_COMMAND_DIR_DATA_IN) { if ((ErrorCode = MS_Host_WaitForDataReceived(MSInterfaceInfo)) != PIPE_RWSTREAM_NoError) { @@ -357,7 +357,7 @@ uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { .DataTransferLength = sizeof(SCSI_Inquiry_Response_t), - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 6, .SCSICommandData = @@ -393,7 +393,7 @@ uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { .DataTransferLength = 0, - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 6, .SCSICommandData = @@ -430,7 +430,7 @@ uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* const MSInterfaceInf MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { .DataTransferLength = sizeof(SCSI_Capacity_t), - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 10, .SCSICommandData = @@ -474,7 +474,7 @@ uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { .DataTransferLength = sizeof(SCSI_Request_Sense_Response_t), - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 6, .SCSICommandData = @@ -511,7 +511,7 @@ uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* const MSInter MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { .DataTransferLength = 0, - .Flags = COMMAND_DIRECTION_DATA_OUT, + .Flags = MS_COMMAND_DIR_DATA_OUT, .LUN = LUNIndex, .SCSICommandLength = 6, .SCSICommandData = @@ -551,7 +551,7 @@ uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { .DataTransferLength = ((uint32_t)Blocks * BlockSize), - .Flags = COMMAND_DIRECTION_DATA_IN, + .Flags = MS_COMMAND_DIR_DATA_IN, .LUN = LUNIndex, .SCSICommandLength = 10, .SCSICommandData = @@ -595,7 +595,7 @@ uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t) { .DataTransferLength = ((uint32_t)Blocks * BlockSize), - .Flags = COMMAND_DIRECTION_DATA_OUT, + .Flags = MS_COMMAND_DIR_DATA_OUT, .LUN = LUNIndex, .SCSICommandLength = 10, .SCSICommandData = diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h index f375f32446..7eca948203 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h @@ -313,17 +313,7 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */ - #define MASS_STORE_CLASS 0x08 - #define MASS_STORE_SUBCLASS 0x06 - #define MASS_STORE_PROTOCOL 0x50 - - #define CBW_SIGNATURE 0x43425355UL - #define CSW_SIGNATURE 0x53425355UL - - #define COMMAND_DIRECTION_DATA_OUT (0 << 7) - #define COMMAND_DIRECTION_DATA_IN (1 << 7) - - #define COMMAND_DATA_TIMEOUT_MS 10000 + #define MS_COMMAND_DATA_TIMEOUT_MS 10000 /* Function Prototypes: */ #if defined(__INCLUDE_FROM_MASSSTORAGE_HOST_C) diff --git a/LUFA/Drivers/USB/Class/Host/Printer.c b/LUFA/Drivers/USB/Class/Host/Printer.c index 4249a8b702..e69948b1e9 100644 --- a/LUFA/Drivers/USB/Class/Host/Printer.c +++ b/LUFA/Drivers/USB/Class/Host/Printer.c @@ -111,9 +111,9 @@ static uint8_t DCOMP_PRNT_Host_NextPRNTInterface(void* CurrentDescriptor) USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if ((CurrentInterface->Class == PRINTER_CLASS) && - (CurrentInterface->SubClass == PRINTER_SUBCLASS) && - (CurrentInterface->Protocol == PRINTER_PROTOCOL)) + if ((CurrentInterface->Class == PRNT_CSCP_PrinterClass) && + (CurrentInterface->SubClass == PRNT_CSCP_PrinterSubclass) && + (CurrentInterface->Protocol == PRNT_CSCP_BidirectionalProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/LUFA/Drivers/USB/Class/Host/Printer.h b/LUFA/Drivers/USB/Class/Host/Printer.h index 962806e52c..f82941905d 100644 --- a/LUFA/Drivers/USB/Class/Host/Printer.h +++ b/LUFA/Drivers/USB/Class/Host/Printer.h @@ -264,11 +264,6 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) - /* Macros: */ - #define PRINTER_CLASS 0x07 - #define PRINTER_SUBCLASS 0x01 - #define PRINTER_PROTOCOL 0x02 - /* Function Prototypes: */ #if defined(__INCLUDE_FROM_PRINTER_HOST_C) static uint8_t DCOMP_PRNT_Host_NextPRNTInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.c b/LUFA/Drivers/USB/Class/Host/RNDIS.c index ad242b2589..3054d7fc1b 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDIS.c +++ b/LUFA/Drivers/USB/Class/Host/RNDIS.c @@ -142,9 +142,9 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISControlInterface(void* const CurrentDes USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if ((CurrentInterface->Class == RNDIS_CONTROL_CLASS) && - (CurrentInterface->SubClass == RNDIS_CONTROL_SUBCLASS) && - (CurrentInterface->Protocol == RNDIS_CONTROL_PROTOCOL)) + if ((CurrentInterface->Class == CDC_CSCP_CDCClass) && + (CurrentInterface->SubClass == CDC_CSCP_ACMSubclass) && + (CurrentInterface->Protocol == CDC_CSCP_VendorSpecificProtocol)) { return DESCRIPTOR_SEARCH_Found; } @@ -160,9 +160,9 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISDataInterface(void* const CurrentDescri USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if ((CurrentInterface->Class == RNDIS_DATA_CLASS) && - (CurrentInterface->SubClass == RNDIS_DATA_SUBCLASS) && - (CurrentInterface->Protocol == RNDIS_DATA_PROTOCOL)) + if ((CurrentInterface->Class == CDC_CSCP_CDCDataClass) && + (CurrentInterface->SubClass == CDC_CSCP_NoDataSubclass) && + (CurrentInterface->Protocol == CDC_CSCP_NoDataProtocol)) { return DESCRIPTOR_SEARCH_Found; } diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.h b/LUFA/Drivers/USB/Class/Host/RNDIS.h index 2c2aad8df3..f79a2c42bf 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Host/RNDIS.h @@ -262,14 +262,6 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) - /* Macros: */ - #define RNDIS_CONTROL_CLASS 0x02 - #define RNDIS_CONTROL_SUBCLASS 0x02 - #define RNDIS_CONTROL_PROTOCOL 0xFF - #define RNDIS_DATA_CLASS 0x0A - #define RNDIS_DATA_SUBCLASS 0x00 - #define RNDIS_DATA_PROTOCOL 0x00 - /* Function Prototypes: */ #if defined(__INCLUDE_FROM_RNDIS_HOST_C) static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.c b/LUFA/Drivers/USB/Class/Host/StillImage.c index 25c5f20b06..c4cd47e75c 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.c +++ b/LUFA/Drivers/USB/Class/Host/StillImage.c @@ -128,9 +128,9 @@ uint8_t DCOMP_SI_Host_NextSIInterface(void* const CurrentDescriptor) USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t); - if ((CurrentInterface->Class == STILL_IMAGE_CLASS) && - (CurrentInterface->SubClass == STILL_IMAGE_SUBCLASS) && - (CurrentInterface->Protocol == STILL_IMAGE_PROTOCOL)) + if ((CurrentInterface->Class == SI_CSCP_StillImageClass) && + (CurrentInterface->SubClass == SI_CSCP_StillImageSubclass) && + (CurrentInterface->Protocol == SI_CSCP_BulkOnlyProtocol)) { return DESCRIPTOR_SEARCH_Found; } @@ -196,7 +196,7 @@ uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, PIMA_Container_t* const PIMAHeader) { - uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS; + uint16_t TimeoutMSRem = SI_COMMAND_DATA_TIMEOUT_MS; uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber(); if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive)) diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h index 07c6546c2f..4367bcea8a 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.h +++ b/LUFA/Drivers/USB/Class/Host/StillImage.h @@ -311,11 +311,7 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */ - #define STILL_IMAGE_CLASS 0x06 - #define STILL_IMAGE_SUBCLASS 0x01 - #define STILL_IMAGE_PROTOCOL 0x01 - - #define COMMAND_DATA_TIMEOUT_MS 10000 + #define SI_COMMAND_DATA_TIMEOUT_MS 10000 /* Function Prototypes: */ #if defined(__INCLUDE_FROM_STILLIMAGE_HOST_C) diff --git a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h index 2a87619b4b..f4682018d0 100644 --- a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h +++ b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h @@ -203,17 +203,49 @@ /** Enum for the possible standard descriptor types, as given in each descriptor's header. */ enum USB_DescriptorTypes_t { - DTYPE_Device = 0x01, /**< Indicates that the descriptor is a device descriptor. */ - DTYPE_Configuration = 0x02, /**< Indicates that the descriptor is a configuration descriptor. */ - DTYPE_String = 0x03, /**< Indicates that the descriptor is a string descriptor. */ - DTYPE_Interface = 0x04, /**< Indicates that the descriptor is an interface descriptor. */ - DTYPE_Endpoint = 0x05, /**< Indicates that the descriptor is an endpoint descriptor. */ - DTYPE_DeviceQualifier = 0x06, /**< Indicates that the descriptor is a device qualifier descriptor. */ - 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. */ + DTYPE_Device = 0x01, /**< Indicates that the descriptor is a device descriptor. */ + DTYPE_Configuration = 0x02, /**< Indicates that the descriptor is a configuration descriptor. */ + DTYPE_String = 0x03, /**< Indicates that the descriptor is a string descriptor. */ + DTYPE_Interface = 0x04, /**< Indicates that the descriptor is an interface descriptor. */ + DTYPE_Endpoint = 0x05, /**< Indicates that the descriptor is an endpoint descriptor. */ + DTYPE_DeviceQualifier = 0x06, /**< Indicates that the descriptor is a device qualifier descriptor. */ + 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. */ + }; + + /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors. */ + enum USB_Descriptor_ClassSubclassProtocol_t + { + USB_CSCP_NoDeviceClass = 0x00, /**< Descriptor Class value indicating that the device does not belong + * to a particular class at the device level. + */ + USB_CSCP_NoDeviceSubclass = 0x00, /**< Descriptor Subclass value indicating that the device does not belong + * to a particular subclass at the device level. + */ + USB_CSCP_NoDeviceProtocol = 0x00, /**< Descriptor Protocol value indicating that the device does not belong + * to a particular protocol at the device level. + */ + USB_CSCP_VendorSpecificClass = 0xFF, /**< Descriptor Class value indicating that the device/interface belongs + * to a vendor specific class. + */ + USB_CSCP_VendorSpecificSubclass = 0xFF, /**< Descriptor Subclass value indicating that the device/interface belongs + * to a vendor specific subclass. + */ + USB_CSCP_VendorSpecificProtocol = 0xFF, /**< Descriptor Protocol value indicating that the device/interface belongs + * to a vendor specific protocol. + */ + USB_CSCP_IADDeviceClass = 0xEF, /**< Descriptor Class value indicating that the device belongs to the + * Interface Association Descriptor class. + */ + USB_CSCP_IADDeviceSubclass = 0x02, /**< Descriptor Subclass value indicating that the device belongs to the + * Interface Association Descriptor subclass. + */ + USB_CSCP_IADDeviceProtocol = 0x01, /**< Descriptor Protocol value indicating that the device belongs to the + * Interface Association Descriptor protocol. + */ }; /* Type Defines: */ diff --git a/Projects/AVRISP-MKII/Descriptors.c b/Projects/AVRISP-MKII/Descriptors.c index 01a93cb646..6ecc13b136 100644 --- a/Projects/AVRISP-MKII/Descriptors.c +++ b/Projects/AVRISP-MKII/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0xFF, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_VendorSpecificClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,7 +95,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0xFF, + .Class = USB_CSCP_VendorSpecificClass, .SubClass = 0x00, .Protocol = 0x00, diff --git a/Projects/Benito/Descriptors.c b/Projects/Benito/Descriptors.c index f4c68bab73..3c7506e5e3 100644 --- a/Projects/Benito/Descriptors.c +++ b/Projects/Benito/Descriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,9 +95,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -146,9 +146,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c index 5dbb0b0b60..e0467a8359 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c +++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c @@ -61,9 +61,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0xEF, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -109,9 +109,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x08, - .SubClass = 0x06, - .Protocol = 0x50, + .Class = MS_CSCP_MassStorageClass, + .SubClass = MS_CSCP_SCSITransparentSubclass, + .Protocol = MS_CSCP_BulkOnlyTransportProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Projects/LEDNotifier/Descriptors.c b/Projects/LEDNotifier/Descriptors.c index f31f428289..d010b9a5d8 100644 --- a/Projects/LEDNotifier/Descriptors.c +++ b/Projects/LEDNotifier/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -107,9 +107,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -158,9 +158,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Projects/Magstripe/Descriptors.c b/Projects/Magstripe/Descriptors.c index 2a04e5f268..48f3c2bd76 100644 --- a/Projects/Magstripe/Descriptors.c +++ b/Projects/Magstripe/Descriptors.c @@ -81,9 +81,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -129,9 +129,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x01, - .Protocol = 0x01, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_KeyboardBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Projects/RelayBoard/Descriptors.c b/Projects/RelayBoard/Descriptors.c index 2fa95bde81..1a0f2479e2 100644 --- a/Projects/RelayBoard/Descriptors.c +++ b/Projects/RelayBoard/Descriptors.c @@ -48,9 +48,9 @@ USB_Descriptor_Device_t PROGMEM RelayBoard_DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0xFF, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_VendorSpecificClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -96,7 +96,7 @@ RelayBoard_USB_Descriptor_Configuration_t PROGMEM RelayBoard_ConfigurationDescri .TotalEndpoints = 0, - .Class = 0xFF, + .Class = USB_CSCP_VendorSpecificClass, .SubClass = 0x00, .Protocol = 0x00, diff --git a/Projects/TempDataLogger/Descriptors.c b/Projects/TempDataLogger/Descriptors.c index 5dde04c197..4fd8569b55 100644 --- a/Projects/TempDataLogger/Descriptors.c +++ b/Projects/TempDataLogger/Descriptors.c @@ -85,9 +85,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -133,9 +133,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x08, - .SubClass = 0x06, - .Protocol = 0x50, + .Class = MS_CSCP_MassStorageClass, + .SubClass = MS_CSCP_SCSITransparentSubclass, + .Protocol = MS_CSCP_BulkOnlyTransportProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -169,9 +169,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x03, - .SubClass = 0x00, - .Protocol = HID_BOOTP_NonBootProtocol, + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Projects/USBtoSerial/Descriptors.c b/Projects/USBtoSerial/Descriptors.c index 630a5aa0ee..4ce4a601b6 100644 --- a/Projects/USBtoSerial/Descriptors.c +++ b/Projects/USBtoSerial/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -107,9 +107,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -158,9 +158,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Projects/Webserver/Descriptors.c b/Projects/Webserver/Descriptors.c index e925961398..68da6c5c84 100644 --- a/Projects/Webserver/Descriptors.c +++ b/Projects/Webserver/Descriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x00, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -107,9 +107,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x08, - .SubClass = 0x06, - .Protocol = 0x50, + .Class = MS_CSCP_MassStorageClass, + .SubClass = MS_CSCP_SCSITransparentSubclass, + .Protocol = MS_CSCP_BulkOnlyTransportProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, diff --git a/Projects/XPLAINBridge/AVRISPDescriptors.c b/Projects/XPLAINBridge/AVRISPDescriptors.c index 7c4d1a82ab..0a7cd18333 100644 --- a/Projects/XPLAINBridge/AVRISPDescriptors.c +++ b/Projects/XPLAINBridge/AVRISPDescriptors.c @@ -47,9 +47,9 @@ USB_Descriptor_Device_t PROGMEM AVRISP_DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0xFF, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = USB_CSCP_VendorSpecificClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -95,7 +95,7 @@ AVRISP_USB_Descriptor_Configuration_t PROGMEM AVRISP_ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0xFF, + .Class = USB_CSCP_VendorSpecificClass, .SubClass = 0x00, .Protocol = 0x00, diff --git a/Projects/XPLAINBridge/USARTDescriptors.c b/Projects/XPLAINBridge/USARTDescriptors.c index 2b1fc62936..2773ac853b 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.c +++ b/Projects/XPLAINBridge/USARTDescriptors.c @@ -59,9 +59,9 @@ USB_Descriptor_Device_t PROGMEM USART_DeviceDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .USBSpecification = VERSION_BCD(01.10), - .Class = 0x02, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, @@ -107,9 +107,9 @@ USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor = .TotalEndpoints = 1, - .Class = 0x02, - .SubClass = 0x02, - .Protocol = 0x01, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -158,9 +158,9 @@ USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor = .TotalEndpoints = 2, - .Class = 0x0A, - .SubClass = 0x00, - .Protocol = 0x00, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, .InterfaceStrIndex = NO_DESCRIPTOR },