📄 test.c
字号:
/****************************************Copyright (c)**************************************************
** 研 发 部
** http://www.FFTChina.com
**-----------------------------------------文件信息-----------------------------------------------------
**文 件 名: slavercv.c
**创 建 人: 徐建宁
**最后修改日期: 2005年6月30日
**描 述: SPI接收模块测试程序
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#include "stdio.h"
#include "stdlib.h"
#include "sys/types.h"
#include "sys/stat.h"
#include "fcntl.h"
short t[64]={128,134,140,146,152,158,163,168,173,177,
181,184,187,189,190,191,192,191,190,189,187,184,181,177,
173,168,163,158,152,146,140,134,128,121,115,109,103,97,92,
87,82,78,74,71,68,66,65,64,64,64,65,66,68,71,74,78,82,87,
92,97,103,109,115,121};
void delay11(int i)//延时
{
int k,j;
for(k=0;k<=i;k++)
for(j=0;j<50;j++);
}
int main(void)
{
int fd1;
int i,x;
fd1=open("/dev/fftda", O_RDWR);
if(fd1==-1)
{
printf("can not open fftioport!\n");
exit(1);
}
while(1)
{
/*******向DA转换芯片中写入数据*********/
for(i=0;i<64;i++)
{ // Uart_Printf("%x\n",t[j][i]);
//x=(t[i]<<16)|0x0000ffff;
x=t[i];
ioctl(fd1,x,x);
delay11(2);
}
}
printf("finished FFT shuma test\n");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -