名稱:read2543
功能:TLC2543驅動模塊
輸入參數:port通道號
輸出參數:ad轉換值
*************************************/
uint read2543(uchar port)
{
uint ad=0,i
CLOCK=0
_CS=0
port<<=4
for(i=0 i<12 i++)
{
if(D_OUT) ad|=0x01
D_IN=(bit)(port&0x80)
CLOCK=1
delay(3)
CLOCK=0
delay(3)
port<<=1
ad<<=1
}
_CS=1
ad>>=1
return(ad)
}
標簽:
2543
read
port
TLC
上傳時間:
2016-01-21
上傳用戶:R50974