aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-10-25 12:42:55 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-10-25 12:42:55 +0000
commit55538dcef34bc3c0f2ada4767c51d11202ac0678 (patch)
treef047601bd6ab339511e24acb00801de8fdebc19c /Projects
parentb37d77eab32d171ad7b28157a924a4026e2aebd1 (diff)
downloadlufa-55538dcef34bc3c0f2ada4767c51d11202ac0678.tar.gz
lufa-55538dcef34bc3c0f2ada4767c51d11202ac0678.tar.bz2
lufa-55538dcef34bc3c0f2ada4767c51d11202ac0678.zip
Add descriptor class, subclass and protocol constants to the class drivers, modify all demos to use them where possible.
Move out private/internal host class driver constants to the common class driver headers, so that they can be used in the Low Level host mode demos. Ensure all demos, projects and bootloaders use the class driver constants where possible to minimise code repetition.
Diffstat (limited to 'Projects')
-rw-r--r--Projects/AVRISP-MKII/Descriptors.c8
-rw-r--r--Projects/Benito/Descriptors.c18
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/Descriptors.c12
-rw-r--r--Projects/LEDNotifier/Descriptors.c18
-rw-r--r--Projects/Magstripe/Descriptors.c12
-rw-r--r--Projects/RelayBoard/Descriptors.c8
-rw-r--r--Projects/TempDataLogger/Descriptors.c18
-rw-r--r--Projects/USBtoSerial/Descriptors.c18
-rw-r--r--Projects/Webserver/Descriptors.c12
-rw-r--r--Projects/XPLAINBridge/AVRISPDescriptors.c8
-rw-r--r--Projects/XPLAINBridge/USARTDescriptors.c18
11 files changed, 75 insertions, 75 deletions
diff --git a/Projects/AVRISP-MKII/Descriptors.c b/Projects/AVRISP-MKII/Descriptors.c
index 01a93cb64..6ecc13b13 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 f4c68bab7..3c7506e5e 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 5dbb0b0b6..e0467a835 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 f31f42828..d010b9a5d 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 2a04e5f26..48f3c2bd7 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 2fa95bde8..1a0f2479e 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 5dde04c19..4fd8569b5 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 630a5aa0e..4ce4a601b 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 e92596139..68da6c5c8 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 7c4d1a82a..0a7cd1833 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 2b1fc6293..2773ac853 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
},