void Write_8bits(uint W_bits)
{
uint i,Temp_data;
for(i=0; i<8; i++)
{
Temp_data = W_bits;
Temp_data <<= i;
if((Temp_data&0x80)==0) //bit7 is zero
{
SID_0;// SID = 0;
nop1;
CLK_1;// SCLK = 1;
nop1;
nop1;
CLK_0;//SCLK = 0;
nop1;
SID_0;//SID = 0;
}
else //bit7 is one
{
SID_1;//SID = 1;
nop1;
CLK_1; //SCLK = 1;
nop1;
nop1;
CLK_0; //SCLK = 0;
nop1;
SID_0;//SID = 0;
}
}
}
此帖出自
小平头技术问答
一周热门 更多>