Or, is it possible to get an event in OV5640 firmware example, when a frame from image sensor has been finished?
If you look at the Cx3UvcOV5640 firmware in the SDK, you will notice that we are using a manual DMA channel here. In the DMA callback, we are adding the UVC related headers. These headers are different for normal transfers and end of frames (EOF)/HSync. This detection is based in the firmware by making sure that only last data buffer in a frame is partial. So, whenever we get a partial buffer, that will be the end of frame. If you see at the snippet below, we check the DMA-buffer count (if it is less than DMA buffer size), then it is an end of frame. However, Vsync is not that straight forward. This way, you can check end of frame from the firmware without using GPIO.
status = CyU3PDmaMultiChannelGetBuffer(chHandle, &dmaBuffer, CYU3P_NO_WAIT);
while (status == CY_U3P_SUCCESS)
/* Add Headers*/
if(dmaBuffer.count < CX3_APP_DATA_BUF_SIZE)
CyCx3AppAddHeader ((dmaBuffer.buffer - CX3_APP_PROD_HEADER), CX3_APP_HEADER_EOF);
glHitFV = CyTrue;
glPartialBufSize = dmaBuffer.count;