Go through AN75779 and AN65974 app note firmware before looking into this code. Designing or modifying this firmware would be very hard if you don't have an idea of streaming video from one image sensor. We merged two app note firmware to come up with a firmware that can stream video through three cameras. Note that this firmware is tested using Lattice MACHXO3L FPGA, FX3 and three camera modules. FPGA does UVC header addition, get video data from two parallel sensor, get video data from one RGB MIPI sensor and send to FX3 slave FIFO GPIF. FX3 in turn sends the VIdeo data to three UVC interfaces.
You can use the code example attached with the post. This code example can run three UVC applications at a time. GPIF thread 0 is used for camera 1, Thread 1 for camera 2 and thread 2&3 for camera 3.
For your application:
The idea is to use thread 0 and 1 for getting video data from first image sensor and thread 2 and 3 to get video data from second image sensor. Use two DMA channels instead of three. Use DMA call back function 3 design for both your DMA channels call back function.
FX3_Three UVC_ interfaces.zip 456.4 K