1 Reply Latest reply on Oct 25, 2019 2:38 AM by HemanthR_06

    FX3 - GpifToUSB - Insert Tags to GPIF Data Stream

    FaFi_4159091

      Hello,

       

      I'm building an application based on the GpifToUSB example with my own GPIF Design to read out a custom image sensor. Since the GPIF supports only 8 outputs, my readout protocol is partially implemented in Firmware and partially in a GPIF state machine. The basic readout sequence is:

       

      1. Firmware writes a configuration (bit-bang) for the next readout

      2. Firmware sets statemachine to "start_readout" state

      3. GPIF runs readout sequence (reads 1 line of pixels), Firmware idles until GPIF reaches "idle" state

      4. Firmware switches the sensor to the next line

      5. TODO: Firmware has to insert a Tag to the first byte of the Data-Stream, similar to the DataSignature in the example

       

      Since the GPIF always reads an entire line of the sensor, these tags should allow the host application to clearly identify every pixels data in the byte-stream it receives from the endpoint. Could you give me an example how to modify the buffers contents outside the "GpifToUsbDmaCallback"?

       

      I'm also open to completely different approaches to map the bytes received from the endpoint to individual pixels.

        • 1. Re: FX3 - GpifToUSB - Insert Tags to GPIF Data Stream
          HemanthR_06

          Hi,

           

          You can make use of dmaCfg.prodHeader when you configure DMA channel between your PIB Socket and USB Socket. You can mention how long is your Tag in this member of the structure. You can configure the DMA buffer size as your line size rounded up to closest 16 byte multiple (which is the requirement for a DMA buffer size). If the line size is a multiple of 16 byte then once the buffer is full, you will get a DMA callback (assuming manual channel). In the dma callback you can add header (tag) and commit it to USB.

          (You can refer to AN75779 source code to see how to add header)


          Regards,

          Hemanth  

          1 of 1 people found this helpful