|
Tony
- question about the code
|
(no rating) 2009-08-04 |
BYTE rreg(BYTE reg)
{
BYTE dum;
SS_LO
SPIB = reg; // reg number w. dir=0 (IN)
while (SPICN & bmSTBY); // loop if data still being sent
dum = SPIB; // NECESSARY TO RE-ENABLE THE INPUT BUFFER in BYTE MODE
SPIB=0x00; // data is don't care, we're clocking in MISO bits
while (SPICN & bmSTBY); // loop if data still being sent
SS_HI
return(SPIB);
}
In the above function, should it return dum instead of SPIB? And what does the following comment mean? Thx.
SPIB=0x00; // data is don't care, we're clocking in MISO bits
|
|
|