Moteur de recherche de fiches techniques de composants électroniques
  French  ▼
ALLDATASHEET.FR

X  

AN197 Fiches technique(PDF) 10 Page - Silicon Laboratories

No de pièce AN197
Description  SERIAL COMMUNICATIONS GUIDE FOR THE CP210X
PDF  14 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Fabricant  SILABS [Silicon Laboratories]
Site Internet  http://www.silabs.com
Logo SILABS - Silicon Laboratories

AN197 Fiches technique(HTML) 10 Page - Silicon Laboratories

Back Button AN197 Datasheet HTML 6Page - Silicon Laboratories AN197 Datasheet HTML 7Page - Silicon Laboratories AN197 Datasheet HTML 8Page - Silicon Laboratories AN197 Datasheet HTML 9Page - Silicon Laboratories AN197 Datasheet HTML 10Page - Silicon Laboratories AN197 Datasheet HTML 11Page - Silicon Laboratories AN197 Datasheet HTML 12Page - Silicon Laboratories AN197 Datasheet HTML 13Page - Silicon Laboratories AN197 Datasheet HTML 14Page - Silicon Laboratories  
Zoom Inzoom in Zoom Outzoom out
 10 / 14 page
background image
AN197
10
Rev. 0.6
// If we need to make the call again, then decrement the serial index so we can
// accessit the next time through the loop
if (ERROR_MORE_DATA == status)
serialIndex--;
// Otherwise, the call is a success, and we can compare the portString from the
// key to the port string that we want, if they match then retrieve the port
else if (ERROR_SUCCESS == status)
{
if (portString == portKeyString)
{
if (ERROR_SUCCESS == RegQueryValueEx(tmpKey, "Portname", NULL, &valtype,
(unsigned char *)portString, &length))
{
// When we obtain this key, it will be in string format of
// "COMXX" where XX is the port. Simply make the first three
// elements of the string 0, and call the atoi function to obtain
// the number of the port.
portString[0] = '0';
portString[1] = '0';
portString[2] = '0';
portNum = atoi(portString);
}
}
}
// Increment the serial index
serialIndex++;
serKeyString.Format("Enum\\SLABCR\\guid\\%.4d", serialIndex);
// Make sure to close all open keys for cleanup
RegCloseKey(tmpKey);
}
RegCloseKey(HKEY_LOCAL_MACHINE);
// Return the number of the port the device is connected too
return portNum;
}
7.3. Sample Program to Retrieve a CP210x COM Port
Included in the AN197SW.zip is a directory named "CP210xPortNumExample" that contains the source code and
executables for a Visual Studio project that makes use of these functions. In the program, the number of CP210x
devices are found and then for each one a port number is retrieved for it and listed in the edit box. (This program
also makes use of the CP210xManufacturing.DLL to find the VID, PID, and serial number on a device. The use of
this DLL is defined in more detail in "AN144: CP210x Device Customization Guide".)



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14


Fiches technique Télécharger

Go To PDF Page


Lien URL



ALLDATASHEET vous a-t-il été utile ?  [ DONATE ] 

À propos de Alldatasheet   |   Publicité   |   Contactez-nous   |   Politique de confidentialité   |   Lien vers la fiche technique    |   Echange de liens   |   Fabricants
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com