test.c
来自「fft 2410 linux 部分驱动 报扩 ad da 数码管 led」· C语言 代码 · 共 51 行
C
51 行
/****************************************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"
int main(void)
{
int fd1;
int i,x;
float adv;
fd1=open("/dev/fftad", O_RDWR);
if(fd1==-1)
{
printf("can not open fftioport!\n");
exit(1);
}
while(1)
{
/*******向DA转换芯片中写入数据*********/
for(i=0;i<64;i++)
{
x=ioctl(fd1,0,0);
adv=x*5.0/0xfff;
printf("\n ad=%f",adv);
}
}
printf("finished FFT shuma test\n");
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?