I have a setup where a FPGA is connected to a K70 MCU over the FlexBus. After some work writing and reading registers of the FPGA works quite well. Now I though have a problem, which I do not know how to solve.
I would like to use the eDMA of the Kinites to empty a FIFO on the FPGA. I have a pin from the FPGA connected to a GPIO of the MCU, indicating when there is 16 byte or more in the FIFO. (It fits with the burst size of the eDMA). The data generated on the FPGA, is larger than what can be buffered in the FIFO, so I need to empty the FIFO while it is generated. I know how much data is generated, though not how fast it is generated, so the FPGA need to be able to halt the eDMA to prevent it reading garbage from a empty buffer.
So how to I set the DMA up to starting transferring when a GPIO change level up, and halting when changing level to down?
I have looked into the registers of the channel, but have not seen something, which can help me solve this problem.
Any ideas for how to easy empty a FIFO where I do not know how much data is available, but only how much data there is in the end is more than welcome.