FX3 - GpifToUSB - Insert Tags to GPIF Data Stream

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
FaFi_4159091
Level 1
Level 1

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.

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

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 AN75779source code to see how to add header)


Regards,

Hemanth  

Hemanth

View solution in original post

1 Reply
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

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 AN75779source code to see how to add header)


Regards,

Hemanth  

Hemanth