日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當前位置:首頁 > 技術學院 > 技術前線
[導讀]函數(shù)說明 本程序采用16位并行模式下對AD7606的8個采樣通道進行同步采樣,并對采樣后的數(shù)據(jù)進行卡爾曼濾波處理。

GPIO初始化函數(shù)

void AD7606Init(void) //AD06060初始化函數(shù)

{

GPIO_InitTypeDef GPIO_InitStructure;

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA|RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOC|\

RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE|RCC_AHB1Periph_GPIOF|\

RCC_AHB1Periph_GPIOG|RCC_AHB1Periph_GPIOH|RCC_AHB1Periph_GPIOI,ENABLE); //使能GPIOA的時鐘

/***********************8GPIO輸出配置******************************/

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;//輸出

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; //推挽輸出

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; //上拉輸出

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; //高速GPIO

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;

GPIO_Init(GPIOB,&GPIO_InitStructure);//PB7

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;

GPIO_Init(GPIOI,&GPIO_InitStructure);//PI4

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1;

GPIO_Init(GPIOE,&GPIO_InitStructure);//PE0,1

/************************GPIO輸入配置*********************************/

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12;

GPIO_Init(GPIOC,&GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|\

GPIO_Pin_5|GPIO_Pin_6;

GPIO_Init(GPIOD,&GPIO_InitStructure);//PD0,1,2,3,4,5,6

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9|GPIO_Pin_10;

GPIO_Init(GPIOG,&GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_6|GPIO_Pin_7;

GPIO_Init(GPIOI,&GPIO_InitStructure);

AD760600_RESET = 0;

AD760600_CONVST =1;

AD760600_CS = 1;

AD760600_RD_SCLK = 1;

AD7606驅動函數(shù)

/***********************AD760600驅動函數(shù)****************************/

void AD760600Reset(void)

{

AD760600_RESET = 1;

delay_us(1);

AD760600_RESET = 0;

AD760600_CONVST = 0;

delay_us(1);

AD760600_CONVST = 1;

}

void AD760600ReadOneSample(u16*Dout,u8 Channels)

{

u8 i,j;

u8 Date;

AD760600Reset();

u8 Read_Busy ;

Read_Busy = AD760600_BUSY;

while(Read_Busy == 1)

{

Read_Busy = AD760600_BUSY;

}

AD760600_CS = 0;

for(i=0;i

{

AD760600_RD_SCLK = 0;

Date = AD760600_DB0<<0|AD760600_DB1<<1|AD760600_DB2<<2|AD760600_DB3<<3|AD760600_DB4<<4|AD760600_DB5<<5|\

AD760600_DB6<<6|AD760600_DB7<<7|AD760600_DB8<<8|AD760600_DB9<<9|AD760600_DB10<<10|AD760600_DB11<<11|AD760600_DB12<<12|\

AD760600_DB13|AD760600_DB14<<14|AD760600_DB15<<15;

AD760600_RD_SCLK = 1;

delay_us(1);

Dout[i] = Date;

}

AD760600_CS = 1;

for(j=1;j<=8;j++)

{

Dout[j] = Kalman(Dout[j]);

}

}

本站聲明: 本文章由作者或相關機構授權發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內容真實性等。需要轉載請聯(lián)系該專欄作者,如若文章內容侵犯您的權益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關閉