如何编写对来自USB设备的连续传入数据进行操作的C程序 [英] How to write a C programme operating on continuously incoming data from a usb device

查看:71
本文介绍了如何编写对来自USB设备的连续传入数据进行操作的C程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我解决问题..

我正在尝试通过USB端口连续馈送数据....

Please help me to solve the problem..

I am trying to do fft of data continuously fed via usb port....

推荐答案

您应该参考USB设备的文档和/或API.您很有可能必须调用设备的API函数或Win32函数ReadFile或DeviceIoControl之一.
You should refer to the documentation and/or API for your USB device. Most likely you will have to either call API functions for the device or one of the Win32 functions ReadFile or DeviceIoControl.


您正以某种方式从USB连接获取数据到DSP芯片.怎么样,你没有说. (中断,轮询,共享内存?您的代码,库例程?)

缓冲此数据.如果有足够的文件,请像处理文件中的文件一样对其进行处理.

确实要处理对缓冲区的同步访问,以便处理缓冲区之外的数据不会与向缓冲区添加数据冲突.也许您需要使用双缓冲或乒乓缓冲区.
You are somehow getting the data from the USB connection to your DSP chip. How, you have not said. (interrupts, polling, shared memory? your code, a library routine?)

Buffer this data. When you have enough of it, process it just like you would have if it came from a file.

Do deal with synchronizing access to the buffer so that processing data out of it does not conflict with adding data to it. Perhaps you will need to employ double buffering or a ping-pong buffer.


谢谢您,为什么,

我正在使用dsp处理器.
我已经有执行fft的C代码.但是在该代码中,数据是从文件中提取的.

我应该对该代码进行什么更改...我代替了从文件中读取f.
Thank You Khythen,

I am using a dsp processor.
I already have the C code to perform fft. But in that code the data is taken from a file.

What change i should bring to that code...i stead of reading ffrom a file.


这篇关于如何编写对来自USB设备的连续传入数据进行操作的C程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆