X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/6bda628718f67c04ed43e8328f55bdce5319c504..3a03da970558de9211fc1a43b12bf69e38854d09:/Projects/XPLAINBridge/USARTDescriptors.c diff --git a/Projects/XPLAINBridge/USARTDescriptors.c b/Projects/XPLAINBridge/USARTDescriptors.c index 9871305b0..266c8f3c2 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.c +++ b/Projects/XPLAINBridge/USARTDescriptors.c @@ -67,7 +67,7 @@ USB_Descriptor_Device_t PROGMEM USART_DeviceDescriptor = .VendorID = 0x03EB, .ProductID = 0x204B, - .ReleaseNumber = 0x0000, + .ReleaseNumber = VERSION_BCD(00.01), .ManufacturerStrIndex = 0x01, .ProductStrIndex = 0x02, @@ -114,28 +114,29 @@ USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor = .InterfaceStrIndex = NO_DESCRIPTOR }, - .CDC_Functional_IntHeader = + .CDC_Functional_Header = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x00, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Header, - .Data = {0x01, 0x10} + .CDCSpecification = VERSION_BCD(01.10), }, - .CDC_Functional_AbstractControlManagement = + .CDC_Functional_ACM = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24}, - .SubType = 0x02, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Data = {0x06} + .Capabilities = 0x06, }, .CDC_Functional_Union = { - .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, - .SubType = 0x06, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .Data = {0x00, 0x01} + .MasterInterfaceNumber = 0, + .SlaveInterfaceNumber = 1, }, .CDC_NotificationEndpoint = @@ -223,37 +224,37 @@ USB_Descriptor_String_t PROGMEM USART_ProductString = */ uint16_t USART_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, - void** const DescriptorAddress) + 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; }