1 Reply Latest reply on Oct 22, 2018 1:28 AM by srdr

    How to judge whether the in input buffer of cyusb3014 has data?

    qi.wen

      1、If I use the in Endpoint of cyusb3014  to receive data continuously, which can be suspended by FPGA logic, how to judge that the in buffer of 3014 has more data to avoid the error of reading, When I suspend the continuous input data.

      2、If I suspend the continuous input data, how to clear the useless data of in buffer of 3014 to avoid the mistake reading of next start?

        • 1. Re: How to judge whether the in input buffer of cyusb3014 has data?
          srdr

          1. You can setup a counter in DMA producer event and decrement it in the DMA Consumer event. This tells whether there is any data left in the DMA memory (DMA buffer) NOT the endpoint memory. Looks like there is no API to read whether there is any data in the Endpoint memory. It is good to reset the endpoint and DMA buffer when there is suspend and resume of data flow.

           

          2. Please refer CyFxUvcApplnStop in the AN75779. This handles the stopping the GPIF, clearing the DMA and Endpoint memory. You can implement the same in your code. Also refer CyFxUvcApplnStart.