本文整理汇总了C++中USB_STRING_LEN函数的典型用法代码示例。如果您正苦于以下问题:C++ USB_STRING_LEN函数的具体用法?C++ USB_STRING_LEN怎么用?C++ USB_STRING_LEN使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了USB_STRING_LEN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: USB_Device_GetInternalSerialDescriptor
static void USB_Device_GetInternalSerialDescriptor(void)
{
struct
{
USB_Descriptor_Header_t Header;
uint16_t UnicodeString[INTERNAL_SERIAL_LENGTH_BITS / 4];
} SignatureDescriptor;
SignatureDescriptor.Header.Type = DTYPE_String;
SignatureDescriptor.Header.Size = USB_STRING_LEN(INTERNAL_SERIAL_LENGTH_BITS / 4);
USB_Device_GetSerialString(SignatureDescriptor.UnicodeString);
Endpoint_ClearSETUP();
Endpoint_Write_Control_Stream_LE(&SignatureDescriptor, sizeof(SignatureDescriptor));
Endpoint_ClearOUT();
}
示例2: sizeof
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DIR_OUT | AVRISP_DATA_OUT_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AVRISP_DATA_EPSIZE,
.PollingIntervalMS = 0x0A
},
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
const USB_Descriptor_String_t PROGMEM AVRISP_LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t PROGMEM AVRISP_ManufacturerString =
{
.Header = {.Size = USB_STRING_LEN(5), .Type = DTYPE_String},
.UnicodeString = L"ATMEL"
};
示例3: sizeof
.DATA_InfoEndpoint = {
.Header = {
.Size = sizeof(USB_Descriptor_Endpoint_t),
.Type = DTYPE_Endpoint
},
.EndpointAddress = (ENDPOINT_DIR_IN | INFO_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = INFO_EPSIZE,
.PollingIntervalMS = 0x0
},
};
const USB_Descriptor_String_t PROGMEM LanguageString = {
.Header = {
.Size = USB_STRING_LEN(1),
.Type = DTYPE_String
},
.UnicodeString = {
LANGUAGE_ID_ENG
},
};
const USB_Descriptor_String_t PROGMEM ManufacturerString = {
.Header = {
.Size = USB_STRING_LEN(6),
.Type = DTYPE_String
},
.UnicodeString = L"jwatte",
};
示例4: defined
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
},
#if defined(USB_DEVICE_ROM_DRIVER) && defined(__LPC11UXX__) || defined(__LPC13UXX__)
// Required by IP3511
.Configuration_Termination = 0x00
#endif
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
uint8_t LanguageString[] =
{
USB_STRING_LEN(1),
DTYPE_String,
WBVAL(LANGUAGE_ID_ENG),
};
USB_Descriptor_String_t *LanguageStringPtr = (USB_Descriptor_String_t*)LanguageString;
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
uint8_t ManufacturerString[] =
{
USB_STRING_LEN(3),
DTYPE_String,
WBVAL('N'),
WBVAL('X'),
示例5: sizeof
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_EPNUM),
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = KEYBOARD_EPSIZE,
.PollingIntervalMS = 0x01
},
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors. */
const USB_Descriptor_String_t PROGMEM LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
.Header = {.Size = USB_STRING_LEN(32), .Type = DTYPE_String},
.UnicodeString = L"Dean Camera and Denver Gingerich"
};
示例6: USB_STRING_LEN
.PollingIntervalMS = 0x00
},
};
/**
* Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
const USB_Descriptor_String_t PROGMEM LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
/**
* Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
//.UnicodeString = L"Dean Camera"
#if defined CHERRY_COMPACT
.Header = {.Size = USB_STRING_LEN(6), .Type = DTYPE_String},
示例7: USB_STRING_LEN
.Class = 0xFF,
.SubClass = 0x00,
.Protocol = 0x00,
.InterfaceStrIndex = NO_DESCRIPTOR
}
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
USB_Descriptor_String_t PROGMEM LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
USB_Descriptor_String_t PROGMEM ManufacturerString =
{
.Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
.UnicodeString = L"www.AVRopendous.org"
};
示例8: defined
*/
#include "UsbRom.h"
#if defined(USB_DEVICE_ROM_DRIVER)
/*****************************************************************************
* Private types/enumerations/variables
****************************************************************************/
/*****************************************************************************
* Public types/enumerations/variables
****************************************************************************/
uint8_t StringDescriptor[] = {
USB_STRING_LEN(1), /* LanguageString */
DTYPE_String,
WBVAL(LANGUAGE_ID_ENG),
USB_STRING_LEN(3), /* ManufacturerString */
DTYPE_String,
WBVAL('N'), WBVAL('X'), WBVAL('P'),
USB_STRING_LEN(22 + 1), /* ProductString */
DTYPE_String,
WBVAL('L'), WBVAL('P'), WBVAL('C'), WBVAL('U'), WBVAL('S'), WBVAL('B'), WBVAL('l'), WBVAL('i'), WBVAL('b'), WBVAL(
' '),
WBVAL('K'), WBVAL('e'), WBVAL('y'), WBVAL('b'), WBVAL('o'), WBVAL('a'), WBVAL('r'), WBVAL('d'), WBVAL(' '),
WBVAL('D'), WBVAL('e'), WBVAL('m'), WBVAL('o')
};
extern USB_Descriptor_Device_t DeviceDescriptor;
示例9: USB_STRING_LEN
// .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MOUSE_EPNUM),
.EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM),
// End
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MOUSE_EPSIZE,
.PollingIntervalMS = 0x01
},
.HID_Termination = 0x00
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
uint8_t LanguageString[] = {
USB_STRING_LEN(1),
DTYPE_String,
WBVAL(LANGUAGE_ID_ENG),
};
USB_Descriptor_String_t *LanguageStringPtr = (USB_Descriptor_String_t *) LanguageString;
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
uint8_t ManufacturerString[] = {
USB_STRING_LEN(3),
DTYPE_String,
WBVAL('N'),
WBVAL('X'),
WBVAL('P'),
示例10: sizeof
},
.CDC_DataInEndpoint = {
.Header = {
.Size = sizeof(USB_Descriptor_Endpoint_t),
.Type = DTYPE_Endpoint,
},
.EndpointAddress = DEMO_CDC_TX_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = DEMO_CDC_TXRX_EPSIZE,
.PollingIntervalMS = 0x05,
}
};
const USB_Descriptor_String_t PROGMEM language_string = {
.Header = {
.Size = USB_STRING_LEN(1),
.Type = DTYPE_String,
},
.UnicodeString = {
LANGUAGE_ID_ENG,
},
};
const USB_Descriptor_String_t PROGMEM manufacturer_string = {
.Header = {
.Size = USB_STRING_LEN(DEMO_MANUFACTURER_STR_LEN),
.Type = DTYPE_String,
},
.UnicodeString = DEMO_MANUFACTURER_STR,
};
示例11: USB_STRING_LEN
.EndpointAddress = (ENDPOINT_DIR_OUT | LABTOOL_OUT_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = LABTOOL_IO_EPSIZE,
.PollingIntervalMS = 0x01
},
.LabTool_Termination = 0x00
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
uint8_t LanguageString[] =
{
USB_STRING_LEN(1),
DTYPE_String,
WBVAL(LANGUAGE_ID_ENG),
};
USB_Descriptor_String_t *LanguageStringPtr = (USB_Descriptor_String_t*)LanguageString;
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
uint8_t ManufacturerString[] =
{
USB_STRING_LEN(16),
DTYPE_String,
WBVAL('E'),
WBVAL('m'),
示例12: sizeof
.bInterfaceSubClass = 0x00,
.bInterfaceProtocol = 0x00,
.iInterface = 0x11,
},
.ReportInEndpoint = {
.bLength = sizeof(USB_EndpointDescriptor),
.bDescriptorType = USB_DTYPE_Endpoint,
.bEndpointAddress = USB_EP_REPORT_IN,
.bmAttributes = (USB_EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.wMaxPacketSize = 8,
.bInterval = 10,
},
};
__attribute__((__aligned__(4))) const USB_StringDescriptor language_string = {
.bLength = USB_STRING_LEN(1),
.bDescriptorType = USB_DTYPE_String,
.bString = {USB_LANGUAGE_EN_US},
};
__attribute__((__aligned__(4))) const USB_StringDescriptor msft_os = {
.bLength = 18,
.bDescriptorType = USB_DTYPE_String,
.bString = u"MSFT100\xee"
};
__attribute__((__aligned__(4))) const USB_MicrosoftCompatibleDescriptor msft_compatible = {
.dwLength = sizeof(USB_MicrosoftCompatibleDescriptor) + sizeof(USB_MicrosoftCompatibleDescriptor_Interface),
.bcdVersion = 0x0100,
.wIndex = 0x0004,
.bCount = 1,
示例13: sizeof
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
.EndpointAddress = OUT_EPNUM,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = EPSIZE,
.PollingIntervalMS = 0x05
}
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
const USB_Descriptor_String_t PROGMEM LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
.Header = {.Size = USB_STRING_LEN(8), .Type = DTYPE_String},
.UnicodeString = L"Logitech"
};
示例14: sizeof
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
.EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
},
.MS_Termination = 0x00
};
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
uint8_t LanguageString[] = {
USB_STRING_LEN(1),
DTYPE_String,
WBVAL(LANGUAGE_ID_ENG),
};
USB_Descriptor_String_t *LanguageStringPtr = (USB_Descriptor_String_t *) LanguageString;
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
uint8_t ManufacturerString[] = {
USB_STRING_LEN(3),
DTYPE_String,
WBVAL('s'),
WBVAL('v'),
WBVAL('o'),
示例15: sizeof
.endpoint = {
.Header = {
.Size = sizeof (USB_Descriptor_Endpoint_t),
.Type = DTYPE_Endpoint
},
.EndpointAddress = MY_EPADDR,
.Attributes = \
(EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MY_EPSIZE,
.PollingIntervalMS = 5
},
};
const USB_Descriptor_String_t PROGMEM LanguageString = {
.Header = {
.Size = USB_STRING_LEN(1),
.Type = DTYPE_String
},
.UnicodeString = {
LANGUAGE_ID_ENG
}
};
#define USBSTRING_INITIALIZER(str) \
{ \
.Header = { \
.Size = USB_STRING_LEN(sizeof (str) / sizeof (str[0]) - 1), \
.Type = DTYPE_String \
}, \
.UnicodeString = L##str \
}