/*********************************************
模式零 读数据
*********************************************/
unsigned char SPI_Receiver_Dat(void)
{
unsigned char n ,dat,bit_t;
for(n=0;n<8;n++)
{
SCK_D(0);
dat<<=1;
if(MISO_I())
dat|=0x01;
else
dat&=0xfe;
SCK_D(1);
}
SCK_D(0);
return dat;
}
#endif |