Elan Digital Systems Ltd.
33
HD717 USER’S
GUIDE
else
if (IPR & LRDTXIntPendingBit)
//need LRD TX word
{
WriteHD717Reg(LRDTXLOReg,*LR+);
WriteHD717Reg(LRDTXHIReg,*LR+);
}
else
if (IPR & SCCIntPendingBit)
//SCC needs service
{
RR7 = ReadSCCReg(RR7Reg);
//SCC byte ct in SDLC
RR6 = ReadSCCReg(RR6Reg);
//SCC byte ct in SDLC
RR2 = ReadSCCReg(RR2Reg);
//SCC s/w intack
RR1 = ReadSCCReg(RR1Reg);
//status reg
RR0 = ReadSCCReg(RR0Reg);
//status reg (read last)
if (RR1 & 0x10)
//parity error ?
{
SCCErrorTrap(PARITY);
}
else
if (RR1 & 0x20)
//RX overrun error ?
{
SCCErrorTrap(RXOVERRUN);
}
else
if (RR1 & 0x80)
//End of RX frame ?
{
if (RR1 & 0x40)
//CRC error at end of frame ?
SCCErrorTrap(CRCERROREOF);
RXBytes = 0;
//Get data from RX FIFO
do
{
MSR = ReadHD717Reg(MSRReg);
if (MSR & 0x01)
//do if RX FIFO not empty
{
*+ = ReadHD717Reg(RXFIFOReg);
+;
}
}
while (MSR & 0x01);
//read until FIFO empty
RXEndOfMessageFlag = TRUE;
//signal message ready
}
else
if (RR1 & 0x40)
//CRC error within frame ?
{
SCCErrorTrap(CRCERROR);
}
else
if (RR0 & 0x40)
//TX end of message ?
{
TXEndOfMessageFlag = TRUE;
//signal message done
}
}
else
if (IPR & TXFIFOEIntPendingBit)
//TX FIFO now empty
{
TXEndOfMessageFlag = TRUE;
//signal message done
}