29
default
:
result=-1;
break
;
}
if
(result == -1)
return
-1;
if
(strlen(str) == 1 )
value=value+result;
if
(strlen(str) == 2 )
{
if
( i == 0 )
{
value=value+result*16;
}
if
( i == 1 )
{
value=value+result;
}
}
}
return
value;
}
BOOL
W75IO_init()
{
/* First step :to init W75IO.DLL */
if
(InitializeW75IO())
{
/* init onboard W75IO chipset */
if
(InitInternalW75IO())
return
TRUE;
else
{
printf("ERROR:init
Onboard
W75IO
chipset!!!!.\n");
return
FALSE;
}
}
else
{
printf("ERROR:Can't
init
W75IO.DLL!!!.\n");
return
FALSE;
}
return
FALSE;
}
void
W75IO_DO()
{
int
value;
printf("Please enter your want output value (0-255) \n");
cin>>value;
/* use onboard W75IO output value*/
InterDigitalOutput(value);
}
void
W75IO_DI()
{
/* read & show onboard W75IO input value*/