#  register settings mt9v02x
#  PHYTEC 2015, V1.7


#  set MT9V024 Color Bit on/off
#  ============================
# if the mt9v022/24-driver is loaded, set the color-Bit to the correct state
# on mt9v022(color) the color-Bit is at position 2 (bin = 0000 0100) and a changing the value is not necessary
# on mt9v024(color) the color-Bit is at position 1 (bin = 0000 0010) and a changing the value is recommended

0x48,0x0F,0xFFFD,a     # mt9v024(color) color-bit disabled, this is recommended for most color-applications
                       # on mt9v024(mono) state  of Bit-1 = 0 is necessary
                       # on mt9v022(color/mono) state of Bit-1 in register 0x0f has no effect
#0x48,0x0F,0x0002,o     # mt9v024(color) color-bit enable (default setting in driver for mt9v024 color version)
						# this is recommended for DPC (see manual)


#  set MT9V02x AGC/AEC on/off
#  ==========================
0x48,0xAF,0x0003     # AGC automatic =  on, AEC automatic =  on (default)
#0x48,0xAF,0x0002     # AGC automatic =  on, AEC automatic = off
#0x48,0xAF,0x0001     # AGC automatic = off, AEC automatic =  on
#0x48,0xAF,0x0000     # AGC automatic = off, AEC automatic = off


#  set MT9V02x manual AGC
#  ======================
0x48,0x35,0x0010       # set gain = 1.00 (default)
#0x48,0x35,0x0014       # set gain = 1.25
#0x48,0x35,0x0018       # set gain = 1.50
#0x48,0x35,0x001C       # set gain = 1.75
#0x48,0x35,0x0020       # set gain = 2.00
#0x48,0x35,0x0024       # set gain = 2.25
#0x48,0x35,0x0028       # set gain = 2.50
#0x48,0x35,0x002C       # set gain = 2.75
#0x48,0x35,0x0030       # set gain = 3.00
#0x48,0x35,0x0034       # set gain = 3.25
#0x48,0x35,0x0038       # set gain = 3.50
#0x48,0x35,0x003C       # set gain = 3.75
#0x48,0x35,0x0040       # set gain = 4.00


#  set MT9V02x manual AEC
#  ======================
#  if  value > (height + V Blanking -2) the framerate is affected
# (extra rows are inserted automatically to lower the framerate according to the exposure settings)

0x48,0x0B,481       # set number of rows = mt9v022[1..32767], mt9v024[0..32765]


#  set MT9V02x BLC
#  ===============
#  set BLC automatic
0x48,0x47,0xFFFE,a     # automatic = on (default)

#  set BLC manual
#0x48,0x47,0x0001,o     # automatic = off
#0x48,0x48,0         # set black level calibration value = [-127..127]


#  set MT9V02x MIRROR
#  ==================
#  set flip row and/or column
#0x48,0x0D,0xFFCF,a     # without flip
#0x48,0x0D,0x0010,o     # flip row
#0x48,0x0D,0x0020,o     # flip column
#0x48,0x0D,0x0030,o     # flip row and column


#  set MT9V02x TESTPATTERN
#  =======================
#  set testpattern off 
#0x48,0x7F,0xDFFF,a     # testpattern off
#0x48,0x70,0x0020,o	   # enable noise correction mt9v022
0x48,0x70,0x0001,o	   # enable noise correction contex A, mt9v024


#  set testpattern
#0x48,0x7F,0x2800,o     # generates vertical shade
#0x48,0x7F,0x3000,o     # generates horizontal shade
#0x48,0x7F,0x3800,o     # generates diagonal shade
#0x48,0x70,0xFFDF,a		# disable noise correction mt9v022 (is nessessary for correct testpattern)
#0x48,0x70,0xFFFE,a		# disable noise correction mt9v024 (is nessessary for correct testpattern)


#  set MT9V02x LVDS
#  ================
0x48,0xB3,0x0000       # enable LVDS driver
0x48,0xB1,0x0000       # de-assert LVDS power-down
0x48,0x0C,0x0001       # issue a soft reset and
0x48,0x0C,0x0000       # followed by 0


#  set LED_OUT control (strobe)
#  ============================
#0x48,0x1B,0x0001       # disable LED_OUT output

#0x48,0x1B,0x0000       # enable LED_OUT output, LED_OUT output high-activ (default)
#0x48,0x1B,0x0002       # enable LED_OUT output, LED_OUT output low-activ


#  set MT4V02x HORIZONTAL BLANKING
#  ===============================
#  number of blank columns
#  control only via c4l-ctrl


#  set MT4V02x VERTICAL BLANKING
#  ===============================
#  number of blank rows
#0x48,0x06,45			#  number of blank rows in a frame (default)
#0x48,0x06,2			#  min. is depend of mode (see datasheet)
#0x48,0x06,32288		#  max.
