資源簡介
f310之spi操作ADS1255/ADS1256
f310之spi操作ADS1255/ADS1256
代碼片段和文件信息
#include?
#include?
#include?
sbit?dydn=P1^0;
void?SendSPIByte(unsigned?char?ch)
{
SPIF?=?0;
SPI0DAT?=?ch;
while?(SPIF?==?0); ? //?等待寫結(jié)束 ???????
}?
unsigned?char?GetSPIByte(void)
{
SPIF?=?0;
SPI0DAT?=?0;
while?(SPIF?==?0);
return??SPI0DAT;???????????????????//?等待讀結(jié)束
}
//-----------------------------------------------
void?PORT_Init?(void)
{
???XBR0?|=?0x02;??????????????????????????
???XBR1?|=?0x40;??????????????????????? ??
???P0SKIP?=0x8c;???????????????????????????
???P0MDOUT?=?0xfF;????????????????????????
???P1MDOUT?|=?0x00;??????????????????????
}
void?SPI0_Init?(void)
{
???SPI0CFG?=?0x63;?????????????????????
???SPI0CN?=?0x09;?????????????????????
???????????????????????????????????????
???SPI0CKR?=
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
????.CA....??????2387??2010-03-23?09:11??WIMC8051F310.Uv2
????.CA....??????3280??2010-03-23?09:09??spi.c
????.CA....??????1515??2009-12-28?11:33??Uart.c
????.CA....??????3427??2010-03-23?09:16??WIMC8051F310.C
????.CA....???????512??2009-10-30?12:58??spi.h
????.CA....???????307??2010-03-23?09:11??Uart.h
????.CA....?????????0??2009-10-26?16:00??WIMC8051F310.H
????.CA....??????8253??2010-03-23?09:17??WIMC8051F310.hex
-----------?---------??----------?-----??----
????????????????19681????????????????????8
評(píng)論
共有 條評(píng)論