User`s manual

PICO822 Intel
®
Atom
TM
E620T/E680T All-In-One Pico-ITX Board
110 Digital I/O
else
{
printf("\n");
printf("Usage: %s port [output]\n", argv[0]);
printf(" port Specify the port number (port=0-11 decimal).\n");
printf(" output Specify the port value (output=0 | 1).\n");
printf(" When this is not specified, the port direction is set
input mode.\n");
printf(" When this is specified, the port is output mode.\n");
printf("\n");
}
return 0;
}
// Get GPIO Device Path
BOOL GetDevicePath(LPGUID pGuid,PCHAR pDeviceName)
{
HDEVINFO hardwareDeviceInfo = NULL;
SP_DEVICE_INTERFACE_DATA deviceInterfaceData ={0};
PSP_DEVICE_INTERFACE_DETAIL_DATA deviceInterfaceDetailData = NULL;
ULONG predictedLength = 0;
ULONG requiredLength = 0, bytes=0;
int i =0;
BOOL bRet = FALSE;
//
// Open a handle to the device interface information set of all
// present system class interfaces.
//
hardwareDeviceInfo = SetupDiGetClassDevs(pGuid, NULL, NULL,
(DIGCF_PRESENT | // Only Devices present
DIGCF_DEVICEINTERFACE)); // Function class devices.
if( INVALID_HANDLE_VALUE == hardwareDeviceInfo )
{
printf("SetupDiGetClassDevs failed: %d\n", (INT)GetLastError());
return bRet;
}
deviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
//
// Enumerate devices
//
do
{
if (SetupDiEnumDeviceInterfaces (hardwareDeviceInfo, 0,
// No care about specific PDOs
pGuid,
i, //
&deviceInterfaceData))
{
//
// Allocate a function class device data structure to
// receive the information about this particular device.
//
//
// First find out required length of the buffer
//
if(!SetupDiGetDeviceInterfaceDetail (
hardwareDeviceInfo,
&deviceInterfaceData,
NULL, // probing so no output buffer yet
0, // probing so output buffer length of zero
&requiredLength,
NULL))
{ // not interested in the specific dev-node
if(ERROR_INSUFFICIENT_BUFFER != GetLastError())
{
printf("SetupDiGetDeviceInterfaceDetail failed %d\n",
(INT)GetLastError());
SetupDiDestroyDeviceInfoList (hardwareDeviceInfo);
break;