Dear expert,
I'm not so clear about below description for block size and BAR_SIZE setting.
"The color bar pattern should be programmed in units of a block or word size dependent on the datatype of the
video being sent. The sizes are defined in the Mipi CSI-2 specification. For example, RGB888 requires a 3-byte
block size which is the same as the pixel size. RAW10 requires a 5-byte block size which is equal to 4 pixels.
RAW12 requires a 3-byte block size which is equal to 2 pixels."
Could you help me check whether my below setting are correct?
Thanks
#example: Patgen Fixed Colorbar 640x480@p30 RAW12
WriteI2C(0x33,0x01) # CSI enable
WriteI2C(0xB0,0x00) # Indirect Pattern Gen Registers
WriteI2C(0xB1,0x01) # PGEN_CTL
WriteI2C(0xB2,0x01)
WriteI2C(0xB1,0x02) # PGEN_CFG RAW12 requires a 3-byte block size which is equal to 2 pixels.
WriteI2C(0xB2,0x33)
WriteI2C(0xB1,0x03) # PGEN_CSI_DI 0x2C for RAW12
WriteI2C(0xB2,0x2c)
WriteI2C(0xB1,0x04) # PGEN_LINE_SIZE1 640/2*3=960 Bytes
WriteI2C(0xB2,0x03)
WriteI2C(0xB1,0x05) # PGEN_LINE_SIZE0
WriteI2C(0xB2,0xc0)
WriteI2C(0xB1,0x06) # PGEN_BAR_SIZE1 640/8/2*3=120
WriteI2C(0xB2,0x0)
WriteI2C(0xB1,0x07) # PGEN_BAR_SIZE0
WriteI2C(0xB2,0x78)
WriteI2C(0xB1,0x08) # PGEN_ACT_LPF1 480
WriteI2C(0xB2,0x01)
WriteI2C(0xB1,0x09) # PGEN_ACT_LPF0
WriteI2C(0xB2,0xe0)
WriteI2C(0xB1,0x0A) # PGEN_TOT_LPF1 480+vertical blanking for example 496
WriteI2C(0xB2,0x01)
WriteI2C(0xB1,0x0B) # PGEN_TOT_LPF0
WriteI2C(0xB2,0xf0)
WriteI2C(0xB1,0x0C) # PGEN_LINE_PD1 1/30/ PGEN_TOT_LPF 496=67uS; 6700=0x1a2c
WriteI2C(0xB2,0x1a)
WriteI2C(0xB1,0x0D) # PGEN_LINE_PD0
WriteI2C(0xB2,0x2c)
WriteI2C(0xB1,0x0E) # PGEN_VBP set accordingly
WriteI2C(0xB2,0x21)
WriteI2C(0xB1,0x0F) # PGEN_VFP set accordingly
WriteI2C(0xB2,0x0A)