Source Code Files
Contents
USB08 Evaluation Board
Designer Reference Manual
MOTOROLA
Source Code Files
115
//----------------------------------------------------------------------------
char getSSCI() {
char c;
unsigned char n;
unsigned char ccr_save;
//
ccr_save = getCCR();
// save current Interrupt Mask
//
disableINTR();
// disable Interrupts
while(tstRxLvl()!=0) ;
// wait for H-L transition
delayHalfBit();
n=8;
do {
// get 8 Databits
delayBitTime();
c >>= 1;
if(tstRxLvl()!=0)
c |= 0x80;
} while(--n);
delayBitTime();
if(tstRxLvl()==0) {
// check Rx Line during Stopbit
// add framing error
// handling if desired
}
delayHalfBit();
//
setCCR(ccr_save);
// restore previous Interrupt Mask
return c;
}
//============================================================================