91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 92KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-11
  • 語(yǔ)言: 其他
  • 標(biāo)簽: AD2S12??模擬SPI??

資源簡(jiǎn)介

AD2S1210是一款10位到16位分辨率的旋變數(shù)字轉(zhuǎn)換器,片上集成了正弦波振蕩器可提供可為旋轉(zhuǎn)變壓器提供正弦波激勵(lì)(3.15ppm,頻率有2kHz-20KHz)

資源截圖

代碼片段和文件信息

/********************************************************************************
?Author?:?CAST?(China?Applications?Support?Team)?

?Date?:???April?2011

?File?name?:???AD2S1210.c

?Description?: ?Use?the?GPIO?to?simulate?the?SPI?communication?of?AD2S1210

?Hardware?plateform?:? ADuC7026?and?AD2S1210
********************************************************************************/

#include?“ADuC7026.h“
#include?“ADuC7026Driver.h“
#include?“AD2S1210.h“

//?add?the?c?file?here


//---------------------------------
//void?WriteToAD2S(unsigned?char?countunsigned?char?*buf);
//---------------------------------
//Function?that?writes?to?the?AD2S?via?the?SPI?port.?
//--------------------------------------------------------------------------------
void?AD2S1210Initiate()
{
//RESET->0?initially??
CLR_RESET();??
SET_SPL();
delay(1);
SET_RESET();?
delay(2);
CLR_SPL();
delay(1);
SET_SPL();
}

void?AD2S1210SelectMode(unsigned?char?mode)
{
if?(mode==POSITION)
{
CLR_A0();
CLR_A1();
delay(1); //Normal?Mode?position?output
}
else?if?(mode==VELOCITY)
{
CLR_A0();
SET_A1();
delay(1); //Normal?Mode?velocity?output
}
else?if?(mode==CONFIG)
{
SET_A0();
SET_A1();
delay(1); //Configuration?Mode
}
}

void?WriteToAD2S1210(unsigned?char?address?unsigned?char?data)
{
unsigned char buf;

//write?control?register?address
buf?=?address;

SET_SCLK();
delay(1);
SET_CS();
delay(1);
CLR_CS();
delay(1);

SET_WR();
delay(1);
CLR_WR();
delay(1);

SPIWrite(1&buf); ?? ?

SET_WR();
delay(1);
SET_CS();
//write?control?register?address

//write?control?register?data
buf?=?data;

SET_SCLK();
delay(1);
SET_CS();
delay(1);
CLR_CS();
delay(1);

SET_WR();
delay(1);
CLR_WR();
delay(1);

SPIWrite(1&buf); ?? ?

SET_WR();
delay(1);
SET_CS();
//write?control?register?data
}

void?ReadFromAD2S1210(unsigned?char?mode?unsigned?char?address?unsigned?char?*?buf)
{

if?(mode==CONFIG)
{

//write?control?register?address
buf[0]?=?address;

SET_SCLK();
delay(1);
SET_CS();
delay(1);
CLR_CS();
delay(1);

SET_WR();
delay(1);
CLR_WR();
delay(1);

SPIWrite(1buf);

SET_WR();
delay(1);
SET_CS();
//write?control?register?address


//read?1-byte?register
SET_SCLK();

SET_CS();
SET_WR();
delay(1);

CLR_CS();
delay(1);

CLR_SCLK();
delay(1);

CLR_WR();
delay(1);

SPIRead(1buf);

SET_WR();
delay(1);

SET_CS();
//read?1-byte?register
}
else?if?(mode==POSITION||mode==VELOCITY)
{
SET_SPL();
delay(1);
CLR_SPL();
delay(5);

//read?3-byte?register?
SET_SCLK();

SET_CS();
SET_WR();
delay(1);

CLR_CS();
delay(1);

CLR_SCLK();
delay(1);

CLR_WR();
delay(1);

SPIRead(3buf); //read?data?register

SET_WR();
delay(1);

SET

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-06-28?17:42??ExampleCode_RDC_AD2S1210\
?????文件????????3166??2011-06-20?17:16??ExampleCode_RDC_AD2S1210\AD2S1210.c
?????文件???????11797??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\ad2s1210.crf
?????文件?????????479??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\ad2s1210.d
?????文件????????1300??2011-06-20?17:16??ExampleCode_RDC_AD2S1210\AD2S1210.h
?????文件???????32744??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\ad2s1210.o
?????文件???????21976??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test.axf
?????文件????????2751??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test.c
?????文件???????10752??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\ad2s1210test.crf
?????文件?????????535??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\ad2s1210test.d
?????文件????????8638??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test.hex
?????文件???????18657??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test.htm
?????文件?????????338??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test.lnp
?????文件???????50970??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test.map
?????文件???????29788??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\ad2s1210test.o
?????文件?????????193??2011-06-20?17:18??ExampleCode_RDC_AD2S1210\AD2S1210Test.plg
?????文件????????1110??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test.tra
?????文件???????58741??2011-06-20?17:18??ExampleCode_RDC_AD2S1210\AD2S1210Test.uvopt
?????文件???????14850??2011-06-17?19:09??ExampleCode_RDC_AD2S1210\AD2S1210Test.uvproj
?????文件????????2360??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test_Target?1.dep
?????文件???????58745??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\AD2S1210Test_uvopt.bak
?????文件???????14843??2011-06-12?14:50??ExampleCode_RDC_AD2S1210\AD2S1210Test_uvproj.bak
?????文件????????3729??2011-06-17?17:43??ExampleCode_RDC_AD2S1210\ADuC7026Driver.c
?????文件???????10565??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\aduc7026driver.crf
?????文件?????????533??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\aduc7026driver.d
?????文件????????1793??2011-06-17?17:43??ExampleCode_RDC_AD2S1210\ADuC7026Driver.h
?????文件???????32456??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\aduc7026driver.o
?????文件???????42241??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\ADuC702x.lst
?????文件????????3044??2011-06-20?17:17??ExampleCode_RDC_AD2S1210\ADuC702x.o
?????文件???????16353??2009-05-07?14:40??ExampleCode_RDC_AD2S1210\ADuC702x.s

評(píng)論

共有 條評(píng)論