.VendorID = 0x03EB,
.ProductID = 0x204B,
- .ReleaseNumber = 0x0000,
+ .ReleaseNumber = VERSION_BCD(00.01),
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
.InterfaceStrIndex = NO_DESCRIPTOR
},
- .CDC_Functional_IntHeader =
+ .CDC_Functional_Header =
{
- .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
- .SubType = 0x00,
+ .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+ .Subtype = CDC_DSUBTYPE_CSInterface_Header,
- .Data = {0x01, 0x10}
+ .CDCSpecification = VERSION_BCD(01.10),
},
- .CDC_Functional_AbstractControlManagement =
+ .CDC_Functional_ACM =
{
- .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
- .SubType = 0x02,
+ .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+ .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
- .Data = {0x06}
+ .Capabilities = 0x06,
},
- .CDC_Functional_Union=
+ .CDC_Functional_Union =
{
- .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
- .SubType = 0x06,
+ .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+ .Subtype = CDC_DSUBTYPE_CSInterface_Union,
- .Data = {0x00, 0x01}
+ .MasterInterfaceNumber = 0,
+ .SlaveInterfaceNumber = 1,
},
.CDC_NotificationEndpoint =
/** Descriptor retrieval function for the USART Bridge descriptors. This function is in turn called by the GetDescriptor
* callback function in the main source file, to retrieve the device's descriptors when in USART bridge mode.
*/
-uint16_t USART_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+uint16_t USART_GetDescriptor(const uint16_t wValue,
+ const uint8_t wIndex,
+ const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
const uint8_t DescriptorNumber = (wValue & 0xFF);
- void* Address = NULL;
- uint16_t Size = NO_DESCRIPTOR;
+ const void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
switch (DescriptorType)
{
case DTYPE_Device:
- Address = (void*)&USART_DeviceDescriptor;
+ Address = &USART_DeviceDescriptor;
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
- Address = (void*)&USART_ConfigurationDescriptor;
+ Address = &USART_ConfigurationDescriptor;
Size = sizeof(USART_USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
- Address = (void*)&USART_LanguageString;
+ Address = &USART_LanguageString;
Size = pgm_read_byte(&USART_LanguageString.Header.Size);
break;
case 0x01:
- Address = (void*)&USART_ManufacturerString;
+ Address = &USART_ManufacturerString;
Size = pgm_read_byte(&USART_ManufacturerString.Header.Size);
break;
case 0x02:
- Address = (void*)&USART_ProductString;
+ Address = &USART_ProductString;
Size = pgm_read_byte(&USART_ProductString.Header.Size);
break;
}