求能经过验证的TLV5616的驱动程序!急!
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
void TLV5616_void(void);
void write_5616(uint dat);
sbit DIN=P1^3;
sbit SCLK=P1^4;
//sbit CS=P3^2;
sbit FS=P3^0;
void TLV5616_void(void)
{
SCLK=1;
// CS=1;
FS=1;
}
void write_5616(uint dat)
{ int i;
// CS=0;
FS=0;
for(i=0;i<16;i++)
{
if(dat&0x8000)
DIN=1;
else DIN=0;
SCLK=0;
SCLK=1;
dat<<=1;
}
FS=1;
// CS=1;
}
void main()
{
TLV5616_void();
while(1)
{
write_5616(0x03e8);
}
}
谢谢你的资料!