l=inp(wBaseAddr+2*4); | /* delay starting two clks */ |
h=inp(wBaseAddr+2*4); |
|
for
outp(wBaseAddr+12,0x80); /* latch counter_2 */ l=inp(wBaseAddr+8); h=inp(wBaseAddr+8);
if (h>=0x80) return NoError;
}
return TimeOut;
}
void AdPolling(UCHAR channel, UCHAR gain, WORD delay)
{ |
|
outp(wBaseAddr+0x18,0); | // Select Mode 0 |
outp(wBaseAddr+0x10,channel); | |
outp(wBaseAddr+0x14,gain); |
|
P1002_Delay(delay); |
|
outp(wBaseAddr+0x1c,01); | // A/D software tirgger |
} |
|
void SetupTimer(WORD wChannel, WORD wCoef)
{
WORD cmd; wChannel=wChannel&0x03; cmd=0x34+(wChannel<<6); outpw(wBaseAddr+3*4, cmd); outp(wBaseAddr+wChannel*4, (UCHAR)(wCoef&0xff)); outp(wBaseAddr+wChannel*4, (UCHAR)(wCoef>>8));
}
//========================================================= void main()
{
int i,j;
WORD wBoards,wRetVal,wPLX;
WORD Drdy,wAdData=0;
42