資源簡(jiǎn)介
DDS代碼,已經(jīng)在單片機(jī)上調(diào)通,非常好用!
代碼片段和文件信息
/******************************************************************************
說(shuō)??明:AD9851各自程序定義?包括復(fù)位?串口寫(xiě)入?并口寫(xiě)入
*******************************************************************************/
#include??
#include??
#include??
#include??
#include??
#include??
#include??“DDS.h“
#define?BIT_DATA?GPIO_PORTD_baseGPIO_PIN_0
#define?W_CLK????GPIO_PORTD_baseGPIO_PIN_1
#define?FQ_UP????GPIO_PORTD_baseGPIO_PIN_2??
#define?RESET????GPIO_PORTD_baseGPIO_PIN_3?
#define?BIT_DATA_L?GPIOPinWrite(BIT_DATA0x00);
#define?BIT_DATA_H?GPIOPinWrite(BIT_DATA0xff);
#define?W_CLK_L????GPIOPinWrite(W_CLK0x00);
#define?W_CLK_H????GPIOPinWrite(W_CLK0xff);
#define?FQ_UP_L????GPIOPinWrite(FQ_UP0x00);
#define?FQ_UP_H????GPIOPinWrite(FQ_UP0xff);
#define?RESET_L????GPIOPinWrite(RESET0x00);
#define?RESET_H????GPIOPinWrite(RESET0xff);
void?DDSInitial()
{
??SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
??GPIOPinTypeGPIOOutput(BIT_DATA);
??GPIOPinTypeGPIOOutput(W_CLK);
??GPIOPinTypeGPIOOutput(FQ_UP);
??GPIOPinTypeGPIOOutput(RESET);
??BIT_DATA_L;
??W_CLK_L;
??FQ_UP_L;
??RESET_L;
}
/*******************************************************************************
函數(shù)名:void?ad9851_reset()
功??能:并口復(fù)位
參??數(shù):無(wú)
返回值:無(wú)
*******************************************************************************/
/*void?ad9851_reset()
{
??W_CLK_L;
??FQ_UP_L;
??//rest信號(hào)
??RESET_L;
??RESET_H;
??//_NOP();
??RESET_L;
}*/
/*******************************************************************************
函數(shù)名:void?ad9851_reset_serial()
功??能:串口復(fù)位
參??數(shù):無(wú)
返回值:無(wú)
*******************************************************************************/
void?ad9850_reset_serial()
{
??W_CLK_L;
??FQ_UP_L;
??//rest信號(hào)
??RESET_L;
??RESET_H;
??RESET_L;
??//w_clk信號(hào)
??W_CLK_L;
??W_CLK_H;
??W_CLK_L;
??//fq_up信號(hào)
??FQ_UP_L;
??FQ_UP_H;
??FQ_UP_L;
}
/******************************************************************************
函數(shù)名:void?ad9851_wr_parrel(unsigned?char?w0double?frequence)
功??能:向ad9851中寫(xiě)命令與數(shù)據(jù)(并口)
參??數(shù):unsigned?char?w0,double?frequence
返回值:無(wú)
*******************************************************************************/
/*void?ad9851_wr_parrel(unsigned?char?w0double?frequence)
{
??unsigned?char?w;
?
評(píng)論
共有 條評(píng)論