PCI-1202/1602/180x Series Card
Multi-Function Boards
User Manual/ Ver. 4.8/ Mar. 2015/ PMH-0014-48/ Page: 64
The demo program of send command to MagicScan control is given as follows:
WORD pic_control(WORD i)
{
WORD j;
if ((inport(wAddrCtrl)&0x04)==0)
{
outport(wAddrCtrl,0xffff);
/* send a recovery to PIC */
}
j=0;
while ((inport(wAddrCtrl)&0x04)==0)
{
j++;
if (j>65530) return(AdControllerError);
/* time out */
}
i = i & 0xDFFF;
/* set pic low !! */
outport(wAddrCtrl,i);
j=0;
while ((inport(wAddrCtrl)&0x04)!=0)
{
j++;
if (j>65530) return(AdControllerError);
/* time out */
}
outport(wAddrCtrl,(WORD)(i | 0x2000));
/* set pic high !! */
j=0;
while ((inport(wAddrCtrl)&0x04)==0)
{
j++;
if (j>65530) return(AdControllerError);
/* time out */
}
return(NoError);
}