Yes, you can go with Auto DMA.
Thank you for your response. Can I also use the "ManyToOne"?
Sorry if this seems obvious to you but it isn't to me.
Also does my state machine look reasonable?
Yes. You can use Many to One Auto DMA Channel.
Regarding State Machine:
Your state machine looks like a trimmed version of UVC State machine.
Is the amount of data you write to GPIF II is always a buffer size?
Do not you need to write any size less than buffer size to host at any time?
How do you know that the buffer is always ready?
What if your host is steaming lower than expected.
In this case, your buffer will be full and you will be keep on writing to GPIF II.
In case of UVC, if the host is slow to to stream the data from device, we will look for the Commit Buffer Failure in DMA callback then reset GPIF II and DMA. This results loosing some video data. In video application, it is okay if there is a loss of data.
But what about your case, what kind of data you are streaming (what is your application)?
1. Yes the amount of data written from the GPIF II is always a buffer size. When the write WR is high data is read at the clock speed. Dah, I get it now, the buffer could be under filled when the WR goes low, so I would have to deal with that!
2. I assume that the buffer will always be ready because of the automatic switching of threads and sockets when one gets full. No flow control.
3. Yeah, the Commit Buffer Failure looks like a good idea.
4. I am doing a simple continuous read test, which I will adapt for an ADC. I am building a 16 bit synchronous counter to feed into the GPIF II so that I can look for any missing codes.
I intend to use a bulk endpoint. Is that the best form of communication to use?
Thank you for your very helpful answers.
>> I intend to use a bulk endpoint. Is that the best form of communication to use?
Bulk endpoint is perfect for your application.
Can the CPU access the count in "addr_counter" because I use it to count the total number of samples. Can I send that data as a footer/final header?
I would also like to clear all the buffers on "intr_cpu". How would I do that? Thanks.
We cannot read the the counter values for DATA, ADDR, and CTL counter in the firmware.