an144rev1_2

  • 格式:pdf
  • 大小:341.76 KB
  • 文档页数:20

Rev. 1.2 12/03Copyright © 2003 by Silicon LaboratoriesAN144-12AN144CP2101 C U S T O M I Z A T I O N G U I D ERelevant Devices This application note applies to the following devices:CP2101Introduction This document is intended for developers creating products based on the CP2101 USB to UART Bridge Controller. It provides information about obtaining a Vendor ID (VID) and Product ID (PID)for a CP2101 product. It also describes the stepsnecessary for customizing the device driver instal-lation and for customizing the device descriptors contained in the CP2101 EEPROM.Obtaining a VID and PID Each device on a single USB bus must have a unique VID, PID and Serial Number combination. Vendor IDs are owned by the vendor company and are assigned by the USB Implementers Forum(USB-IF) only. Details about obtaining a unique VID can be found at /developers/vendor .To obtain the right to license the USB-IF logo youmust register your product's VID and PID withUSB-IF and submit your product to the USB-IFCompliance Program. USB-IF Compliance Pro-gram details can be found at /developers/compliance . Once your product hasbeen certified it can be added to the USB-IF Inte-grators List, and the "Certified USB" logo can beused on your product.If you do not wish to license the USB-IF logo thedefault Silicon Labs VID can be used. We recom-mend obtaining a unique PID for your product. Toobtain a unique PID contact Silicon Labs and one will be assigned to your product. Having a uniquePID will reduce the chances that another device with the same VID, PID and Serial Number will be encountered on the same USB bus.AN1442Rev. 1.2The driver installation is customizable by modifying certain sections of the hardware installation files (.INF). The strings contained in the .INF files will affect what is displayed in the "Found New Hardware" dialogs, the "Found New Hardware Wizard" dialogs, Device Manager and the registry. The changes to the VID and PID should match the VID and PID contained in the EEPROM of your product (see “Cus-tomizing Device Descriptors” on page 6 and “CP2101 Host API Functions” on page 8).Note: Any changes to the .INF files of the Windows installation will require new WHQL tests.Windows 2000/XPModifying VID and PIDTo customize the Windows 2000/XP driver installation open the .INF files named cyg_w2k.inf and cyg_bus.inf. To modify the VID and PID locate the following section in cyg_w2k.inf:;---------------------------------------------------------------------------; Device-by-device entries;---------------------------------------------------------------------------[Cygnal]%m.Desc% = Cygnal.Install, USB\VID_10C4&PID_EA60&MI_00&OS_NTand the following section in cyg_bus.inf:;---------------------------------------------------------------------------; The devices;---------------------------------------------------------------------------[Cygnal]%Cygnal.CdcBus.Desc% = CygnalWdm.Install, USB\VID_10C4&PID_EA60and change the 4 hexadecimal digits after "VID_" and "PID_" to the desired values.Modifying StringsThe only .INF strings that are visible during installation and in Device Manager after installation are m.Desc in cyg_w2k.inf and Cygnal.CdcBus.Desc in cyg_bus.inf. The Product String con-tained in the CP2101 EEPROM is also displayed during installation and modification of this string is described in “Customizing Device Descriptors” on page 6 and “CP2101 Host API Functions” on page 8. The remaining .INF strings can be found after driver installation by searching the Windows registry. To modify the strings locate the following section in cyg_w2k.inf:AN144Rev. 1.23; STRINGS;---------------------------------------------------------------------------[Strings];<<localize the following>>;BEGIN ENG - US English StringsProvider = "Cygnal Integrated Products, Inc."Cygnal = "Cygnal Integrated Products, Inc."DiskString = "CP2101 USB to UART Bridge Controller Drivers"m.Desc = "CP2101 USB to UART Bridge Controller" = "CP2101 USB to UART Bridge Controller Drivers"Cygnal.Service.Desc = "CP2101 USB to UART Bridge Controller Drivers"CustomerDataPath = "CP2101 USB to UART Bridge Controller"DriverSet = "CP2101 USB to UART Bridge Controller Driver Set"and the following section in cyg_bus.inf:;**************************************************************************; Localizable Strings;**************************************************************************[strings];BEGIN ENG - US English StringsProvider = "Cygnal Integrated Products, Inc."Cygnal = "Cygnal Integrated Products, Inc."DiskString = "Cygnal USB Composite Device Installation disk"Cygnal.CdcBus.Desc = "Cygnal USB Composite Device"Cygnal.Service.Desc = "Cygnal USB Composite Device driver (WDM)"CustomerDataPath = "CP2101 USB to UART Bridge Controller"DriverSet = "CP2101 USB to UART Bridge Controller Software"and change the values in quotes to the desired strings.Windows 98Modifying VID and PIDTo customize the Windows 98 driver installation open the .INF files named cyg_wdm.inf and cyg_bus.inf. To modify the VID and PID locate the following section in cyg_w2k.inf:;---------------------------------------------------------------------------; Device-by-device entries;---------------------------------------------------------------------------[Cygnal]%m.Desc% = Cygnal.Install, USB\VID_10C4&PID_EA60&MI_00&OS_9XAN1444Rev. 1.2;---------------------------------------------------------------------------; The devices;---------------------------------------------------------------------------[Cygnal]%Cygnal.CdcBus.Desc% = CygnalWdm.Install, USB\VID_10C4&PID_EA60and change the 4 hexadecimal digits after "VID_" and "PID_" to the desired values.Modifying StringsThe only .INF strings that are visible during installation and in Device Manager after installation are m.Desc in cyg_wmf.inf and Cygnal.CdcBus.Desc in cyg_bus.inf. The Product String con-tained in CP2101 EEPROM is also displayed during installation and modification of this string is described in “Customizing Driver Installations” on page 2 and “CP2101 Host API Functions” on page 8 of this document. The remaining .INF strings can be found after driver installation by searching the Win-dows registry. To modify the strings locate the following section in cyg_wmf.inf:;---------------------------------------------------------------------------; STRINGS;---------------------------------------------------------------------------[Strings];BEGIN ENG - US English StringsProvider = "Cygnal Integrated Products, Inc."Cygnal = "Cygnal Integrated Products, Inc."DiskString = "CP2101 USB to UART Bridge Controller Drivers"m.Desc = "CP2101 USB to UART Bridge Controller"UpperDescription = "CP2101 USB to UART Bridge Controller"CustomerDataPath = "CP2101 USB to UART Bridge Controller"DriverSet = "CP2101 USB to UART Bridge Controller Driver Set"and the following section in cyg_bus.inf:;**************************************************************************; Localizable Strings;**************************************************************************[strings];BEGIN ENG - US English StringsProvider = "Cygnal Integrated Products, Inc."Cygnal = "Cygnal Integrated Products, Inc."DiskString = "Cygnal USB Composite Device Installation disk"Cygnal.CdcBus.Desc = "Cygnal USB Composite Device"Cygnal.Service.Desc = "Cygnal USB Composite Device driver (WDM)"CustomerDataPath = "CP2101 USB to UART Bridge Controller"DriverSet = "CP2101 USB to UART Bridge Controller Software"and change the values in quotes to the desired strings.AN144Rev. 1.25If the VID or PID is changed from the default factory settings, please contact Cygnal Integrated Products to obtain drivers for Mac OS9 that incorporate the new values. Mac OS9 requires that the drivers be compiled with the values that will be used by the production CP2101 device.Macintosh OSXTBDInstalling DriversThe CD-ROM included with the CP2101EK Evaluation Kit contains the Virtual COM Port Drivers for the CP2101. The following files are included on the CD-ROM:•CP2101 datasheet (CP2101.pdf)•Driver installation utility (CP2101_Drivers.exe) •Version information document (Readme.txt)•CP2101 Evaluation Kit User’s Guide (CP2101_UG.pdf)Extract all Virtual COM Port DriversInitial software setup requires running CP2101_Drivers.exe to extract all of the device drivers (Windows and Macintosh). After following the prompts, the utility will copy the driver files to a specified directory or the default directory, “C:\Cygnal\CP2101”. Each set of drivers will be extracted to an appropriately named directory, for example WIN, MAC9, and MAC10.Install Windows Virtual COM Port DriverTo install the Windows virtual COM port driver, run Setup.exe located in the WIN directory created in “Extract all Virtual COM Port Drivers”. Driver files are installed into the “C:\Program Files\CUSB USB to RS-232 Bridge Controller” directory. COM port properties for the device can be selected in the device manager (COM port number, baud rate etc.).Install Macintosh Virtual COM Port DriverTo install the Macintosh OSX virtual COM port driver, extract the cardinal-osx-V1_00c-release.zip file located in the MAC10 directory created in “Extract all Virtual COM Port Drivers”. Next, run the extracted file CygnalUSBToRS232Installer .To install the Macintosh OS9 virtual COM port driver, extract the cardinal-os9-V3_00a-free.sit file located in the MAC9 directory created in “Extract all Virtual COM Port Drivers”. Next, run the extracted file Installer .AN1446Rev. 1.2The CP2101 descriptors can be changed using the example utility CP2101SetIDs.exe in conjunction with the Windows Host API functions implemented by CP2101.DLL. The Host API functions give read/write access to the descriptors contained in EEPROM of a connected device. Another option is implementing a custom application using the Host API and CP2101.DLL suited to the individual needs of a particular production environment.The descriptors can also be set in the factory at production time for large orders. Please contact Silicon Labs for details.Customizing Device Descriptors using CP2101SetIDs.exeCP2101SetIDs.exe is an example program that uses the CP2101 Host API Functions implemented by CP2101.DLL, see Figure 1. CP2101SetIDs.exe demonstrates the general method of accessing and chang-ing the descriptors contained in the connected device's EEPROM. To use CP2101SetIDs.exe or to follow the same general method of accessing the descriptors it is necessary to have the devices connected and have the unmodified device drivers that shipped with the original CP2101 kit installed. The customized device driver installation files that contain the new VID and PID values (see “Customizing Driver Installations” on page 2) should also be installed. The default driver must be installed so that the CP2101 device with the default factory settings will appear in the device list. The customized drivers will be needed after the device IDs have been changed and the CP2101 device is reset.Before running CP2101SetIDs.exe, copy CP2101.DLL into \windows, \winnt, or \system32 directories,the directory containing the executable or any directory in the "Path" environment variable.Figure 1. CP2101SetIDs.exe Example ApplicationAN144Rev. 1.27To change one or more of the values, click on the checkbox to the left of the field and enter the new value. Once the new values have been entered, click on the "Program Device" button.The values entered are subject to the following limitations:1.Vid - 4 hexadecimal digits.2.Pid - 4 hexadecimal digits.3.Max. Power - 2 hexadecimal digits (the value is in 2 mA units).4.Serial Number - any sequence of up to 63 characters.5.Product String - any sequence of up to 126 characters.6.Release Version - each field is a decimal number value 0-99.Note:-Avoid connecting more than one device containing the same VID, PID and serial number combina-tion.-When the serial number of a CP2101 device is changed and the device is reset by calling the Host API function CP2101_Reset(), the device will re-enumerate and the device driver will be installed.Building CP2101.EXEOpen CP2101SetIDs.dsw in Visual Studio 6.0. Select "Release" or "Debug" and build the project.Creating Custom Applications using CP2101.DLLCustom applications can use the CP2101 Host API implemented in CP2101.DLL. To use functions implemented in CP2101.DLL, link CP2101.LIB with your Visual C++ 6.0 application. Include CP2101.h in any file that calls functions implemented in CP2101.DLL.AN1448Rev. 1.2The CP2101 Host API is provided as a means to facilitate production of customized CP2101 devices. The API allows access to the CP2101 device for retrieving and setting the VID, PID, product string, serial num-ber, self-power attribute, maximum power consumption, and device version.The CP2101 Host API is provided in the form of a Windows Dynamic Link Library (DLL), CP2101.DLL. The host interface DLL communicates with the bridge controller device via the provided device driver and the operating system's USB stack. Following is a list of the available host API func-tions:CP2101_GetNumDevices()- Returns the number of CP2101 devices connected.CP2101_GetProductString()- Returns a descriptor from the registry for a CP2101USB device.CP2101_Open()- Opens a CP2101 device as a USB device and returns a handle.CP2101_Close()- Closes a CP2101 device handle.CP2101_SetVid()- Sets the 2-byte vendor ID of a CP2101 device.CP2101_SetPid()- Sets the 2-byte product ID of a CP2101 device.CP2101_SetProductString()- Sets the product description string of a CP2101 device.CP2101_SetSerialNumber()- Sets the serial number string of a CP2101 device.CP2101_SetSelfPower()- Sets the self-power attribute of a CP2101 device.CP2101_SetMaxPower()- Sets the maximum power consumption of a CP2101 device.CP2101_SetDeviceVersion()- Sets version number of the CP2101 device.CP2101_GetDeviceProductString()-Returns the product description string of a CP2101 device.CP2101_GetDeviceSerialNumber()- Returns the serial number string of a CP2101 device.CP2101_GetDeviceVid()- Returns the vendor ID of a CP2101 device.CP2101_GetDevicePid()- Returns the product ID of a CP2101 device.CP2101_GetSelfPower()- Returns the self-power attribute of a CP2101 device.CP2101_GetMaxPower()- Returns max. power consumption value of a CP2101 device.CP2101_GetDeviceVersion()- Returns the version number of a CP2101 device.CP2101_Reset()- Resets a CP2101 device.In general, the user initiates communication with the target CP2101 device by making a call to CP2101_GetNumDevices(). This call will return the number of CP2101 target devices. This number is used as a range when calling CP2101_GetProductString() to build a list of devices connected to the host machine.To access a device a handle to the device must first be opened by a call to CP2101_Open() using an index determined from the call to CP2101_GetNumDevices(). The handle will be used for all subsequent accesses. When I/O operations are complete, the device handle is closed by a call to CP2101_Close().The remaining functions are provided to allow access to customizable values contained in the CP2101 device EEPROM.Each of these functions are described in the following sections. Type definitions and constants are defined in Appendix A.AN144Rev. 1.29DescriptionThis function returns the number of CP2101 devices connected to the host.PrototypeCP2101_STATUS CP2101_GetNumDevices( LPDWORD NumDevices )Parameters1.NumDevices - Address of a DWORD that will contain the number of devices.Return ValueCP2101_STATUS =CP2101_SUCCESS, CP2101_DEVICE_NOT_FOUND,CP2101_INVALID_PARAMETERCP2101_GetProductStringDescriptionThis function returns a null terminated serial number (S/N) string, product description string or full path string for the device specified by an index passed in the DeviceNum parameter. The index of the first device is 0 and the index of the last device is the value (NumDevices) returned by CP2101_GetNumDevices() - 1.PrototypeCP2101_STATUS CP2101_GetProductString( DWORD DeviceNum, LPVOID DeviceString, DWORD Options )Parameters1.DeviceNum - Index of the device for which the product description string, serial number or fullpath is desired.2.DeviceString - Variable of type CP2101_DEVICE_STRING returning the NULL terminatedserial number, device description or full path string.3.Options - flag that determines if DeviceString contains the product description, serial number orfull path string.Return ValueCP2101_STATUS =CP2101_SUCCESS, CP2101_DEVICE_NOT_FOUND,CP2101_INVALID_PARAMETERAN14410Rev. 1.2DescriptionOpens and returns a handle to a device using a device number determined by the number returned from CP2101_GetNumDevices().PrototypeCP2101_STATUS CP2101_Open( DWORD DeviceNum, HANDLE* Handle )Parameters1.DeviceNum - Device index. 0 for the first device, 1 for the 2nd, etc..2.Handle - Pointer to a variable where the handle to the device will be stored. This handle will beused for all subsequent accesses to the device.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_DEVICE_NOT_FOUND,CP2101_INVALID_PARAMETERCP2101_CloseDescriptionCloses an open device handle.PrototypeCP2101_STATUS CP2101_Close( HANDLE Handle )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_HANDLECP2101_SetVidDescriptionSets the 2-byte Vendor ID field, idVendor, of the Device Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_SetVid( HANDLE Handle, WORD Vid )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.Vid - 2-byte Vendor ID value.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDDescriptionSets the 2-byte Product ID field, idProduct, of the Device Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_SetPid( HANDLE Handle, WORD Pid )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.Pid - 2-byte Product ID value.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_SetProductStringDescriptionSets the Product Description String of the String Descriptor contained in EEPROM of a CP2101 device. If the string is not already in Unicode format the function will convert the string to Unicode before com-mitting it to EEPROM. The character size limit (in characters, not bytes) NOT including a NULL termi-nator is CP2101_MAX_DEVICE_STRLEN.PrototypeCP2101_STATUS CP2101_SetProductString( HANDLE Handle, LPVOID Product, BYTE Length, BOOL ConvertToUnicode=TRUE )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.Product - Buffer containing the Product String value.3.Length - Length of the string in characters (not bytes) not including a NULL terminator.4.ConvertToUnicode - Boolean flag that tells the function if the string needs to be converted to Uni-code. The flag is set to TRUE by default, i.e. the string is in ASCII format and needs to be con-verted to Unicode.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDDescriptionSets the Serial Number String of the String Descriptor contained in EEPROM of a CP2101 device. If the string is not already in Unicode format the function will convert the string to Unicode before committing it to EEPROM. The character size limit (in characters, not bytes) NOT including a NULL terminator is CP2101_MAX_DEVICE_STRLEN.PrototypeCP2101_STATUS CP2101_SetSerialNumber( HANDLE Handle, LPVOID SerialNumber, BYTE Length, BOOL ConvertToUnicode=TRUE )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.SerialNumber - Buffer containing the Serial Number String value.3.Length - Length in characters (not bytes) not including a NULL terminator.4.ConvertToUnicode - Boolean flag that tells the function if the string needs to be converted to Uni-code. The flag is set to TRUE by default, i.e. the string is in ASCII format and needs to be con-verted to Unicode.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_SetSelfPowerDescriptionSets or clears the Self-powered bit of the Power Attributes field, bmAttributes, of the Configuration Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_SetSelfPower( HANDLE Handle, BOOL SelfPower )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.SelfPower - Boolean flag where TRUE means set Self-powered bit, and FALSE means clear Self-powered bit.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDDescriptionSets the Max Power field, MaxPower, of the Configuration Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_SetMaxPower( HANDLE Handle, BYTE MaxPower )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.MaxPower - 1-byte value representing the Maximum power consumption of the CP2101 USBdevice expressed in 2mA units.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_SetDeviceVersionDescriptionSets the Device Release Version field, bcdDevice, of the Device Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_SetDeviceVersion( HANDLE Handle, WORD Version )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.Version - 2-byte Device Release Version number in Binary-Coded Decimal (BCD) format withthe upper 2 nibbles containing the 2 decimal digits of the major version and the lower 2 nibbles containing the 2 decimal digits of the minor version.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_GetDeviceProductStringDescriptionReturns the Product Description String of the String Descriptor contained in EEPROM of a CP2101 device. If the ConvertToASCII parameter is set the string will be converted to ASCII format before being returned to the caller. The character size limit (in characters, not bytes) NOT including a NULL termina-tor is CP2101_MAX_DEVICE_STRLEN.PrototypeCP2101_STATUS CP2101_GetDeviceProductString( HANDLE Handle, LPVOID Product, LPBYTE Length, BOOL ConvertToASCII=TRUE )1.Handle - Handle to the device to close as returned by CP2101_Open().2.Product - Pointer to a buffer returning the Product String value.3.Length - Pointer to a BYTE value returning the length of the string in characters (not bytes) notincluding a NULL terminator.4.ConvertToASCII - Boolean flag that tells the function if the string needs to be converted to ASCIIbefore it is returned to the caller. The flag is set to TRUE by default, i.e. the caller is expecting the string in ASCII format.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_GetDeviceSerialNumberDescriptionGets the Serial Number String of the String Descriptor contained in EEPROM of a CP2101 device. If the ConvertToASCII parameter is set the string will be converted to ASCII format before being returned to the caller. The character size limit (in characters, not bytes) NOT including a NULL terminator is CP2101_MAX_DEVICE_STRLEN.PrototypeCP2101_STATUS CP2101_GetDeviceSerialNumber( HANDLE Handle, LPVOID SerialNumber, LPBYTE Length, BOOL ConvertToASCII=TRUE )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.SerialNumber - Pointer to a buffer returning the Serial Number String value.3.Length - Pointer to a BYTE value returning the length of the string in characters (not bytes) notincluding a NULL terminator.4.ConvertToASCII - Boolean flag that tells the function if the string needs to be converted to ASCIIbefore it is returned to the caller. The flag is set to TRUE by default, i.e. the caller is expecting the string in ASCII format.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_GetDeviceVidDescriptionReturns the 2-byte Vendor ID field, idVendor, of the Device Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_GetDeviceVid( HANDLE Handle, LPWORD Vid )1.Handle - Handle to the device to close as returned by CP2101_Open().2.Vid - Pointer to a 2-byte value that returns the Vendor ID of the CP2101 device.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_GetDevicePidDescriptionReturns the 2-byte Product ID field, idProduct, of the Device Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_GetDevicePid( HANDLE Handle, LPWORD Pid )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.Pid - Pointer to a 2-byte value that returns the Product ID of the CP2101 device.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_GetSelfPowerDescriptionReturns the state of the Self-powered bit of the Power Attributes field, bmAttributes, of the Configuration Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_GetSelfPower( HANDLE Handle, LPBOOL SelfPower )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.SelfPower - Pointer to a boolean flag where TRUE means Self-powered bit is set, and FALSEmeans Self-powered bit is cleared.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDDescriptionReturns the 1-byte Max Power field, MaxPower, of the Configuration Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_GetMaxPower( HANDLE Handle, LPBYTE MaxPower )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.MaxPower - Pointer to a 1-byte value returning the Maximum power consumption of the CP2101USB device expressed in 2mA units.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILEDCP2101_GetDeviceVersionDescriptionReturns the 2-byte Device Release Version field, bcdDevice, of the Device Descriptor contained in EEPROM of a CP2101 device.PrototypeCP2101_STATUS CP2101_GetDeviceVersion( HANDLE Handle, LPWORD Version )Parameters1.Handle - Handle to the device to close as returned by CP2101_Open().2.Version - Pointer to a 2-byte value returning the Device Release Version number in Binary-CodedDecimal (BCD) format with the upper 2 nibbles containing the 2 decimal digits of the major ver-sion and the lower 2 nibbles containing the 2 decimal digits of the minor version.Return ValueCP2101_STATUS=CP2101_SUCCESS, CP2101_INVALID_PARAMETER,CP2101_INVALID_HANDLE, CP2101_DEVICE_IO_FAILED。