3.6.1.10 Handshake Control Bit
Set the B13 to 0 if the command is sent to the MagicScan controller. Keep this bit at high
when not used.
The demo program of handshaking 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);
}
PCI-1202/1602/1800/1802 Hardware User’s Manual
(Ver. 4.2, Dec/2009, PMH-014-42)---- 59