- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In our project we use CYUSB3014 to transfer data from DAQ through FPGA to PC.
For this purpose we use SlaveFifoSync mode (as described in AN65974).
Before reading data from usb controller I would like to check if the DMA buffer is full.
I would like to check it by getting the value of FLAGA (which is GPIO21 according to AN65974). I intend to do this with the special setup (control) request from the PC. This request will be processed in CyFxSlFifoApplnUSBSetupCB function of cyfxslfifosync.c
But how can I get the status of FPGA (GPIO21) in the controller's firmware C code?
Solved! Go to Solution.
- Labels:
-
USB Superspeed Peripherals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
From the description, I understand that you want to check if the status of DMA buffers on receiving a control request from the host. Is my understanding correct?
If MANUAL DMA channel is used, you can check the status of the DMA buffer (using input->buffer_p.count) in the CyFxSlFifoPtoUDmaCallback before committing the DMA buffer to USB socket.
Please let me know if any queries on this.
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
From the description, I understand that you want to check if the status of DMA buffers on receiving a control request from the host. Is my understanding correct?
If MANUAL DMA channel is used, you can check the status of the DMA buffer (using input->buffer_p.count) in the CyFxSlFifoPtoUDmaCallback before committing the DMA buffer to USB socket.
Please let me know if any queries on this.
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rashi, I would like to check the status (full or not) of DMA buffer from PC (!), not from controller.
So, I would like to fill the control endpoint of the controller when it receive the special control
command from PC and then read this endpoint from PC.
PC program need this information to get ready to receive the data from DAQ.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Understood.
As mentioned in previous response, you can store the status of DMA buffer ((using input->buffer_p.count in DMA callback) in a global variable.
On receiving the request from host, the value of the global variable can be sent via control endpoint.
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
In FX2 we have EP2468STAT register which contains the status of the full buffer flag.
I believed that FX3 has a similar register.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please let us know if the suggestion was helpful
Rashi