To use the stream Monitor Line and Byte counters operations:
- Set LineCount and ByteCount values in register
(CSI_RX_IF_VBUS2APB_STREAM0_MONITOR_LB -
CSI_RX_IF_VBUS2APB_STREAM3_MONITOR_LB).
- [31:16] LINE_COUNT -> define desired value
- [15:0] BYTE_COUNT -> define desired value
- Set the Virtual Channel to the one that is enabled, and set enable in register SI_RX_IF_VBUS2APB_STREAM0_MONITOR_CTRL.
- [15] FRAME_MON_EN -> set to ‘1’
- [14:11] FRAME_MON_VC -> define VC used
- [4] LB_EN -> set to ‘1’
- [3:0] LB_VC -> set to VC used
Software should now use the interrupts in register
CSI_RX_IF_VBUS2APB_MONITOR_IRQS. To be able to do that you will need to allow those
interrupts through the mask register CSI_RX_IF_VBUS2APB_MONITOR_IRQS_MASK_CFG.
- By default, the CSI_RX_IF_VBUS2APB_MONITOR_IRQS_MASK_CFG
register is set to all ‘0’, meaning all interrupts are disabled.
- [7] STREAM0_LINE_CNT_E RROR_IRQM -> set to
‘1’
- STREAM0_LB_IRQM [1] -> set to ‘1’
- Create an interrupt handler to read from
CSI_RX_IF_VBUS2APB_MONITOR_IRQS.
- [7] STREAM0_LINE_CNT_E RROR_IRQ -> read, if ‘1’,
line count error interrupt is triggered
- [1] STREAM0_LB_IRQ -> read, if ‘1’, line/byte
counter interrupt is triggered
Note that the interrupt will trigger on each frame when it reaches byte number BYTE_COUNT in line number LINE_COUNT.
To ensure correct functionality, it is highly recommended that the input device (i.e. camera) should be configured after the CSI_RX_IF has been configured and enabled.
Software must make sure all the Virtual Channel fields in the registers explained above are set to the correct VC being used by the stream.