c语言eallow,求大神指导C语言框图设计!!!

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

#include "DSP281x_Device.h"

#include "DSP281x_Examples.h"

#define POST_SHIFT 0

#define INLINE_SHIFT 1

#define NO_SHIFT 0

// ADC start parameters

#define ADC_MODCLK 0x3

#define ADC_CKPS 0x0

#define ADC_SHCLK 0x1

#define AVG 1000

#define ZOFFSET 0x00

#define BUF_SIZE 1024

Uint16 SampleTable[BUF_SIZE];

main()

{

Uint16 i;

Uint16 array_index;

SysCtrlRegs.HISPCP.all = ADC_MODCLK;

EDIS;

EALLOW;

GpioMuxRegs.GPFMUX.bit.XF_GPIOF14 = 1;

EDIS;

IER = 0x0000;

IFR = 0x0000;

Interrupt

InitPieVectTable();

InitAdc();

AdcRegs.ADCTRL1.bit.ACQ_PS = ADC_SHCLK;

AdcRegs.ADCTRL3.bit.ADCCLKPS = ADC_CKPS;

AdcRegs.ADCTRL1.bit.SEQ_CASC = 1;

AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0;

AdcRegs.ADCTRL1.bit.CONT_RUN = 1;

AdcRegs.ADCTRL1.bit.SEQ_OVRD = 1;

AdcRegs.ADCCHSELSEQ1.all = 0x0;

AdcRegs.ADCCHSELSEQ2.all = 0x0;

AdcRegs.ADCCHSELSEQ3.all = 0x0;

AdcRegs.ADCCHSELSEQ4.all = 0x0;

AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 0x7;

for (i=0; i

{

SampleTable[i] = 0;

}

AdcRegs.ADCTRL2.all = 0x2000;

while(1)

array_index = 0;

for (i=0; i

{

while (AdcRegs.ADCST.bit.INT_SEQ1== 0){}

asm(" setc XF ");

AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;

#if INLINE_SHIFT

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT0)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT1)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT2)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT3)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT4)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT5)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT6)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT7)>>4);

#endif

#if NO_SHIFT || POST_SHIFT

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT0));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT1));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT2));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT3));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT4));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT5));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT6));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT7));

#endif //-- NO_SHIFT || POST_SHIFT

while (AdcRegs.ADCST.bit.INT_SEQ1== 0){}

asm(" clrc XF ");

AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;

#if INLINE_SHIFT

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT8)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT9)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT10)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT11)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT12)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT13)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT14)>>4);

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT15)>>4); #endi

#if NO_SHIFT || POST_SHIFT

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT8));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT9));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT10));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT11));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT12));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT13));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT14));

SampleTable[array_index++]= ( (AdcRegs.ADCRESULT15));

#endif

#if POST_SHIFT

for (i=0; i

{

SampleTable[i] = ((SampleTable[i]) >>4);

}

#endif // -- POST_SHIFT

asm(" clrc XF ");

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值