mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 12:51:47 +00:00
Changed over all deprecated GCC structure tag initializers to the standardized C99 format (thanks to Mike Alexander).
This commit is contained in:
parent
619b0b7b6b
commit
37b2130fb2
@ -43,10 +43,10 @@
|
|||||||
* current encoding options, including baud rate, character format, parity mode and total number of
|
* current encoding options, including baud rate, character format, parity mode and total number of
|
||||||
* bits in each data chunk.
|
* bits in each data chunk.
|
||||||
*/
|
*/
|
||||||
CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
|
CDC_Line_Coding_t LineCoding = { .BaudRateBPS = 9600,
|
||||||
CharFormat: OneStopBit,
|
.CharFormat = OneStopBit,
|
||||||
ParityType: Parity_None,
|
.ParityType = Parity_None,
|
||||||
DataBits: 8 };
|
.DataBits = 8 };
|
||||||
|
|
||||||
/** Current address counter. This stores the current address of the FLASH or EEPROM as set by the host,
|
/** Current address counter. This stores the current address of the FLASH or EEPROM as set by the host,
|
||||||
* and is used when reading or writing to the AVRs memory (either FLASH or EEPROM depending on the issued
|
* and is used when reading or writing to the AVRs memory (either FLASH or EEPROM depending on the issued
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t DeviceDescriptor =
|
USB_Descriptor_Device_t DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: FIXED_CONTROL_ENDPOINT_SIZE,
|
.Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x204A,
|
.ProductID = 0x204A,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: NO_DESCRIPTOR,
|
.ManufacturerStrIndex = NO_DESCRIPTOR,
|
||||||
ProductStrIndex: 0x01,
|
.ProductStrIndex = 0x01,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in SRAM memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in SRAM memory, describes the usage
|
||||||
@ -71,113 +71,113 @@ USB_Descriptor_Device_t DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
CCI_Interface:
|
.CCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_IntHeader:
|
.CDC_Functional_IntHeader =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x00,
|
.SubType = 0x00,
|
||||||
|
|
||||||
Data: {0x10, 0x01}
|
.Data = {0x10, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_CallManagement:
|
.CDC_Functional_CallManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x01,
|
.SubType = 0x01,
|
||||||
|
|
||||||
Data: {0x03, 0x01}
|
.Data = {0x03, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_AbstractControlManagement:
|
.CDC_Functional_AbstractControlManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
|
||||||
SubType: 0x02,
|
.SubType = 0x02,
|
||||||
|
|
||||||
Data: {0x06}
|
.Data = {0x06}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_Union:
|
.CDC_Functional_Union =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x06,
|
.SubType = 0x06,
|
||||||
|
|
||||||
Data: {0x00, 0x01}
|
.Data = {0x00, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
ManagementEndpoint:
|
.ManagementEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: CDC_NOTIFICATION_EPSIZE,
|
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
},
|
},
|
||||||
|
|
||||||
DCI_Interface:
|
.DCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x0A,
|
.Class = 0x0A,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
DataOutEndpoint:
|
.DataOutEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
},
|
},
|
||||||
|
|
||||||
DataInEndpoint:
|
.DataInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,9 +187,9 @@ USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t LanguageString =
|
USB_Descriptor_String_t LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -198,9 +198,9 @@ USB_Descriptor_String_t LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t ProductString =
|
USB_Descriptor_String_t ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(15), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(15), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"AVR CDC Bootloader"
|
.UnicodeString = L"AVR CDC Bootloader"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -225,7 +225,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
|
|||||||
{
|
{
|
||||||
uint16_t Words[2];
|
uint16_t Words[2];
|
||||||
uint32_t Long;
|
uint32_t Long;
|
||||||
} CurrFlashAddress = {Words: {StartAddr, Flash64KBPage}};
|
} CurrFlashAddress = {.Words = {StartAddr, Flash64KBPage}};
|
||||||
|
|
||||||
uint32_t CurrFlashPageStartAddress = CurrFlashAddress.Long;
|
uint32_t CurrFlashPageStartAddress = CurrFlashAddress.Long;
|
||||||
uint8_t WordsInFlashPage = 0;
|
uint8_t WordsInFlashPage = 0;
|
||||||
@ -336,7 +336,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
|
|||||||
{
|
{
|
||||||
uint16_t Words[2];
|
uint16_t Words[2];
|
||||||
uint32_t Long;
|
uint32_t Long;
|
||||||
} CurrFlashAddress = {Words: {StartAddr, Flash64KBPage}};
|
} CurrFlashAddress = {.Words = {StartAddr, Flash64KBPage}};
|
||||||
|
|
||||||
while (WordsRemaining--)
|
while (WordsRemaining--)
|
||||||
{
|
{
|
||||||
@ -531,8 +531,8 @@ static void LoadStartEndAddresses(void)
|
|||||||
{
|
{
|
||||||
uint8_t Bytes[2];
|
uint8_t Bytes[2];
|
||||||
uint16_t Word;
|
uint16_t Word;
|
||||||
} Address[2] = {{Bytes: {SentCommand.Data[2], SentCommand.Data[1]}},
|
} Address[2] = {{.Bytes = {SentCommand.Data[2], SentCommand.Data[1]}},
|
||||||
{Bytes: {SentCommand.Data[4], SentCommand.Data[3]}}};
|
{.Bytes = {SentCommand.Data[4], SentCommand.Data[3]}}};
|
||||||
|
|
||||||
/* Load in the start and ending read addresses from the sent data packet */
|
/* Load in the start and ending read addresses from the sent data packet */
|
||||||
StartAddr = Address[0].Word;
|
StartAddr = Address[0].Word;
|
||||||
@ -557,7 +557,7 @@ static void ProcessMemProgCommand(void)
|
|||||||
{
|
{
|
||||||
uint16_t Words[2];
|
uint16_t Words[2];
|
||||||
uint32_t Long;
|
uint32_t Long;
|
||||||
} CurrFlashAddress = {Words: {StartAddr, Flash64KBPage}};
|
} CurrFlashAddress = {.Words = {StartAddr, Flash64KBPage}};
|
||||||
|
|
||||||
/* Erase the current page's temp buffer */
|
/* Erase the current page's temp buffer */
|
||||||
boot_page_erase(CurrFlashAddress.Long);
|
boot_page_erase(CurrFlashAddress.Long);
|
||||||
@ -639,7 +639,7 @@ static void ProcessWriteCommand(void)
|
|||||||
{
|
{
|
||||||
uint8_t Bytes[2];
|
uint8_t Bytes[2];
|
||||||
AppPtr_t FuncPtr;
|
AppPtr_t FuncPtr;
|
||||||
} Address = {Bytes: {SentCommand.Data[4], SentCommand.Data[3]}};
|
} Address = {.Bytes = {SentCommand.Data[4], SentCommand.Data[3]}};
|
||||||
|
|
||||||
AppStartPtr = Address.FuncPtr;
|
AppStartPtr = Address.FuncPtr;
|
||||||
|
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t DeviceDescriptor =
|
USB_Descriptor_Device_t DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: FIXED_CONTROL_ENDPOINT_SIZE,
|
.Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: PRODUCT_ID_CODE,
|
.ProductID = PRODUCT_ID_CODE,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: NO_DESCRIPTOR,
|
.ManufacturerStrIndex = NO_DESCRIPTOR,
|
||||||
ProductStrIndex: 0x01,
|
.ProductStrIndex = 0x01,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,47 +71,47 @@ USB_Descriptor_Device_t DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
DFUInterface:
|
.DFUInterface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 0,
|
.TotalEndpoints = 0,
|
||||||
|
|
||||||
Class: 0xFE,
|
.Class = 0xFE,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x02,
|
.Protocol = 0x02,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
DFUFunctional:
|
.DFUFunctional =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_DFU_Functional_Descriptor_t), Type: DTYPE_DFUFunctional},
|
.Header = {.Size = sizeof(USB_DFU_Functional_Descriptor_t), .Type = DTYPE_DFUFunctional},
|
||||||
|
|
||||||
Attributes: (ATTR_CAN_UPLOAD | ATTR_CAN_DOWNLOAD),
|
.Attributes = (ATTR_CAN_UPLOAD | ATTR_CAN_DOWNLOAD),
|
||||||
|
|
||||||
DetatchTimeout: 0x0000,
|
.DetatchTimeout = 0x0000,
|
||||||
TransferSize: 0x0c00,
|
.TransferSize = 0x0c00,
|
||||||
|
|
||||||
DFUSpecification: VERSION_BCD(01.01)
|
.DFUSpecification = VERSION_BCD(01.01)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -121,9 +121,9 @@ USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t LanguageString =
|
USB_Descriptor_String_t LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -132,9 +132,9 @@ USB_Descriptor_String_t LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t ProductString =
|
USB_Descriptor_String_t ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"AVR DFU Bootloader"
|
.UnicodeString = L"AVR DFU Bootloader"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -64,24 +64,24 @@ USB_Descriptor_HIDReport_Datatype_t HIDReport[] =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t DeviceDescriptor =
|
USB_Descriptor_Device_t DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x16C0,
|
.VendorID = 0x16C0,
|
||||||
ProductID: 0x0478,
|
.ProductID = 0x0478,
|
||||||
ReleaseNumber: 0x0010,
|
.ReleaseNumber = 0x0010,
|
||||||
|
|
||||||
ManufacturerStrIndex: NO_DESCRIPTOR,
|
.ManufacturerStrIndex = NO_DESCRIPTOR,
|
||||||
ProductStrIndex: 0x01,
|
.ProductStrIndex = 0x01,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -91,56 +91,56 @@ USB_Descriptor_Device_t DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
Interface:
|
.Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0x00,
|
.InterfaceNumber = 0x00,
|
||||||
AlternateSetting: 0x00,
|
.AlternateSetting = 0x00,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x03,
|
.Class = 0x03,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
HIDDescriptor:
|
.HIDDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
|
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
|
||||||
|
|
||||||
HIDSpec: VERSION_BCD(01.11),
|
.HIDSpec = VERSION_BCD(01.11),
|
||||||
CountryCode: 0x00,
|
.CountryCode = 0x00,
|
||||||
TotalHIDReports: 0x01,
|
.TotalHIDReports = 0x01,
|
||||||
HIDReportType: DTYPE_Report,
|
.HIDReportType = DTYPE_Report,
|
||||||
HIDReportLength: sizeof(HIDReport)
|
.HIDReportLength = sizeof(HIDReport)
|
||||||
},
|
},
|
||||||
|
|
||||||
HIDEndpoint:
|
.HIDEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | HID_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | HID_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: HID_EPSIZE,
|
.EndpointSize = HID_EPSIZE,
|
||||||
PollingIntervalMS: 0x40
|
.PollingIntervalMS = 0x40
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -150,9 +150,9 @@ USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t LanguageString =
|
USB_Descriptor_String_t LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -161,9 +161,9 @@ USB_Descriptor_String_t LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t ProductString =
|
USB_Descriptor_String_t ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(21), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(21), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"AVR Teensy Bootloader"
|
.UnicodeString = L"AVR Teensy Bootloader"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Audio_Task , TaskStatus: TASK_STOP },
|
{ .Task = USB_Audio_Task , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(02.00),
|
.USBSpecification = VERSION_BCD(02.00),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2047,
|
.ProductID = 0x2047,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,164 +71,164 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioControlInterface:
|
.AudioControlInterface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 0,
|
.TotalEndpoints = 0,
|
||||||
|
|
||||||
Class: 0x01,
|
.Class = 0x01,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioControlInterface_SPC:
|
.AudioControlInterface_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_Header,
|
.Subtype = DSUBTYPE_Header,
|
||||||
|
|
||||||
ACSpecification: VERSION_BCD(01.00),
|
.ACSpecification = VERSION_BCD(01.00),
|
||||||
TotalLength: (sizeof(USB_AudioInterface_AC_t) +
|
.TotalLength = (sizeof(USB_AudioInterface_AC_t) +
|
||||||
sizeof(USB_AudioInputTerminal_t) +
|
sizeof(USB_AudioInputTerminal_t) +
|
||||||
sizeof(USB_AudioOutputTerminal_t)),
|
sizeof(USB_AudioOutputTerminal_t)),
|
||||||
|
|
||||||
InCollection: 1,
|
.InCollection = 1,
|
||||||
InterfaceNumbers: {1},
|
.InterfaceNumbers = {1},
|
||||||
},
|
},
|
||||||
|
|
||||||
InputTerminal:
|
.InputTerminal =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioInputTerminal_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_InputTerminal,
|
.Subtype = DSUBTYPE_InputTerminal,
|
||||||
|
|
||||||
TerminalID: 0x01,
|
.TerminalID = 0x01,
|
||||||
TerminalType: TERMINAL_IN_MIC,
|
.TerminalType = TERMINAL_IN_MIC,
|
||||||
AssociatedOutputTerminal: 0x00,
|
.AssociatedOutputTerminal = 0x00,
|
||||||
|
|
||||||
TotalChannels: 1,
|
.TotalChannels = 1,
|
||||||
ChannelConfig: 0,
|
.ChannelConfig = 0,
|
||||||
|
|
||||||
ChannelStrIndex: NO_DESCRIPTOR,
|
.ChannelStrIndex = NO_DESCRIPTOR,
|
||||||
TerminalStrIndex: NO_DESCRIPTOR
|
.TerminalStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
OutputTerminal:
|
.OutputTerminal =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioOutputTerminal_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_OutputTerminal,
|
.Subtype = DSUBTYPE_OutputTerminal,
|
||||||
|
|
||||||
TerminalID: 0x02,
|
.TerminalID = 0x02,
|
||||||
TerminalType: TERMINAL_STREAMING,
|
.TerminalType = TERMINAL_STREAMING,
|
||||||
AssociatedInputTerminal: 0x00,
|
.AssociatedInputTerminal = 0x00,
|
||||||
|
|
||||||
SourceID: 0x01,
|
.SourceID = 0x01,
|
||||||
|
|
||||||
TerminalStrIndex: NO_DESCRIPTOR
|
.TerminalStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioStreamInterface_Alt0:
|
.AudioStreamInterface_Alt0 =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 0,
|
.TotalEndpoints = 0,
|
||||||
|
|
||||||
Class: 0x01,
|
.Class = 0x01,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioStreamInterface_Alt1:
|
.AudioStreamInterface_Alt1 =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 1,
|
.AlternateSetting = 1,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x01,
|
.Class = 0x01,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioStreamInterface_SPC:
|
.AudioStreamInterface_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioInterface_AS_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_General,
|
.Subtype = DSUBTYPE_General,
|
||||||
|
|
||||||
TerminalLink: 0x02,
|
.TerminalLink = 0x02,
|
||||||
|
|
||||||
FrameDelay: 1,
|
.FrameDelay = 1,
|
||||||
AudioFormat: 0x0001
|
.AudioFormat = 0x0001
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioFormat:
|
.AudioFormat =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioFormat_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_Format,
|
.Subtype = DSUBTYPE_Format,
|
||||||
|
|
||||||
FormatType: 0x01,
|
.FormatType = 0x01,
|
||||||
Channels: 0x01,
|
.Channels = 0x01,
|
||||||
|
|
||||||
SubFrameSize: 0x02,
|
.SubFrameSize = 0x02,
|
||||||
BitResolution: 16,
|
.BitResolution = 16,
|
||||||
SampleFrequencyType: (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
|
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
|
||||||
|
|
||||||
SampleFrequencies: {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
|
.SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioEndpoint:
|
.AudioEndpoint =
|
||||||
{
|
{
|
||||||
Endpoint:
|
.Endpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AUDIO_STREAM_EPNUM),
|
||||||
Attributes: (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
|
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
|
||||||
EndpointSize: AUDIO_STREAM_EPSIZE,
|
.EndpointSize = AUDIO_STREAM_EPSIZE,
|
||||||
PollingIntervalMS: 1
|
.PollingIntervalMS = 1
|
||||||
},
|
},
|
||||||
|
|
||||||
Refresh: 0,
|
.Refresh = 0,
|
||||||
SyncEndpointNumber: 0
|
.SyncEndpointNumber = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioEndpoint_SPC:
|
.AudioEndpoint_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioStreamEndpoint_Spc_t), Type: DTYPE_AudioEndpoint},
|
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
|
||||||
Subtype: DSUBTYPE_General,
|
.Subtype = DSUBTYPE_General,
|
||||||
|
|
||||||
Attributes: 0x00,
|
.Attributes = 0x00,
|
||||||
|
|
||||||
LockDelayUnits: 0x00,
|
.LockDelayUnits = 0x00,
|
||||||
LockDelay: 0x0000
|
.LockDelay = 0x0000
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -238,9 +238,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -249,9 +249,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -260,9 +260,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Audio In Demo"
|
.UnicodeString = L"LUFA Audio In Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Audio_Task , TaskStatus: TASK_STOP },
|
{ .Task = USB_Audio_Task , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(02.00),
|
.USBSpecification = VERSION_BCD(02.00),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2046,
|
.ProductID = 0x2046,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,164 +71,164 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioControlInterface:
|
.AudioControlInterface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 0,
|
.TotalEndpoints = 0,
|
||||||
|
|
||||||
Class: 0x01,
|
.Class = 0x01,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioControlInterface_SPC:
|
.AudioControlInterface_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_Header,
|
.Subtype = DSUBTYPE_Header,
|
||||||
|
|
||||||
ACSpecification: VERSION_BCD(01.00),
|
.ACSpecification = VERSION_BCD(01.00),
|
||||||
TotalLength: (sizeof(USB_AudioInterface_AC_t) +
|
.TotalLength = (sizeof(USB_AudioInterface_AC_t) +
|
||||||
sizeof(USB_AudioInputTerminal_t) +
|
sizeof(USB_AudioInputTerminal_t) +
|
||||||
sizeof(USB_AudioOutputTerminal_t)),
|
sizeof(USB_AudioOutputTerminal_t)),
|
||||||
|
|
||||||
InCollection: 1,
|
.InCollection = 1,
|
||||||
InterfaceNumbers: {1},
|
.InterfaceNumbers = {1},
|
||||||
},
|
},
|
||||||
|
|
||||||
InputTerminal:
|
.InputTerminal =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioInputTerminal_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioInputTerminal_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_InputTerminal,
|
.Subtype = DSUBTYPE_InputTerminal,
|
||||||
|
|
||||||
TerminalID: 0x01,
|
.TerminalID = 0x01,
|
||||||
TerminalType: TERMINAL_STREAMING,
|
.TerminalType = TERMINAL_STREAMING,
|
||||||
AssociatedOutputTerminal: 0x00,
|
.AssociatedOutputTerminal = 0x00,
|
||||||
|
|
||||||
TotalChannels: 2,
|
.TotalChannels = 2,
|
||||||
ChannelConfig: (CHANNEL_LEFT_FRONT | CHANNEL_RIGHT_FRONT),
|
.ChannelConfig = (CHANNEL_LEFT_FRONT | CHANNEL_RIGHT_FRONT),
|
||||||
|
|
||||||
ChannelStrIndex: NO_DESCRIPTOR,
|
.ChannelStrIndex = NO_DESCRIPTOR,
|
||||||
TerminalStrIndex: NO_DESCRIPTOR
|
.TerminalStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
OutputTerminal:
|
.OutputTerminal =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioOutputTerminal_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioOutputTerminal_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_OutputTerminal,
|
.Subtype = DSUBTYPE_OutputTerminal,
|
||||||
|
|
||||||
TerminalID: 0x02,
|
.TerminalID = 0x02,
|
||||||
TerminalType: TERMINAL_OUT_SPEAKER,
|
.TerminalType = TERMINAL_OUT_SPEAKER,
|
||||||
AssociatedInputTerminal: 0x00,
|
.AssociatedInputTerminal = 0x00,
|
||||||
|
|
||||||
SourceID: 0x01,
|
.SourceID = 0x01,
|
||||||
|
|
||||||
TerminalStrIndex: NO_DESCRIPTOR
|
.TerminalStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioStreamInterface_Alt0:
|
.AudioStreamInterface_Alt0 =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 0,
|
.TotalEndpoints = 0,
|
||||||
|
|
||||||
Class: 0x01,
|
.Class = 0x01,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioStreamInterface_Alt1:
|
.AudioStreamInterface_Alt1 =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 1,
|
.AlternateSetting = 1,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x01,
|
.Class = 0x01,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioStreamInterface_SPC:
|
.AudioStreamInterface_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioInterface_AS_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioInterface_AS_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_General,
|
.Subtype = DSUBTYPE_General,
|
||||||
|
|
||||||
TerminalLink: 0x01,
|
.TerminalLink = 0x01,
|
||||||
|
|
||||||
FrameDelay: 1,
|
.FrameDelay = 1,
|
||||||
AudioFormat: 0x0001
|
.AudioFormat = 0x0001
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioFormat:
|
.AudioFormat =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioFormat_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioFormat_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_Format,
|
.Subtype = DSUBTYPE_Format,
|
||||||
|
|
||||||
FormatType: 0x01,
|
.FormatType = 0x01,
|
||||||
Channels: 0x02,
|
.Channels = 0x02,
|
||||||
|
|
||||||
SubFrameSize: 0x02,
|
.SubFrameSize = 0x02,
|
||||||
BitResolution: 16,
|
.BitResolution = 16,
|
||||||
|
|
||||||
SampleFrequencyType: (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
|
.SampleFrequencyType = (sizeof(ConfigurationDescriptor.AudioFormat.SampleFrequencies) / sizeof(AudioSampleFreq_t)),
|
||||||
SampleFrequencies: {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
|
.SampleFrequencies = {SAMPLE_FREQ(AUDIO_SAMPLE_FREQUENCY)}
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioEndpoint:
|
.AudioEndpoint =
|
||||||
{
|
{
|
||||||
Endpoint:
|
.Endpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AUDIO_STREAM_EPNUM),
|
||||||
Attributes: (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
|
.Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA),
|
||||||
EndpointSize: AUDIO_STREAM_EPSIZE,
|
.EndpointSize = AUDIO_STREAM_EPSIZE,
|
||||||
PollingIntervalMS: 1
|
.PollingIntervalMS = 1
|
||||||
},
|
},
|
||||||
|
|
||||||
Refresh: 0,
|
.Refresh = 0,
|
||||||
SyncEndpointNumber: 0
|
.SyncEndpointNumber = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioEndpoint_SPC:
|
.AudioEndpoint_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioStreamEndpoint_Spc_t), Type: DTYPE_AudioEndpoint},
|
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
|
||||||
Subtype: DSUBTYPE_General,
|
.Subtype = DSUBTYPE_General,
|
||||||
|
|
||||||
Attributes: EP_ACCEPTS_SMALL_PACKETS,
|
.Attributes = EP_ACCEPTS_SMALL_PACKETS,
|
||||||
|
|
||||||
LockDelayUnits: 0x00,
|
.LockDelayUnits = 0x00,
|
||||||
LockDelay: 0x0000
|
.LockDelay = 0x0000
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -238,9 +238,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -249,9 +249,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -260,9 +260,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Audio Out Demo"
|
.UnicodeString = L"LUFA Audio Out Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: CDC_Task , TaskStatus: TASK_STOP },
|
{ .Task = CDC_Task , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Globals: */
|
/* Globals: */
|
||||||
@ -52,10 +52,10 @@ TASK_LIST
|
|||||||
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
|
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
|
||||||
* serial link characteristics and instead sends and receives data in endpoint streams.
|
* serial link characteristics and instead sends and receives data in endpoint streams.
|
||||||
*/
|
*/
|
||||||
CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
|
CDC_Line_Coding_t LineCoding = { .BaudRateBPS = 9600,
|
||||||
CharFormat: OneStopBit,
|
.CharFormat = OneStopBit,
|
||||||
ParityType: Parity_None,
|
.ParityType = Parity_None,
|
||||||
DataBits: 8 };
|
.DataBits = 8 };
|
||||||
|
|
||||||
/** String to print through the virtual serial port when the joystick is pressed upwards. */
|
/** String to print through the virtual serial port when the joystick is pressed upwards. */
|
||||||
char JoystickUpString[] = "Joystick Up\r\n";
|
char JoystickUpString[] = "Joystick Up\r\n";
|
||||||
@ -256,11 +256,11 @@ TASK(CDC_Task)
|
|||||||
*/
|
*/
|
||||||
USB_Notification_Header_t Notification = (USB_Notification_Header_t)
|
USB_Notification_Header_t Notification = (USB_Notification_Header_t)
|
||||||
{
|
{
|
||||||
NotificationType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
|
.NotificationType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
|
||||||
Notification: NOTIF_SerialState,
|
.Notification = NOTIF_SerialState,
|
||||||
wValue: 0,
|
.wValue = 0,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: sizeof(uint16_t),
|
.wLength = sizeof(uint16_t),
|
||||||
};
|
};
|
||||||
|
|
||||||
uint16_t LineStateMask;
|
uint16_t LineStateMask;
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2044,
|
.ProductID = 0x2044,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,113 +71,113 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
CCI_Interface:
|
.CCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_IntHeader:
|
.CDC_Functional_IntHeader =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x00,
|
.SubType = 0x00,
|
||||||
|
|
||||||
Data: {0x01, 0x10}
|
.Data = {0x01, 0x10}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_CallManagement:
|
.CDC_Functional_CallManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x01,
|
.SubType = 0x01,
|
||||||
|
|
||||||
Data: {0x03, 0x01}
|
.Data = {0x03, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_AbstractControlManagement:
|
.CDC_Functional_AbstractControlManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
|
||||||
SubType: 0x02,
|
.SubType = 0x02,
|
||||||
|
|
||||||
Data: {0x06}
|
.Data = {0x06}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_Union:
|
.CDC_Functional_Union =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x06,
|
.SubType = 0x06,
|
||||||
|
|
||||||
Data: {0x00, 0x01}
|
.Data = {0x00, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
ManagementEndpoint:
|
.ManagementEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: CDC_NOTIFICATION_EPSIZE,
|
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
|
||||||
PollingIntervalMS: 0xFF
|
.PollingIntervalMS = 0xFF
|
||||||
},
|
},
|
||||||
|
|
||||||
DCI_Interface:
|
.DCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x0A,
|
.Class = 0x0A,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
DataOutEndpoint:
|
.DataOutEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
},
|
},
|
||||||
|
|
||||||
DataInEndpoint:
|
.DataInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,9 +187,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -198,9 +198,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -209,9 +209,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(13), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA CDC Demo"
|
.UnicodeString = L"LUFA CDC Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0xEF,
|
.Class = 0xEF,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x204E,
|
.ProductID = 0x204E,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,235 +71,235 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 4,
|
.TotalInterfaces = 4,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
IAD1:
|
.IAD1 =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_Association_t), Type: DTYPE_InterfaceAssociation},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation},
|
||||||
|
|
||||||
FirstInterfaceIndex: 0,
|
.FirstInterfaceIndex = 0,
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
IADStrIndex: NO_DESCRIPTOR
|
.IADStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_CCI_Interface:
|
.CDC1_CCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_Functional_IntHeader:
|
.CDC1_Functional_IntHeader =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x00,
|
.SubType = 0x00,
|
||||||
|
|
||||||
Data: {0x01, 0x10}
|
.Data = {0x01, 0x10}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_Functional_CallManagement:
|
.CDC1_Functional_CallManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x01,
|
.SubType = 0x01,
|
||||||
|
|
||||||
Data: {0x03, 0x01}
|
.Data = {0x03, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_Functional_AbstractControlManagement:
|
.CDC1_Functional_AbstractControlManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
|
||||||
SubType: 0x02,
|
.SubType = 0x02,
|
||||||
|
|
||||||
Data: {0x06}
|
.Data = {0x06}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_Functional_Union:
|
.CDC1_Functional_Union =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x06,
|
.SubType = 0x06,
|
||||||
|
|
||||||
Data: {0x00, 0x01}
|
.Data = {0x00, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_ManagementEndpoint:
|
.CDC1_ManagementEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_NOTIFICATION_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_NOTIFICATION_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: CDC_NOTIFICATION_EPSIZE,
|
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
|
||||||
PollingIntervalMS: 0xFF
|
.PollingIntervalMS = 0xFF
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_DCI_Interface:
|
.CDC1_DCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x0A,
|
.Class = 0x0A,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_DataOutEndpoint:
|
.CDC1_DataOutEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC1_RX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC1_RX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC1_DataInEndpoint:
|
.CDC1_DataInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_TX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_TX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
},
|
},
|
||||||
|
|
||||||
IAD2:
|
.IAD2 =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_Association_t), Type: DTYPE_InterfaceAssociation},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation},
|
||||||
|
|
||||||
FirstInterfaceIndex: 2,
|
.FirstInterfaceIndex = 2,
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
IADStrIndex: NO_DESCRIPTOR
|
.IADStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_CCI_Interface:
|
.CDC2_CCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 2,
|
.InterfaceNumber = 2,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_Functional_IntHeader:
|
.CDC2_Functional_IntHeader =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x00,
|
.SubType = 0x00,
|
||||||
|
|
||||||
Data: {0x01, 0x10}
|
.Data = {0x01, 0x10}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_Functional_CallManagement:
|
.CDC2_Functional_CallManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x01,
|
.SubType = 0x01,
|
||||||
|
|
||||||
Data: {0x03, 0x03}
|
.Data = {0x03, 0x03}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_Functional_AbstractControlManagement:
|
.CDC2_Functional_AbstractControlManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
|
||||||
SubType: 0x02,
|
.SubType = 0x02,
|
||||||
|
|
||||||
Data: {0x06}
|
.Data = {0x06}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_Functional_Union:
|
.CDC2_Functional_Union =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x06,
|
.SubType = 0x06,
|
||||||
|
|
||||||
Data: {0x02, 0x03}
|
.Data = {0x02, 0x03}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_ManagementEndpoint:
|
.CDC2_ManagementEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_NOTIFICATION_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_NOTIFICATION_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: CDC_NOTIFICATION_EPSIZE,
|
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
|
||||||
PollingIntervalMS: 0xFF
|
.PollingIntervalMS = 0xFF
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_DCI_Interface:
|
.CDC2_DCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 3,
|
.InterfaceNumber = 3,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x0A,
|
.Class = 0x0A,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_DataOutEndpoint:
|
.CDC2_DataOutEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC2_RX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC2_RX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC2_DataInEndpoint:
|
.CDC2_DataInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_TX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_TX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -309,9 +309,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -320,9 +320,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -331,9 +331,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(13), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Dual CDC Demo"
|
.UnicodeString = L"LUFA Dual CDC Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -39,9 +39,9 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: CDC1_Task , TaskStatus: TASK_STOP },
|
{ .Task = CDC1_Task , .TaskStatus = TASK_STOP },
|
||||||
{ Task: CDC2_Task , TaskStatus: TASK_STOP },
|
{ .Task = CDC2_Task , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Globals: */
|
/* Globals: */
|
||||||
@ -53,10 +53,10 @@ TASK_LIST
|
|||||||
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
|
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
|
||||||
* serial link characteristics and instead sends and receives data in endpoint streams.
|
* serial link characteristics and instead sends and receives data in endpoint streams.
|
||||||
*/
|
*/
|
||||||
CDC_Line_Coding_t LineCoding1 = { BaudRateBPS: 9600,
|
CDC_Line_Coding_t LineCoding1 = { .BaudRateBPS = 9600,
|
||||||
CharFormat: OneStopBit,
|
.CharFormat = OneStopBit,
|
||||||
ParityType: Parity_None,
|
.ParityType = Parity_None,
|
||||||
DataBits: 8 };
|
.DataBits = 8 };
|
||||||
|
|
||||||
/** Contains the current baud rate and other settings of the second virtual serial port. While this demo does not use
|
/** Contains the current baud rate and other settings of the second virtual serial port. While this demo does not use
|
||||||
* the physical USART and thus does not use these settings, they must still be retained and returned to the host
|
* the physical USART and thus does not use these settings, they must still be retained and returned to the host
|
||||||
@ -66,10 +66,10 @@ CDC_Line_Coding_t LineCoding1 = { BaudRateBPS: 9600,
|
|||||||
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
|
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical
|
||||||
* serial link characteristics and instead sends and receives data in endpoint streams.
|
* serial link characteristics and instead sends and receives data in endpoint streams.
|
||||||
*/
|
*/
|
||||||
CDC_Line_Coding_t LineCoding2 = { BaudRateBPS: 9600,
|
CDC_Line_Coding_t LineCoding2 = { .BaudRateBPS = 9600,
|
||||||
CharFormat: OneStopBit,
|
.CharFormat = OneStopBit,
|
||||||
ParityType: Parity_None,
|
.ParityType = Parity_None,
|
||||||
DataBits: 8 };
|
.DataBits = 8 };
|
||||||
|
|
||||||
/** String to print through the first virtual serial port when the joystick is pressed upwards. */
|
/** String to print through the first virtual serial port when the joystick is pressed upwards. */
|
||||||
char JoystickUpString[] = "Joystick Up\r\n";
|
char JoystickUpString[] = "Joystick Up\r\n";
|
||||||
|
@ -70,24 +70,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM GenericReport[] =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x204F,
|
.ProductID = 0x204F,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -97,66 +97,66 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
Interface:
|
.Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0x00,
|
.InterfaceNumber = 0x00,
|
||||||
AlternateSetting: 0x00,
|
.AlternateSetting = 0x00,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x03,
|
.Class = 0x03,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
GenericHID:
|
.GenericHID =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
|
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
|
||||||
|
|
||||||
HIDSpec: VERSION_BCD(01.11),
|
.HIDSpec = VERSION_BCD(01.11),
|
||||||
CountryCode: 0x00,
|
.CountryCode = 0x00,
|
||||||
TotalHIDReports: 0x01,
|
.TotalHIDReports = 0x01,
|
||||||
HIDReportType: DTYPE_Report,
|
.HIDReportType = DTYPE_Report,
|
||||||
HIDReportLength: sizeof(GenericReport)
|
.HIDReportLength = sizeof(GenericReport)
|
||||||
},
|
},
|
||||||
|
|
||||||
GenericINEndpoint:
|
.GenericINEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | GENERIC_IN_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | GENERIC_IN_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: GENERIC_EPSIZE,
|
.EndpointSize = GENERIC_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
},
|
},
|
||||||
|
|
||||||
GenericOUTEndpoint:
|
.GenericOUTEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | GENERIC_OUT_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | GENERIC_OUT_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: GENERIC_EPSIZE,
|
.EndpointSize = GENERIC_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -166,9 +166,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -177,9 +177,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -188,9 +188,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(13), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(21), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA HID Demo"
|
.UnicodeString = L"LUFA Generic HID Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -40,11 +40,11 @@
|
|||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
|
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(INTERRUPT_DATA_ENDPOINT)
|
#if !defined(INTERRUPT_DATA_ENDPOINT)
|
||||||
{ Task: USB_HID_Report , TaskStatus: TASK_STOP },
|
{ .Task = USB_HID_Report , .TaskStatus = TASK_STOP },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -80,24 +80,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2043,
|
.ProductID = 0x2043,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -107,56 +107,56 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
Interface:
|
.Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0x00,
|
.InterfaceNumber = 0x00,
|
||||||
AlternateSetting: 0x00,
|
.AlternateSetting = 0x00,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x03,
|
.Class = 0x03,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
JoystickHID:
|
.JoystickHID =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
|
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
|
||||||
|
|
||||||
HIDSpec: VERSION_BCD(01.11),
|
.HIDSpec = VERSION_BCD(01.11),
|
||||||
CountryCode: 0x00,
|
.CountryCode = 0x00,
|
||||||
TotalHIDReports: 0x01,
|
.TotalHIDReports = 0x01,
|
||||||
HIDReportType: DTYPE_Report,
|
.HIDReportType = DTYPE_Report,
|
||||||
HIDReportLength: sizeof(JoystickReport)
|
.HIDReportLength = sizeof(JoystickReport)
|
||||||
},
|
},
|
||||||
|
|
||||||
JoystickEndpoint:
|
.JoystickEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | JOYSTICK_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | JOYSTICK_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: JOYSTICK_EPSIZE,
|
.EndpointSize = JOYSTICK_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -166,9 +166,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -177,9 +177,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -188,9 +188,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Joystick Demo"
|
.UnicodeString = L"LUFA Joystick Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Joystick_Report , TaskStatus: TASK_STOP },
|
{ .Task = USB_Joystick_Report , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Main program entry point. This routine configures the hardware required by the application, then
|
/** Main program entry point. This routine configures the hardware required by the application, then
|
||||||
|
@ -87,24 +87,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2042,
|
.ProductID = 0x2042,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -114,66 +114,66 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
Interface:
|
.Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0x00,
|
.InterfaceNumber = 0x00,
|
||||||
AlternateSetting: 0x00,
|
.AlternateSetting = 0x00,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x03,
|
.Class = 0x03,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardHID:
|
.KeyboardHID =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
|
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
|
||||||
|
|
||||||
HIDSpec: VERSION_BCD(01.11),
|
.HIDSpec = VERSION_BCD(01.11),
|
||||||
CountryCode: 0x00,
|
.CountryCode = 0x00,
|
||||||
TotalHIDReports: 0x01,
|
.TotalHIDReports = 0x01,
|
||||||
HIDReportType: DTYPE_Report,
|
.HIDReportType = DTYPE_Report,
|
||||||
HIDReportLength: sizeof(KeyboardReport)
|
.HIDReportLength = sizeof(KeyboardReport)
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardEndpoint:
|
.KeyboardEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: KEYBOARD_EPSIZE,
|
.EndpointSize = KEYBOARD_EPSIZE,
|
||||||
PollingIntervalMS: 0x04
|
.PollingIntervalMS = 0x04
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardLEDsEndpoint:
|
.KeyboardLEDsEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: KEYBOARD_EPSIZE,
|
.EndpointSize = KEYBOARD_EPSIZE,
|
||||||
PollingIntervalMS: 0x04
|
.PollingIntervalMS = 0x04
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -183,9 +183,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -194,9 +194,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(16), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(16), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Denver Gingerich"
|
.UnicodeString = L"Denver Gingerich"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -205,9 +205,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(18), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Keyboard Demo"
|
.UnicodeString = L"LUFA Keyboard Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -41,11 +41,11 @@
|
|||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
|
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(INTERRUPT_DATA_ENDPOINT)
|
#if !defined(INTERRUPT_DATA_ENDPOINT)
|
||||||
{ Task: USB_Keyboard_Report , TaskStatus: TASK_STOP },
|
{ .Task = USB_Keyboard_Report , .TaskStatus = TASK_STOP },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,24 +120,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x204D,
|
.ProductID = 0x204D,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -147,103 +147,103 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardInterface:
|
.KeyboardInterface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0x00,
|
.InterfaceNumber = 0x00,
|
||||||
AlternateSetting: 0x00,
|
.AlternateSetting = 0x00,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x03,
|
.Class = 0x03,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardHID:
|
.KeyboardHID =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
|
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
|
||||||
|
|
||||||
HIDSpec: VERSION_BCD(01.11),
|
.HIDSpec = VERSION_BCD(01.11),
|
||||||
CountryCode: 0x00,
|
.CountryCode = 0x00,
|
||||||
TotalHIDReports: 0x01,
|
.TotalHIDReports = 0x01,
|
||||||
HIDReportType: DTYPE_Report,
|
.HIDReportType = DTYPE_Report,
|
||||||
HIDReportLength: sizeof(KeyboardReport)
|
.HIDReportLength = sizeof(KeyboardReport)
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardInEndpoint:
|
.KeyboardInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_IN_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_IN_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: HID_EPSIZE,
|
.EndpointSize = HID_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardOutEndpoint:
|
.KeyboardOutEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_OUT_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_OUT_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: HID_EPSIZE,
|
.EndpointSize = HID_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
},
|
},
|
||||||
|
|
||||||
MouseInterface:
|
.MouseInterface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0x01,
|
.InterfaceNumber = 0x01,
|
||||||
AlternateSetting: 0x00,
|
.AlternateSetting = 0x00,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x03,
|
.Class = 0x03,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x02,
|
.Protocol = 0x02,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
MouseHID:
|
.MouseHID =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
|
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
|
||||||
|
|
||||||
HIDSpec: VERSION_BCD(01.11),
|
.HIDSpec = VERSION_BCD(01.11),
|
||||||
CountryCode: 0x00,
|
.CountryCode = 0x00,
|
||||||
TotalHIDReports: 0x01,
|
.TotalHIDReports = 0x01,
|
||||||
HIDReportType: DTYPE_Report,
|
.HIDReportType = DTYPE_Report,
|
||||||
HIDReportLength: sizeof(MouseReport)
|
.HIDReportLength = sizeof(MouseReport)
|
||||||
},
|
},
|
||||||
|
|
||||||
MouseInEndpoint:
|
.MouseInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_IN_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_IN_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: HID_EPSIZE,
|
.EndpointSize = HID_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -253,9 +253,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -264,9 +264,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -275,9 +275,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(28), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(28), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Mouse and Keyboard Demo"
|
.UnicodeString = L"LUFA Mouse and Keyboard Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -40,9 +40,9 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Mouse , TaskStatus: TASK_RUN },
|
{ .Task = USB_Mouse , .TaskStatus = TASK_RUN },
|
||||||
{ Task: USB_Keyboard , TaskStatus: TASK_RUN },
|
{ .Task = USB_Keyboard , .TaskStatus = TASK_RUN },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Global Variables */
|
/* Global Variables */
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2048,
|
.ProductID = 0x2048,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,175 +71,175 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioControlInterface:
|
.AudioControlInterface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 0,
|
.TotalEndpoints = 0,
|
||||||
|
|
||||||
Class: 0x01,
|
.Class = 0x01,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioControlInterface_SPC:
|
.AudioControlInterface_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioInterface_AC_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioInterface_AC_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_Header,
|
.Subtype = DSUBTYPE_Header,
|
||||||
|
|
||||||
ACSpecification: VERSION_BCD(01.00),
|
.ACSpecification = VERSION_BCD(01.00),
|
||||||
TotalLength: sizeof(USB_AudioInterface_AC_t),
|
.TotalLength = sizeof(USB_AudioInterface_AC_t),
|
||||||
|
|
||||||
InCollection: 1,
|
.InCollection = 1,
|
||||||
InterfaceNumbers: {1},
|
.InterfaceNumbers = {1},
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioStreamInterface:
|
.AudioStreamInterface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x01,
|
.Class = 0x01,
|
||||||
SubClass: 0x03,
|
.SubClass = 0x03,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
AudioStreamInterface_SPC:
|
.AudioStreamInterface_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioInterface_MIDI_AS_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_AudioInterface_MIDI_AS_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_General,
|
.Subtype = DSUBTYPE_General,
|
||||||
|
|
||||||
AudioSpecification: VERSION_BCD(01.00),
|
.AudioSpecification = VERSION_BCD(01.00),
|
||||||
|
|
||||||
TotalLength: (sizeof(USB_Descriptor_Configuration_t) - offsetof(USB_Descriptor_Configuration_t, AudioStreamInterface_SPC))
|
.TotalLength = (sizeof(USB_Descriptor_Configuration_t) - offsetof(USB_Descriptor_Configuration_t, AudioStreamInterface_SPC))
|
||||||
},
|
},
|
||||||
|
|
||||||
MIDI_In_Jack_Emb:
|
.MIDI_In_Jack_Emb =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_MIDI_In_Jack_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_InputJack,
|
.Subtype = DSUBTYPE_InputJack,
|
||||||
|
|
||||||
JackType: JACKTYPE_EMBEDDED,
|
.JackType = JACKTYPE_EMBEDDED,
|
||||||
JackID: 0x01,
|
.JackID = 0x01,
|
||||||
|
|
||||||
JackStrIndex: NO_DESCRIPTOR
|
.JackStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
MIDI_In_Jack_Ext:
|
.MIDI_In_Jack_Ext =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_MIDI_In_Jack_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_InputJack,
|
.Subtype = DSUBTYPE_InputJack,
|
||||||
|
|
||||||
JackType: JACKTYPE_EXTERNAL,
|
.JackType = JACKTYPE_EXTERNAL,
|
||||||
JackID: 0x02,
|
.JackID = 0x02,
|
||||||
|
|
||||||
JackStrIndex: NO_DESCRIPTOR
|
.JackStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
MIDI_Out_Jack_Emb:
|
.MIDI_Out_Jack_Emb =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_MIDI_Out_Jack_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_OutputJack,
|
.Subtype = DSUBTYPE_OutputJack,
|
||||||
|
|
||||||
JackType: JACKTYPE_EMBEDDED,
|
.JackType = JACKTYPE_EMBEDDED,
|
||||||
JackID: 0x03,
|
.JackID = 0x03,
|
||||||
|
|
||||||
NumberOfPins: 1,
|
.NumberOfPins = 1,
|
||||||
SourceJackID: {0x02},
|
.SourceJackID = {0x02},
|
||||||
SourcePinID: {0x01},
|
.SourcePinID = {0x01},
|
||||||
|
|
||||||
JackStrIndex: NO_DESCRIPTOR
|
.JackStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
MIDI_Out_Jack_Ext:
|
.MIDI_Out_Jack_Ext =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_MIDI_Out_Jack_t), Type: DTYPE_AudioInterface},
|
.Header = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_AudioInterface},
|
||||||
Subtype: DSUBTYPE_OutputJack,
|
.Subtype = DSUBTYPE_OutputJack,
|
||||||
|
|
||||||
JackType: JACKTYPE_EXTERNAL,
|
.JackType = JACKTYPE_EXTERNAL,
|
||||||
JackID: 0x04,
|
.JackID = 0x04,
|
||||||
|
|
||||||
NumberOfPins: 1,
|
.NumberOfPins = 1,
|
||||||
SourceJackID: {0x01},
|
.SourceJackID = {0x01},
|
||||||
SourcePinID: {0x01},
|
.SourcePinID = {0x01},
|
||||||
|
|
||||||
JackStrIndex: NO_DESCRIPTOR
|
.JackStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
MIDI_In_Jack_Endpoint:
|
.MIDI_In_Jack_Endpoint =
|
||||||
{
|
{
|
||||||
Endpoint:
|
.Endpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
|
||||||
Attributes: (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
||||||
EndpointSize: MIDI_STREAM_EPSIZE,
|
.EndpointSize = MIDI_STREAM_EPSIZE,
|
||||||
PollingIntervalMS: 0
|
.PollingIntervalMS = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
Refresh: 0,
|
.Refresh = 0,
|
||||||
SyncEndpointNumber: 0
|
.SyncEndpointNumber = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
MIDI_In_Jack_Endpoint_SPC:
|
.MIDI_In_Jack_Endpoint_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_MIDI_Jack_Endpoint_t), Type: DTYPE_AudioEndpoint},
|
.Header = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint},
|
||||||
Subtype: DSUBTYPE_General,
|
.Subtype = DSUBTYPE_General,
|
||||||
|
|
||||||
TotalEmbeddedJacks: 0x01,
|
.TotalEmbeddedJacks = 0x01,
|
||||||
AssociatedJackID: {0x01}
|
.AssociatedJackID = {0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
MIDI_Out_Jack_Endpoint:
|
.MIDI_Out_Jack_Endpoint =
|
||||||
{
|
{
|
||||||
Endpoint:
|
.Endpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_AudioStreamEndpoint_Std_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_AudioStreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MIDI_STREAM_IN_EPNUM),
|
||||||
Attributes: (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
||||||
EndpointSize: MIDI_STREAM_EPSIZE,
|
.EndpointSize = MIDI_STREAM_EPSIZE,
|
||||||
PollingIntervalMS: 0
|
.PollingIntervalMS = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
Refresh: 0,
|
.Refresh = 0,
|
||||||
SyncEndpointNumber: 0
|
.SyncEndpointNumber = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
MIDI_Out_Jack_Endpoint_SPC:
|
.MIDI_Out_Jack_Endpoint_SPC =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_MIDI_Jack_Endpoint_t), Type: DTYPE_AudioEndpoint},
|
.Header = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint},
|
||||||
Subtype: DSUBTYPE_General,
|
.Subtype = DSUBTYPE_General,
|
||||||
|
|
||||||
TotalEmbeddedJacks: 0x01,
|
.TotalEmbeddedJacks = 0x01,
|
||||||
AssociatedJackID: {0x03}
|
.AssociatedJackID = {0x03}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -249,9 +249,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -260,9 +260,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -271,9 +271,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(14), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(14), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA MIDI Demo"
|
.UnicodeString = L"LUFA MIDI Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_MIDI_Task , TaskStatus: TASK_STOP },
|
{ .Task = USB_MIDI_Task , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Main program entry point. This routine configures the hardware required by the application, then
|
/** Main program entry point. This routine configures the hardware required by the application, then
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2045,
|
.ProductID = 0x2045,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: 0x03,
|
.SerialNumStrIndex = 0x03,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,55 +71,55 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: USB_CONFIG_ATTR_BUSPOWERED,
|
.ConfigAttributes = USB_CONFIG_ATTR_BUSPOWERED,
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
Interface:
|
.Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x08,
|
.Class = 0x08,
|
||||||
SubClass: 0x06,
|
.SubClass = 0x06,
|
||||||
Protocol: 0x50,
|
.Protocol = 0x50,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
DataInEndpoint:
|
.DataInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MASS_STORAGE_IN_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MASS_STORAGE_IN_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: MASS_STORAGE_IO_EPSIZE,
|
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
},
|
},
|
||||||
|
|
||||||
DataOutEndpoint:
|
.DataOutEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: MASS_STORAGE_IO_EPSIZE,
|
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -129,9 +129,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -140,9 +140,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -151,9 +151,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(22), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(22), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Mass Storage Demo"
|
.UnicodeString = L"LUFA Mass Storage Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Serial number descriptor string. This is a Unicode string containing a string of HEX characters at least 12
|
/** Serial number descriptor string. This is a Unicode string containing a string of HEX characters at least 12
|
||||||
@ -165,9 +165,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM SerialNumberString =
|
USB_Descriptor_String_t PROGMEM SerialNumberString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(12), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(12), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"000000000000"
|
.UnicodeString = L"000000000000"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_MassStorage , TaskStatus: TASK_STOP },
|
{ .Task = USB_MassStorage , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Global Variables */
|
/* Global Variables */
|
||||||
@ -48,7 +48,7 @@ TASK_LIST
|
|||||||
CommandBlockWrapper_t CommandBlock;
|
CommandBlockWrapper_t CommandBlock;
|
||||||
|
|
||||||
/** Structure to hold the latest Command Status Wrapper to return to the host, containing the status of the last issued command. */
|
/** Structure to hold the latest Command Status Wrapper to return to the host, containing the status of the last issued command. */
|
||||||
CommandStatusWrapper_t CommandStatus = { Signature: CSW_SIGNATURE };
|
CommandStatusWrapper_t CommandStatus = { .Signature = CSW_SIGNATURE };
|
||||||
|
|
||||||
/** Flag to asynchronously abort any in-progress data transfers upon the reception of a mass storage reset command. */
|
/** Flag to asynchronously abort any in-progress data transfers upon the reception of a mass storage reset command. */
|
||||||
volatile bool IsMassStoreReset = false;
|
volatile bool IsMassStoreReset = false;
|
||||||
|
@ -43,31 +43,31 @@
|
|||||||
*/
|
*/
|
||||||
SCSI_Inquiry_Response_t InquiryData =
|
SCSI_Inquiry_Response_t InquiryData =
|
||||||
{
|
{
|
||||||
DeviceType: 0,
|
.DeviceType = 0,
|
||||||
PeripheralQualifier: 0,
|
.PeripheralQualifier = 0,
|
||||||
|
|
||||||
Removable: true,
|
.Removable = true,
|
||||||
|
|
||||||
Version: 0,
|
.Version = 0,
|
||||||
|
|
||||||
ResponseDataFormat: 2,
|
.ResponseDataFormat = 2,
|
||||||
NormACA: false,
|
.NormACA = false,
|
||||||
TrmTsk: false,
|
.TrmTsk = false,
|
||||||
AERC: false,
|
.AERC = false,
|
||||||
|
|
||||||
AdditionalLength: 0x1F,
|
.AdditionalLength = 0x1F,
|
||||||
|
|
||||||
SoftReset: false,
|
.SoftReset = false,
|
||||||
CmdQue: false,
|
.CmdQue = false,
|
||||||
Linked: false,
|
.Linked = false,
|
||||||
Sync: false,
|
.Sync = false,
|
||||||
WideBus16Bit: false,
|
.WideBus16Bit = false,
|
||||||
WideBus32Bit: false,
|
.WideBus32Bit = false,
|
||||||
RelAddr: false,
|
.RelAddr = false,
|
||||||
|
|
||||||
VendorID: "LUFA",
|
.VendorID = "LUFA",
|
||||||
ProductID: "Dataflash Disk",
|
.ProductID = "Dataflash Disk",
|
||||||
RevisionID: {'0','.','0','0'},
|
.RevisionID = {'0','.','0','0'},
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Structure to hold the sense data for the last issued SCSI command, which is returned to the host after a SCSI REQUEST SENSE
|
/** Structure to hold the sense data for the last issued SCSI command, which is returned to the host after a SCSI REQUEST SENSE
|
||||||
@ -75,8 +75,8 @@ SCSI_Inquiry_Response_t InquiryData =
|
|||||||
*/
|
*/
|
||||||
SCSI_Request_Sense_Response_t SenseData =
|
SCSI_Request_Sense_Response_t SenseData =
|
||||||
{
|
{
|
||||||
ResponseCode: 0x70,
|
.ResponseCode = 0x70,
|
||||||
AdditionalLength: 0x0A,
|
.AdditionalLength = 0x0A,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,24 +80,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2041,
|
.ProductID = 0x2041,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -107,56 +107,56 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
Interface:
|
.Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0x00,
|
.InterfaceNumber = 0x00,
|
||||||
AlternateSetting: 0x00,
|
.AlternateSetting = 0x00,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x03,
|
.Class = 0x03,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x02,
|
.Protocol = 0x02,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
MouseHID:
|
.MouseHID =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
|
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
|
||||||
|
|
||||||
HIDSpec: VERSION_BCD(01.11),
|
.HIDSpec = VERSION_BCD(01.11),
|
||||||
CountryCode: 0x00,
|
.CountryCode = 0x00,
|
||||||
TotalHIDReports: 0x01,
|
.TotalHIDReports = 0x01,
|
||||||
HIDReportType: DTYPE_Report,
|
.HIDReportType = DTYPE_Report,
|
||||||
HIDReportLength: sizeof(MouseReport)
|
.HIDReportLength = sizeof(MouseReport)
|
||||||
},
|
},
|
||||||
|
|
||||||
MouseEndpoint:
|
.MouseEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: MOUSE_EPSIZE,
|
.EndpointSize = MOUSE_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -166,9 +166,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -177,9 +177,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -188,9 +188,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(15), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(15), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Mouse Demo"
|
.UnicodeString = L"LUFA Mouse Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -40,11 +40,11 @@
|
|||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
|
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(INTERRUPT_DATA_ENDPOINT)
|
#if !defined(INTERRUPT_DATA_ENDPOINT)
|
||||||
{ Task: USB_Mouse_Report , TaskStatus: TASK_STOP },
|
{ .Task = USB_Mouse_Report , .TaskStatus = TASK_STOP },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x204C,
|
.ProductID = 0x204C,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,113 +71,113 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
CCI_Interface:
|
.CCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0xFF,
|
.Protocol = 0xFF,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_Header:
|
.CDC_Functional_Header =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x00,
|
.SubType = 0x00,
|
||||||
|
|
||||||
Data: {0x01, 0x10}
|
.Data = {0x01, 0x10}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_CallManagement:
|
.CDC_Functional_CallManagement=
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x01,
|
.SubType = 0x01,
|
||||||
|
|
||||||
Data: {0x00, 0x00}
|
.Data = {0x00, 0x00}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_AbstractControlManagement:
|
.CDC_Functional_AbstractControlManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
|
||||||
SubType: 0x02,
|
.SubType = 0x02,
|
||||||
|
|
||||||
Data: {0x00}
|
.Data = {0x00}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_Union:
|
.CDC_Functional_Union =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x06,
|
.SubType = 0x06,
|
||||||
|
|
||||||
Data: {0x00, 0x01}
|
.Data = {0x00, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
ManagementEndpoint:
|
.ManagementEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: CDC_NOTIFICATION_EPSIZE,
|
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
|
||||||
PollingIntervalMS: 0x02
|
.PollingIntervalMS = 0x02
|
||||||
},
|
},
|
||||||
|
|
||||||
DCI_Interface:
|
.DCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x0A,
|
.Class = 0x0A,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
DataOutEndpoint:
|
.DataOutEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
},
|
},
|
||||||
|
|
||||||
DataInEndpoint:
|
.DataInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,9 +187,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -198,9 +198,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -209,9 +209,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA RNDIS CDC Demo"
|
.UnicodeString = L"LUFA RNDIS CDC Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: Ethernet_Task , TaskStatus: TASK_STOP },
|
{ .Task = Ethernet_Task , .TaskStatus = TASK_STOP },
|
||||||
{ Task: TCP_Task , TaskStatus: TASK_STOP },
|
{ .Task = TCP_Task , .TaskStatus = TASK_STOP },
|
||||||
{ Task: RNDIS_Task , TaskStatus: TASK_STOP },
|
{ .Task = RNDIS_Task , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Main program entry point. This routine configures the hardware required by the application, then
|
/** Main program entry point. This routine configures the hardware required by the application, then
|
||||||
@ -245,11 +245,11 @@ TASK(RNDIS_Task)
|
|||||||
{
|
{
|
||||||
USB_Notification_t Notification = (USB_Notification_t)
|
USB_Notification_t Notification = (USB_Notification_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
|
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
|
||||||
bNotification: NOTIF_RESPONSE_AVAILABLE,
|
.bNotification = NOTIF_RESPONSE_AVAILABLE,
|
||||||
wValue: 0,
|
.wValue = 0,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Indicate that a message response is ready for the host */
|
/* Indicate that a message response is ready for the host */
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2044,
|
.ProductID = 0x2044,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,113 +71,113 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 2,
|
.TotalInterfaces = 2,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
CCI_Interface:
|
.CCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0,
|
.InterfaceNumber = 0,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x02,
|
.Class = 0x02,
|
||||||
SubClass: 0x02,
|
.SubClass = 0x02,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_IntHeader:
|
.CDC_Functional_IntHeader =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x00,
|
.SubType = 0x00,
|
||||||
|
|
||||||
Data: {0x01, 0x10}
|
.Data = {0x01, 0x10}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_CallManagement:
|
.CDC_Functional_CallManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x01,
|
.SubType = 0x01,
|
||||||
|
|
||||||
Data: {0x03, 0x01}
|
.Data = {0x03, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_AbstractControlManagement:
|
.CDC_Functional_AbstractControlManagement =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
|
||||||
SubType: 0x02,
|
.SubType = 0x02,
|
||||||
|
|
||||||
Data: {0x06}
|
.Data = {0x06}
|
||||||
},
|
},
|
||||||
|
|
||||||
CDC_Functional_Union:
|
.CDC_Functional_Union=
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), Type: 0x24},
|
.Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
|
||||||
SubType: 0x06,
|
.SubType = 0x06,
|
||||||
|
|
||||||
Data: {0x00, 0x01}
|
.Data = {0x00, 0x01}
|
||||||
},
|
},
|
||||||
|
|
||||||
ManagementEndpoint:
|
.ManagementEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: CDC_NOTIFICATION_EPSIZE,
|
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
|
||||||
PollingIntervalMS: 0xFF
|
.PollingIntervalMS = 0xFF
|
||||||
},
|
},
|
||||||
|
|
||||||
DCI_Interface:
|
.DCI_Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 2,
|
.TotalEndpoints = 2,
|
||||||
|
|
||||||
Class: 0x0A,
|
.Class = 0x0A,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
DataOutEndpoint:
|
.DataOutEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS = 0x00
|
||||||
},
|
},
|
||||||
|
|
||||||
DataInEndpoint:
|
.DataInEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
|
||||||
Attributes: EP_TYPE_BULK,
|
.Attributes = EP_TYPE_BULK,
|
||||||
EndpointSize: CDC_TXRX_EPSIZE,
|
.EndpointSize = CDC_TXRX_EPSIZE,
|
||||||
PollingIntervalMS: 0x00
|
.PollingIntervalMS= 0x00
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,9 +187,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -198,9 +198,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -209,9 +209,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(19), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA USB-RS232 Demo"
|
.UnicodeString = L"LUFA USB-RS232 Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: CDC_Task , TaskStatus: TASK_STOP },
|
{ .Task = CDC_Task , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Globals: */
|
/* Globals: */
|
||||||
@ -43,10 +43,10 @@ TASK_LIST
|
|||||||
* These values are set by the host via a class-specific request, and the physical USART should be reconfigured to match the
|
* These values are set by the host via a class-specific request, and the physical USART should be reconfigured to match the
|
||||||
* new settings each time they are changed by the host.
|
* new settings each time they are changed by the host.
|
||||||
*/
|
*/
|
||||||
CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,
|
CDC_Line_Coding_t LineCoding = { .BaudRateBPS = 9600,
|
||||||
CharFormat: OneStopBit,
|
.CharFormat = OneStopBit,
|
||||||
ParityType: Parity_None,
|
.ParityType = Parity_None,
|
||||||
DataBits: 8 };
|
.DataBits = 8 };
|
||||||
|
|
||||||
/** Ring (circular) buffer to hold the RX data - data from the host to the attached device on the serial port. */
|
/** Ring (circular) buffer to hold the RX data - data from the host to the attached device on the serial port. */
|
||||||
RingBuff_t Rx_Buffer;
|
RingBuff_t Rx_Buffer;
|
||||||
@ -224,11 +224,11 @@ TASK(CDC_Task)
|
|||||||
|
|
||||||
USB_Notification_Header_t Notification = (USB_Notification_Header_t)
|
USB_Notification_Header_t Notification = (USB_Notification_Header_t)
|
||||||
{
|
{
|
||||||
NotificationType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
|
.NotificationType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
|
||||||
Notification: NOTIF_SerialState,
|
.Notification = NOTIF_SerialState,
|
||||||
wValue: 0,
|
.wValue = 0,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: sizeof(uint16_t),
|
.wLength = sizeof(uint16_t),
|
||||||
};
|
};
|
||||||
|
|
||||||
uint16_t LineStateMask;
|
uint16_t LineStateMask;
|
||||||
@ -244,6 +244,7 @@ TASK(CDC_Task)
|
|||||||
/* Select the Serial Rx Endpoint */
|
/* Select the Serial Rx Endpoint */
|
||||||
Endpoint_SelectEndpoint(CDC_RX_EPNUM);
|
Endpoint_SelectEndpoint(CDC_RX_EPNUM);
|
||||||
|
|
||||||
|
/* Check to see if a packet has been received from the host */
|
||||||
if (Endpoint_IsOUTReceived())
|
if (Endpoint_IsOUTReceived())
|
||||||
{
|
{
|
||||||
/* Read the bytes in from the endpoint into the buffer while space is available */
|
/* Read the bytes in from the endpoint into the buffer while space is available */
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_CDC_Host , TaskStatus: TASK_STOP },
|
{ .Task = USB_CDC_Host , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -183,11 +183,11 @@ TASK(USB_CDC_Host)
|
|||||||
/* Standard request to set the device configuration to configuration 1 */
|
/* Standard request to set the device configuration to configuration 1 */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetConfiguration,
|
.bRequest = REQ_SetConfiguration,
|
||||||
wValue: 1,
|
.wValue = 1,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_HID_Host , TaskStatus: TASK_STOP },
|
{ .Task = USB_HID_Host , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -259,11 +259,11 @@ void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t Report
|
|||||||
/* Class specific request to send a HID report to the device */
|
/* Class specific request to send a HID report to the device */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
|
||||||
bRequest: REQ_SetReport,
|
.bRequest = REQ_SetReport,
|
||||||
wValue: ((ReportType << 8) | ReportIndex),
|
.wValue = ((ReportType << 8) | ReportIndex),
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: ReportLength,
|
.wLength = ReportLength,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
@ -288,11 +288,11 @@ TASK(USB_HID_Host)
|
|||||||
/* Standard request to set the device configuration to configuration 1 */
|
/* Standard request to set the device configuration to configuration 1 */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetConfiguration,
|
.bRequest = REQ_SetConfiguration,
|
||||||
wValue: 1,
|
.wValue = 1,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Keyboard_Host , TaskStatus: TASK_STOP },
|
{ .Task = USB_Keyboard_Host , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -255,11 +255,11 @@ TASK(USB_Keyboard_Host)
|
|||||||
/* Standard request to set the device configuration to configuration 1 */
|
/* Standard request to set the device configuration to configuration 1 */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetConfiguration,
|
.bRequest = REQ_SetConfiguration,
|
||||||
wValue: 1,
|
.wValue = 1,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
@ -305,11 +305,11 @@ TASK(USB_Keyboard_Host)
|
|||||||
/* HID class request to set the keyboard protocol to the Boot Protocol */
|
/* HID class request to set the keyboard protocol to the Boot Protocol */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
|
||||||
bRequest: REQ_SetProtocol,
|
.bRequest = REQ_SetProtocol,
|
||||||
wValue: 0,
|
.wValue = 0,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -49,11 +49,11 @@ uint8_t GetHIDReportData(void)
|
|||||||
|
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
|
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
|
||||||
bRequest: REQ_GetDescriptor,
|
.bRequest = REQ_GetDescriptor,
|
||||||
wValue: (DTYPE_Report << 8),
|
.wValue = (DTYPE_Report << 8),
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: HIDReportSize,
|
.wLength = HIDReportSize,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Keyboard_Host , TaskStatus: TASK_STOP },
|
{ .Task = USB_Keyboard_Host , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -186,11 +186,11 @@ TASK(USB_Keyboard_Host)
|
|||||||
/* Standard request to set the device configuration to configuration 1 */
|
/* Standard request to set the device configuration to configuration 1 */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetConfiguration,
|
.bRequest = REQ_SetConfiguration,
|
||||||
wValue: 1,
|
.wValue = 1,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_MassStore_Host , TaskStatus: TASK_STOP },
|
{ .Task = USB_MassStore_Host , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Globals */
|
/* Globals */
|
||||||
@ -157,11 +157,11 @@ TASK(USB_MassStore_Host)
|
|||||||
/* Standard request to set the device configuration to configuration 1 */
|
/* Standard request to set the device configuration to configuration 1 */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetConfiguration,
|
.bRequest = REQ_SetConfiguration,
|
||||||
wValue: 1,
|
.wValue = 1,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -252,11 +252,11 @@ uint8_t MassStore_ClearPipeStall(const uint8_t EndpointNum)
|
|||||||
{
|
{
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),
|
||||||
bRequest: REQ_ClearFeature,
|
.bRequest = REQ_ClearFeature,
|
||||||
wValue: FEATURE_ENDPOINT_HALT,
|
.wValue = FEATURE_ENDPOINT_HALT,
|
||||||
wIndex: EndpointNum,
|
.wIndex = EndpointNum,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
@ -274,11 +274,11 @@ uint8_t MassStore_MassStorageReset(void)
|
|||||||
{
|
{
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
|
||||||
bRequest: REQ_MassStorageReset,
|
.bRequest = REQ_MassStorageReset,
|
||||||
wValue: 0,
|
.wValue = 0,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
@ -300,11 +300,11 @@ uint8_t MassStore_GetMaxLUN(uint8_t* const MaxLUNIndex)
|
|||||||
|
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
|
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
|
||||||
bRequest: REQ_GetMaxLUN,
|
.bRequest = REQ_GetMaxLUN,
|
||||||
wValue: 0,
|
.wValue = 0,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 1,
|
.wLength = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
@ -337,17 +337,17 @@ uint8_t MassStore_RequestSense(const uint8_t LUNIndex, const SCSI_Request_Sense_
|
|||||||
/* Create a CBW with a SCSI command to issue REQUEST SENSE command */
|
/* Create a CBW with a SCSI command to issue REQUEST SENSE command */
|
||||||
SCSICommandBlock = (CommandBlockWrapper_t)
|
SCSICommandBlock = (CommandBlockWrapper_t)
|
||||||
{
|
{
|
||||||
Header:
|
.Header =
|
||||||
{
|
{
|
||||||
Signature: CBW_SIGNATURE,
|
.Signature = CBW_SIGNATURE,
|
||||||
Tag: MassStore_Tag,
|
.Tag = MassStore_Tag,
|
||||||
DataTransferLength: sizeof(SCSI_Request_Sense_Response_t),
|
.DataTransferLength = sizeof(SCSI_Request_Sense_Response_t),
|
||||||
Flags: COMMAND_DIRECTION_DATA_IN,
|
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||||
LUN: LUNIndex,
|
.LUN = LUNIndex,
|
||||||
SCSICommandLength: 6
|
.SCSICommandLength = 6
|
||||||
},
|
},
|
||||||
|
|
||||||
SCSICommandData:
|
.SCSICommandData =
|
||||||
{
|
{
|
||||||
SCSI_CMD_REQUEST_SENSE,
|
SCSI_CMD_REQUEST_SENSE,
|
||||||
0x00, // Reserved
|
0x00, // Reserved
|
||||||
@ -404,17 +404,17 @@ uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAd
|
|||||||
/* Create a CBW with a SCSI command to read in the given blocks from the device */
|
/* Create a CBW with a SCSI command to read in the given blocks from the device */
|
||||||
SCSICommandBlock = (CommandBlockWrapper_t)
|
SCSICommandBlock = (CommandBlockWrapper_t)
|
||||||
{
|
{
|
||||||
Header:
|
.Header =
|
||||||
{
|
{
|
||||||
Signature: CBW_SIGNATURE,
|
.Signature = CBW_SIGNATURE,
|
||||||
Tag: MassStore_Tag,
|
.Tag = MassStore_Tag,
|
||||||
DataTransferLength: ((uint32_t)Blocks * BlockSize),
|
.DataTransferLength = ((uint32_t)Blocks * BlockSize),
|
||||||
Flags: COMMAND_DIRECTION_DATA_IN,
|
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||||
LUN: LUNIndex,
|
.LUN = LUNIndex,
|
||||||
SCSICommandLength: 10
|
.SCSICommandLength = 10
|
||||||
},
|
},
|
||||||
|
|
||||||
SCSICommandData:
|
.SCSICommandData =
|
||||||
{
|
{
|
||||||
SCSI_CMD_READ_10,
|
SCSI_CMD_READ_10,
|
||||||
0x00, // Unused (control bits, all off)
|
0x00, // Unused (control bits, all off)
|
||||||
@ -475,17 +475,17 @@ uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockA
|
|||||||
/* Create a CBW with a SCSI command to write the given blocks to the device */
|
/* Create a CBW with a SCSI command to write the given blocks to the device */
|
||||||
SCSICommandBlock = (CommandBlockWrapper_t)
|
SCSICommandBlock = (CommandBlockWrapper_t)
|
||||||
{
|
{
|
||||||
Header:
|
.Header =
|
||||||
{
|
{
|
||||||
Signature: CBW_SIGNATURE,
|
.Signature = CBW_SIGNATURE,
|
||||||
Tag: MassStore_Tag,
|
.Tag = MassStore_Tag,
|
||||||
DataTransferLength: ((uint32_t)Blocks * BlockSize),
|
.DataTransferLength = ((uint32_t)Blocks * BlockSize),
|
||||||
Flags: COMMAND_DIRECTION_DATA_OUT,
|
.Flags = COMMAND_DIRECTION_DATA_OUT,
|
||||||
LUN: LUNIndex,
|
.LUN = LUNIndex,
|
||||||
SCSICommandLength: 10
|
.SCSICommandLength = 10
|
||||||
},
|
},
|
||||||
|
|
||||||
SCSICommandData:
|
.SCSICommandData =
|
||||||
{
|
{
|
||||||
SCSI_CMD_WRITE_10,
|
SCSI_CMD_WRITE_10,
|
||||||
0x00, // Unused (control bits, all off)
|
0x00, // Unused (control bits, all off)
|
||||||
@ -534,17 +534,17 @@ uint8_t MassStore_TestUnitReady(const uint8_t LUNIndex)
|
|||||||
/* Create a CBW with a SCSI command to issue TEST UNIT READY command */
|
/* Create a CBW with a SCSI command to issue TEST UNIT READY command */
|
||||||
SCSICommandBlock = (CommandBlockWrapper_t)
|
SCSICommandBlock = (CommandBlockWrapper_t)
|
||||||
{
|
{
|
||||||
Header:
|
.Header =
|
||||||
{
|
{
|
||||||
Signature: CBW_SIGNATURE,
|
.Signature = CBW_SIGNATURE,
|
||||||
Tag: MassStore_Tag,
|
.Tag = MassStore_Tag,
|
||||||
DataTransferLength: 0,
|
.DataTransferLength = 0,
|
||||||
Flags: COMMAND_DIRECTION_DATA_IN,
|
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||||
LUN: LUNIndex,
|
.LUN = LUNIndex,
|
||||||
SCSICommandLength: 6
|
.SCSICommandLength = 6
|
||||||
},
|
},
|
||||||
|
|
||||||
SCSICommandData:
|
.SCSICommandData =
|
||||||
{
|
{
|
||||||
SCSI_CMD_TEST_UNIT_READY,
|
SCSI_CMD_TEST_UNIT_READY,
|
||||||
0x00, // Reserved
|
0x00, // Reserved
|
||||||
@ -583,17 +583,17 @@ uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, SCSI_Capacity_t* const Ca
|
|||||||
/* Create a CBW with a SCSI command to issue READ CAPACITY command */
|
/* Create a CBW with a SCSI command to issue READ CAPACITY command */
|
||||||
SCSICommandBlock = (CommandBlockWrapper_t)
|
SCSICommandBlock = (CommandBlockWrapper_t)
|
||||||
{
|
{
|
||||||
Header:
|
.Header =
|
||||||
{
|
{
|
||||||
Signature: CBW_SIGNATURE,
|
.Signature = CBW_SIGNATURE,
|
||||||
Tag: MassStore_Tag,
|
.Tag = MassStore_Tag,
|
||||||
DataTransferLength: 8,
|
.DataTransferLength = 8,
|
||||||
Flags: COMMAND_DIRECTION_DATA_IN,
|
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||||
LUN: LUNIndex,
|
.LUN = LUNIndex,
|
||||||
SCSICommandLength: 10
|
.SCSICommandLength = 10
|
||||||
},
|
},
|
||||||
|
|
||||||
SCSICommandData:
|
.SCSICommandData =
|
||||||
{
|
{
|
||||||
SCSI_CMD_READ_CAPACITY_10,
|
SCSI_CMD_READ_CAPACITY_10,
|
||||||
0x00, // Reserved
|
0x00, // Reserved
|
||||||
@ -655,17 +655,17 @@ uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, const bool P
|
|||||||
/* Create a CBW with a SCSI command to issue PREVENT ALLOW MEDIUM REMOVAL command */
|
/* Create a CBW with a SCSI command to issue PREVENT ALLOW MEDIUM REMOVAL command */
|
||||||
SCSICommandBlock = (CommandBlockWrapper_t)
|
SCSICommandBlock = (CommandBlockWrapper_t)
|
||||||
{
|
{
|
||||||
Header:
|
.Header =
|
||||||
{
|
{
|
||||||
Signature: CBW_SIGNATURE,
|
.Signature = CBW_SIGNATURE,
|
||||||
Tag: MassStore_Tag,
|
.Tag = MassStore_Tag,
|
||||||
DataTransferLength: 0,
|
.DataTransferLength = 0,
|
||||||
Flags: COMMAND_DIRECTION_DATA_OUT,
|
.Flags = COMMAND_DIRECTION_DATA_OUT,
|
||||||
LUN: LUNIndex,
|
.LUN = LUNIndex,
|
||||||
SCSICommandLength: 6
|
.SCSICommandLength = 6
|
||||||
},
|
},
|
||||||
|
|
||||||
SCSICommandData:
|
.SCSICommandData =
|
||||||
{
|
{
|
||||||
SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL,
|
SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL,
|
||||||
0x00, // Reserved
|
0x00, // Reserved
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Mouse_Host , TaskStatus: TASK_STOP },
|
{ .Task = USB_Mouse_Host , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -250,11 +250,11 @@ TASK(USB_Mouse_Host)
|
|||||||
/* Standard request to set the device configuration to configuration 1 */
|
/* Standard request to set the device configuration to configuration 1 */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetConfiguration,
|
.bRequest = REQ_SetConfiguration,
|
||||||
wValue: 1,
|
.wValue = 1,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
@ -300,11 +300,11 @@ TASK(USB_Mouse_Host)
|
|||||||
/* HID class request to set the mouse protocol to the Boot Protocol */
|
/* HID class request to set the mouse protocol to the Boot Protocol */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
|
||||||
bRequest: REQ_SetProtocol,
|
.bRequest = REQ_SetProtocol,
|
||||||
wValue: 0,
|
.wValue = 0,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -49,11 +49,11 @@ uint8_t GetHIDReportData(void)
|
|||||||
|
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
|
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
|
||||||
bRequest: REQ_GetDescriptor,
|
.bRequest = REQ_GetDescriptor,
|
||||||
wValue: (DTYPE_Report << 8),
|
.wValue = (DTYPE_Report << 8),
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: HIDReportSize,
|
.wLength = HIDReportSize,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Mouse_Host , TaskStatus: TASK_STOP },
|
{ .Task = USB_Mouse_Host , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -187,11 +187,11 @@ TASK(USB_Mouse_Host)
|
|||||||
/* Standard request to set the device configuration to configuration 1 */
|
/* Standard request to set the device configuration to configuration 1 */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetConfiguration,
|
.bRequest = REQ_SetConfiguration,
|
||||||
wValue: 1,
|
.wValue = 1,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -265,11 +265,11 @@ uint8_t SImage_ClearPipeStall(const uint8_t EndpointNum)
|
|||||||
{
|
{
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),
|
||||||
bRequest: REQ_ClearFeature,
|
.bRequest = REQ_ClearFeature,
|
||||||
wValue: FEATURE_ENDPOINT_HALT,
|
.wValue = FEATURE_ENDPOINT_HALT,
|
||||||
wIndex: EndpointNum,
|
.wIndex = EndpointNum,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_SImage_Host , TaskStatus: TASK_STOP },
|
{ .Task = USB_SImage_Host , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -153,11 +153,11 @@ TASK(USB_SImage_Host)
|
|||||||
/* Standard request to set the device configuration to configuration 1 */
|
/* Standard request to set the device configuration to configuration 1 */
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetConfiguration,
|
.bRequest = REQ_SetConfiguration,
|
||||||
wValue: 1,
|
.wValue = 1,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Select the control pipe for the request transfer */
|
/* Select the control pipe for the request transfer */
|
||||||
@ -211,11 +211,11 @@ TASK(USB_SImage_Host)
|
|||||||
|
|
||||||
PIMA_SendBlock = (PIMA_Container_t)
|
PIMA_SendBlock = (PIMA_Container_t)
|
||||||
{
|
{
|
||||||
DataLength: PIMA_COMMAND_SIZE(0),
|
.DataLength = PIMA_COMMAND_SIZE(0),
|
||||||
Type: CType_CommandBlock,
|
.Type = CType_CommandBlock,
|
||||||
Code: PIMA_OPERATION_GETDEVICEINFO,
|
.Code = PIMA_OPERATION_GETDEVICEINFO,
|
||||||
TransactionID: 0x00000000,
|
.TransactionID = 0x00000000,
|
||||||
Params: {},
|
.Params = {},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Send the GETDEVICEINFO block */
|
/* Send the GETDEVICEINFO block */
|
||||||
@ -290,11 +290,11 @@ TASK(USB_SImage_Host)
|
|||||||
|
|
||||||
PIMA_SendBlock = (PIMA_Container_t)
|
PIMA_SendBlock = (PIMA_Container_t)
|
||||||
{
|
{
|
||||||
DataLength: PIMA_COMMAND_SIZE(1),
|
.DataLength = PIMA_COMMAND_SIZE(1),
|
||||||
Type: CType_CommandBlock,
|
.Type = CType_CommandBlock,
|
||||||
Code: PIMA_OPERATION_OPENSESSION,
|
.Code = PIMA_OPERATION_OPENSESSION,
|
||||||
TransactionID: 0x00000000,
|
.TransactionID = 0x00000000,
|
||||||
Params: {0x00000001},
|
.Params = {0x00000001},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Send the OPENSESSION block, open a session with an ID of 0x0001 */
|
/* Send the OPENSESSION block, open a session with an ID of 0x0001 */
|
||||||
@ -318,11 +318,11 @@ TASK(USB_SImage_Host)
|
|||||||
|
|
||||||
PIMA_SendBlock = (PIMA_Container_t)
|
PIMA_SendBlock = (PIMA_Container_t)
|
||||||
{
|
{
|
||||||
DataLength: PIMA_COMMAND_SIZE(1),
|
.DataLength = PIMA_COMMAND_SIZE(1),
|
||||||
Type: CType_CommandBlock,
|
.Type = CType_CommandBlock,
|
||||||
Code: PIMA_OPERATION_CLOSESESSION,
|
.Code = PIMA_OPERATION_CLOSESESSION,
|
||||||
TransactionID: 0x00000001,
|
.TransactionID = 0x00000001,
|
||||||
Params: {0x00000001},
|
.Params = {0x00000001},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Send the CLOSESESSION block, close the session with an ID of 0x0001 */
|
/* Send the CLOSESESSION block, close the session with an ID of 0x0001 */
|
||||||
|
@ -44,24 +44,24 @@
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2040,
|
.ProductID = 0x2040,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -71,37 +71,37 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: ( sizeof(USB_Descriptor_Configuration_Header_t)
|
.TotalConfigurationSize = ( sizeof(USB_Descriptor_Configuration_Header_t)
|
||||||
+ sizeof(USB_Descriptor_Interface_t) ),
|
+ sizeof(USB_Descriptor_Interface_t) ),
|
||||||
|
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
Interface:
|
.Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 1,
|
.InterfaceNumber = 1,
|
||||||
AlternateSetting: 0,
|
.AlternateSetting = 0,
|
||||||
|
|
||||||
TotalEndpoints: 0,
|
.TotalEndpoints = 0,
|
||||||
|
|
||||||
Class: 0xFF,
|
.Class = 0xFF,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -111,9 +111,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -122,9 +122,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(11), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera"
|
.UnicodeString = L"Dean Camera"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -133,9 +133,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(9), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(9), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"LUFA Demo"
|
.UnicodeString = L"LUFA Demo"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: TestApp_CheckJoystick, TaskStatus: TASK_RUN },
|
{ .Task = TestApp_CheckJoystick, .TaskStatus = TASK_RUN },
|
||||||
{ Task: TestApp_CheckHWB , TaskStatus: TASK_RUN },
|
{ .Task = TestApp_CheckHWB , .TaskStatus = TASK_RUN },
|
||||||
{ Task: TestApp_CheckTemp , TaskStatus: TASK_RUN },
|
{ .Task = TestApp_CheckTemp , .TaskStatus = TASK_RUN },
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_RUN },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_RUN },
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Main program entry point. This routine configures the hardware required by the application, then
|
/** Main program entry point. This routine configures the hardware required by the application, then
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
* - Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMouse demos (thanks to Brian Dickman)
|
* - Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMouse demos (thanks to Brian Dickman)
|
||||||
* - Capitalised the "Descriptor_Search" and "Descriptor_Search_Comp" prefixes of the values in the DSearch_Return_ErrorCodes_t and
|
* - Capitalised the "Descriptor_Search" and "Descriptor_Search_Comp" prefixes of the values in the DSearch_Return_ErrorCodes_t and
|
||||||
* DSearch_Comp_Return_ErrorCodes_t enums
|
* DSearch_Comp_Return_ErrorCodes_t enums
|
||||||
|
* - Changed over all deprecated GCC structure tag initializers to the standardized C99 format (thanks to Mike Alexander)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* \section Sec_ChangeLog090401 Version 090401
|
* \section Sec_ChangeLog090401 Version 090401
|
||||||
|
@ -37,11 +37,11 @@ uint8_t USB_GetDeviceConfigDescriptor(uint16_t* const ConfigSizePtr, void* Buffe
|
|||||||
|
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_GetDescriptor,
|
.bRequest = REQ_GetDescriptor,
|
||||||
wValue: (DTYPE_Configuration << 8),
|
.wValue = (DTYPE_Configuration << 8),
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: sizeof(USB_Descriptor_Configuration_Header_t),
|
.wLength = sizeof(USB_Descriptor_Configuration_Header_t),
|
||||||
};
|
};
|
||||||
|
|
||||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||||
|
@ -171,11 +171,11 @@ static void USB_HostTask(void)
|
|||||||
case HOST_STATE_Default:
|
case HOST_STATE_Default:
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_GetDescriptor,
|
.bRequest = REQ_GetDescriptor,
|
||||||
wValue: (DTYPE_Device << 8),
|
.wValue = (DTYPE_Device << 8),
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: PIPE_CONTROLPIPE_DEFAULT_SIZE,
|
.wLength = PIPE_CONTROLPIPE_DEFAULT_SIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8_t DataBuffer[PIPE_CONTROLPIPE_DEFAULT_SIZE];
|
uint8_t DataBuffer[PIPE_CONTROLPIPE_DEFAULT_SIZE];
|
||||||
@ -216,11 +216,11 @@ static void USB_HostTask(void)
|
|||||||
|
|
||||||
USB_HostRequest = (USB_Host_Request_Header_t)
|
USB_HostRequest = (USB_Host_Request_Header_t)
|
||||||
{
|
{
|
||||||
bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
|
||||||
bRequest: REQ_SetAddress,
|
.bRequest = REQ_SetAddress,
|
||||||
wValue: USB_HOST_DEVICEADDRESS,
|
.wValue = USB_HOST_DEVICEADDRESS,
|
||||||
wIndex: 0,
|
.wIndex = 0,
|
||||||
wLength: 0,
|
.wLength = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((SubErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
if ((SubErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
|
||||||
|
@ -805,8 +805,8 @@
|
|||||||
*
|
*
|
||||||
* \ingroup Group_PipeRW
|
* \ingroup Group_PipeRW
|
||||||
*/
|
*/
|
||||||
static inline void Pipe_Ignore_DWord(void) ATTR_ALWAYS_INLINE;
|
static inline void Pipe_Discard_DWord(void) ATTR_ALWAYS_INLINE;
|
||||||
static inline void Pipe_Ignore_DWord(void)
|
static inline void Pipe_Discard_DWord(void)
|
||||||
{
|
{
|
||||||
uint8_t Dummy;
|
uint8_t Dummy;
|
||||||
|
|
||||||
@ -854,8 +854,6 @@
|
|||||||
/** Spinloops until the currently selected non-control pipe is ready for the next packed of data
|
/** Spinloops until the currently selected non-control pipe is ready for the next packed of data
|
||||||
* to be read or written to it.
|
* to be read or written to it.
|
||||||
*
|
*
|
||||||
* \note This routine should not be called on CONTROL type pipes.
|
|
||||||
*
|
|
||||||
* \ingroup Group_PipeRW
|
* \ingroup Group_PipeRW
|
||||||
*
|
*
|
||||||
* \return A value from the Pipe_WaitUntilReady_ErrorCodes_t enum.
|
* \return A value from the Pipe_WaitUntilReady_ErrorCodes_t enum.
|
||||||
|
@ -38,8 +38,8 @@ struct
|
|||||||
uint8_t Mem_Block_Flags[(NUM_BLOCKS / 4) + ((NUM_BLOCKS % 4) ? 1 : 0)];
|
uint8_t Mem_Block_Flags[(NUM_BLOCKS / 4) + ((NUM_BLOCKS % 4) ? 1 : 0)];
|
||||||
uint8_t FlagMaskLookupMask[4];
|
uint8_t FlagMaskLookupMask[4];
|
||||||
uint8_t FlagMaskLookupNum[4];
|
uint8_t FlagMaskLookupNum[4];
|
||||||
} Mem_MemData = {FlagMaskLookupMask: {(3 << 0), (3 << 2), (3 << 4), (3 << 6)},
|
} Mem_MemData = {.FlagMaskLookupMask = {(3 << 0), (3 << 2), (3 << 4), (3 << 6)},
|
||||||
FlagMaskLookupNum: { 0, 2, 4, 6}};
|
.FlagMaskLookupNum = { 0, 2, 4, 6}};
|
||||||
|
|
||||||
static uint8_t Mem_GetBlockFlags(const Block_Number_t BlockNum)
|
static uint8_t Mem_GetBlockFlags(const Block_Number_t BlockNum)
|
||||||
{
|
{
|
||||||
|
@ -54,7 +54,8 @@
|
|||||||
* - All pipe read/write/discard aliases which did not have an explicitly endianness specifier (such as Pipe_Read_Word()) have
|
* - All pipe read/write/discard aliases which did not have an explicitly endianness specifier (such as Pipe_Read_Word()) have
|
||||||
* been removed for clarity. Existing projects should use the "_LE" suffix on such calls to use the explicit Little Endian versions.
|
* been removed for clarity. Existing projects should use the "_LE" suffix on such calls to use the explicit Little Endian versions.
|
||||||
* - The Host_IsResetBusDone() macro has been renamed to Host_IsBusResetComplete().
|
* - The Host_IsResetBusDone() macro has been renamed to Host_IsBusResetComplete().
|
||||||
* - The Pipe_Ignore_Word() function has been renamed to Pipe_Discard_Word() to remain consistent with the rest of the pipe API.
|
* - The Pipe_Ignore_Word() and Pipe_Ignore_DWord() functions have been renamed to Pipe_Discard_Word() and Pipe_Discard_DWord() to remain
|
||||||
|
* consistent with the rest of the pipe API.
|
||||||
* - It is no longer needed to manually include the headers from LUFA/Drivers/USB/Class, as they are now included along with the rest
|
* - It is no longer needed to manually include the headers from LUFA/Drivers/USB/Class, as they are now included along with the rest
|
||||||
* of the USB headers when LUFA/Drivers/USB/USB.h is included.
|
* of the USB headers when LUFA/Drivers/USB/USB.h is included.
|
||||||
* - Functions in the ConfigDescriptor.h header file no longer have "Host_" as part of their names.
|
* - Functions in the ConfigDescriptor.h header file no longer have "Host_" as part of their names.
|
||||||
|
@ -55,8 +55,8 @@
|
|||||||
*
|
*
|
||||||
* TASK_LIST
|
* TASK_LIST
|
||||||
* {
|
* {
|
||||||
* { Task: MyTask1, TaskStatus: TASK_RUN, GroupID: 1 },
|
* { .Task = MyTask1, .TaskStatus = TASK_RUN, .GroupID = 1 },
|
||||||
* { Task: MyTask2, TaskStatus: TASK_RUN, GroupID: 1 },
|
* { .Task = MyTask2, .TaskStatus = TASK_RUN, .GroupID = 1 },
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* int main(void)
|
* int main(void)
|
||||||
@ -115,7 +115,7 @@
|
|||||||
* \code
|
* \code
|
||||||
* TASK_LIST
|
* TASK_LIST
|
||||||
* {
|
* {
|
||||||
* { Task: MyTask1, TaskStatus: TASK_RUN, GroupID: 1 },
|
* { .Task = MyTask1, .TaskStatus = TASK_RUN, .GroupID = 1 },
|
||||||
* // More task entries here
|
* // More task entries here
|
||||||
* }
|
* }
|
||||||
* \endcode
|
* \endcode
|
||||||
|
@ -78,24 +78,24 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Device_t), Type: DTYPE_Device},
|
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
|
||||||
|
|
||||||
USBSpecification: VERSION_BCD(01.10),
|
.USBSpecification = VERSION_BCD(01.10),
|
||||||
Class: 0x00,
|
.Class = 0x00,
|
||||||
SubClass: 0x00,
|
.SubClass = 0x00,
|
||||||
Protocol: 0x00,
|
.Protocol = 0x00,
|
||||||
|
|
||||||
Endpoint0Size: 8,
|
.Endpoint0Size = 8,
|
||||||
|
|
||||||
VendorID: 0x03EB,
|
.VendorID = 0x03EB,
|
||||||
ProductID: 0x2042,
|
.ProductID = 0x2042,
|
||||||
ReleaseNumber: 0x0000,
|
.ReleaseNumber = 0x0000,
|
||||||
|
|
||||||
ManufacturerStrIndex: 0x01,
|
.ManufacturerStrIndex = 0x01,
|
||||||
ProductStrIndex: 0x02,
|
.ProductStrIndex = 0x02,
|
||||||
SerialNumStrIndex: NO_DESCRIPTOR,
|
.SerialNumStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
NumberOfConfigurations: 1
|
.NumberOfConfigurations = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
|
||||||
@ -105,56 +105,56 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
||||||
{
|
{
|
||||||
Config:
|
.Config =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Configuration_Header_t), Type: DTYPE_Configuration},
|
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
|
||||||
|
|
||||||
TotalConfigurationSize: sizeof(USB_Descriptor_Configuration_t),
|
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
|
||||||
TotalInterfaces: 1,
|
.TotalInterfaces = 1,
|
||||||
|
|
||||||
ConfigurationNumber: 1,
|
.ConfigurationNumber = 1,
|
||||||
ConfigurationStrIndex: NO_DESCRIPTOR,
|
.ConfigurationStrIndex = NO_DESCRIPTOR,
|
||||||
|
|
||||||
ConfigAttributes: (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
.ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
|
||||||
|
|
||||||
MaxPowerConsumption: USB_CONFIG_POWER_MA(100)
|
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
|
||||||
},
|
},
|
||||||
|
|
||||||
Interface:
|
.Interface =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Interface_t), Type: DTYPE_Interface},
|
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||||
|
|
||||||
InterfaceNumber: 0x00,
|
.InterfaceNumber = 0x00,
|
||||||
AlternateSetting: 0x00,
|
.AlternateSetting = 0x00,
|
||||||
|
|
||||||
TotalEndpoints: 1,
|
.TotalEndpoints = 1,
|
||||||
|
|
||||||
Class: 0x03,
|
.Class = 0x03,
|
||||||
SubClass: 0x01,
|
.SubClass = 0x01,
|
||||||
Protocol: 0x01,
|
.Protocol = 0x01,
|
||||||
|
|
||||||
InterfaceStrIndex: NO_DESCRIPTOR
|
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardHID:
|
.KeyboardHID =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_HID_t), Type: DTYPE_HID},
|
.Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
|
||||||
|
|
||||||
HIDSpec: VERSION_BCD(01.11),
|
.HIDSpec = VERSION_BCD(01.11),
|
||||||
CountryCode: 0x00,
|
.CountryCode = 0x00,
|
||||||
TotalHIDReports: 0x01,
|
.TotalHIDReports = 0x01,
|
||||||
HIDReportType: DTYPE_Report,
|
.HIDReportType = DTYPE_Report,
|
||||||
HIDReportLength: sizeof(KeyboardReport)
|
.HIDReportLength = sizeof(KeyboardReport)
|
||||||
},
|
},
|
||||||
|
|
||||||
KeyboardEndpoint:
|
.KeyboardEndpoint =
|
||||||
{
|
{
|
||||||
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
|
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
|
||||||
|
|
||||||
EndpointAddress: (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
|
.EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | KEYBOARD_EPNUM),
|
||||||
Attributes: EP_TYPE_INTERRUPT,
|
.Attributes = EP_TYPE_INTERRUPT,
|
||||||
EndpointSize: KEYBOARD_EPSIZE,
|
.EndpointSize = KEYBOARD_EPSIZE,
|
||||||
PollingIntervalMS: 0x04
|
.PollingIntervalMS = 0x04
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -163,9 +163,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||||||
* via the language ID table available at USB.org what languages the device supports for its string descriptors. */
|
* via the language ID table available at USB.org what languages the device supports for its string descriptors. */
|
||||||
USB_Descriptor_String_t PROGMEM LanguageString =
|
USB_Descriptor_String_t PROGMEM LanguageString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(1), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: {LANGUAGE_ID_ENG}
|
.UnicodeString = {LANGUAGE_ID_ENG}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
|
||||||
@ -174,9 +174,9 @@ USB_Descriptor_String_t PROGMEM LanguageString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
USB_Descriptor_String_t PROGMEM ManufacturerString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(32), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(32), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Dean Camera and Denver Gingerich"
|
.UnicodeString = L"Dean Camera and Denver Gingerich"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
|
||||||
@ -185,9 +185,9 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
|
|||||||
*/
|
*/
|
||||||
USB_Descriptor_String_t PROGMEM ProductString =
|
USB_Descriptor_String_t PROGMEM ProductString =
|
||||||
{
|
{
|
||||||
Header: {Size: USB_STRING_LEN(20), Type: DTYPE_String},
|
.Header = {.Size = USB_STRING_LEN(20), .Type = DTYPE_String},
|
||||||
|
|
||||||
UnicodeString: L"Magnetic Card Reader"
|
.UnicodeString = L"Magnetic Card Reader"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||||
|
@ -40,9 +40,9 @@
|
|||||||
/* Scheduler Task List */
|
/* Scheduler Task List */
|
||||||
TASK_LIST
|
TASK_LIST
|
||||||
{
|
{
|
||||||
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
|
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },
|
||||||
{ Task: USB_Keyboard_Report , TaskStatus: TASK_STOP },
|
{ .Task = USB_Keyboard_Report , .TaskStatus = TASK_STOP },
|
||||||
{ Task: Magstripe_Read , TaskStatus: TASK_STOP },
|
{ .Task = Magstripe_Read , .TaskStatus = TASK_STOP },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Global Variables */
|
/* Global Variables */
|
||||||
|
Loading…
Reference in New Issue
Block a user