AN249 Silicon_Laboratories, AN249 Datasheet - Page 18

no-image

AN249

Manufacturer Part Number
AN249
Description
Human Interface Device Tutorial
Manufacturer
Silicon_Laboratories
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN2490NFHP
Manufacturer:
PANASONIC/松下
Quantity:
20 000
Part Number:
AN2491NFHP
Manufacturer:
PANASON
Quantity:
5 510
Part Number:
AN2491NFHP
Manufacturer:
MAXIM
Quantity:
5 510
AN249
5.4.7. String Descriptors
The USB device stores character strings defining the Product, the Manufacturer, the Serial Number, and other
descriptive texts. A String Descriptor Table stores the memory addresses of these strings. The host retrieves
strings through a standard request call that passes the index of the requested string.
The firmware template defines the following String Description Table:
BYTE* const StringDescTable[] =
{
};
The first String Descriptor of the String Descriptor Table, shown above to be defined
as String0Desc, contains special information about the strings contained within the
table. The Firmware Template defines String0Desc as follows:
code const BYTE String0Desc[STR0LEN] =
{
}; //end of String0Desc
The first byte of this descriptor defines the descriptor's length, and the second byte defines this array as a String
Descriptor. The next two bytes form the Language ID code, which the host can use to determine how to interpret
characters in the other strings of the String Descriptor Table. “0x09” indicates that the strings use the English
language, and the “0x04” subcode indicates that the English language type is U.S. English.
Each element that follows the first special descriptor holds an address to a string. The first byte of each String
Descriptor defines the length of the String Descriptor, and the second byte tags the array as a String Descriptor.
After the first two bytes, all remaining bytes are two-byte Unicode-formatted string characters. For most strings, the
Unicode values will store the ANSI character in the low byte and a “0” in the high byte. Following USB's little endian
format requirement, each character will appear in the String Descriptor with the ANSI character followed by a 0. For
example, the firmware template would define the string “Silicon Laboratories” as follows:
code const BYTE String1Desc[STR1LEN] =
{
18
String0Desc,
String1Desc,
String2Desc
STR0LEN, 0x03, 0x09, 0x04
STR1LEN, 0x03,
'S', 0,
'I', 0,
'L', 0,
'I', 0,
'C', 0,
'O', 0,
'N', 0,
' ', 0,
'L', 0,
'A', 0,
'B', 0,
'O', 0,
'R', 0,
'A', 0,
Rev. 0.2

Related parts for AN249