uint16  ADC window buffer using DMA | Cypress Semiconductor
uint16  ADC window buffer using DMA
I would like to create a static adc window that specifically buffers 1024 2byte-words but does not slide.
I am thinking DMA would be the most efficient way to do this. I would have to use multiple TD's I'm assuming since the ADC_sample() only gets one 16 bit sample at a time but I need to create an array of them, but since the number of TD descriptors is limited to 128 I would have to use two sets of DMAs with a counter to determine when the one dma has fully buffered 128 2byte-words and then transfer those 128 2byte-words to a different buffer, essentially doing the second transfer 8 times. Of course I wil have to use a counter to determine when the first DMA buffer is finished to make sure I don't grab overlapping data. Once all of this is done I can have another counter looking at the second dma to determine when it has completed 8 transfers.
Is this something that is achievable using the PSoC 5lp?
If there is a better way please let me know, or if I am thinking about this wrong.