#  v4l2 control settings mt9v024 with v4l-ctrl
#  PHYTEC 2021


# show all v4l Controls
#  =======================
v4l2-ctl [CAM_DEVICE] --all (list all)
v4l2-ctl [CAM_DEVICE] -L (list all detail)
v4l2-ctl [CAM_DEVICE] -H (help)

[CAM_DEVICE] = capture device (/dev/videoX). Default = /dev/video0
for example: 
v4l2-ctl -d /dev/video0 --all
or
v4l2-ctl --all


# show camera driver info:
#  =======================
v4l2-ctl -d [CAM_DEVICE] -D


# Check available pixel format:
#  ============================
v4l2-ctl -d [CAM_DEVICE] --list-formats-ext


#  set MT9V024 AEC on/off
#  ======================
# 0 = AEC off / 1 = AEC = on
v4l2-ctl -d [CAM_DEVICE] --set-ctrl=auto_exposure=0


#  set MT9V024 AGC on/off
#  ======================
# 0 = AEC off / 1 = AEC = on
v4l2-ctl -d [CAM_DEVICE] --set-ctrl=gain_automatic=0


#  set MT9V024 SHUTTER
#  =======================
# Number of Rows
v4l2-ctl -d [CAM_DEVICE] --set-ctrl=exposure=480


#  set MT9V024 GLOBAL GAIN
#  ===========================
# Value/16 = Gain
v4l2-ctl -d [CAM_DEVICE] --set-ctrl=gain=16


#  set MT9V024 TEST PATTERN
#  ========================
# range 0-4
v4l2-ctl -d [CAM_DEVICE] --set-ctrl=test_pattern=0


#  set MT9V024 TEST PATTERN COLOR
#  ==============================
# use only in test pattern mode 4
v4l2-ctl -d [CAM_DEVICE] --set-ctrl=test_pattern_color=0


#  set MT9V024 VERTICAL BLANKING
#  =============================
#  number of blank rows
v4l2-ctl -d [CAM_DEVICE] --set-ctrl=vertical_blanking=45


#  set MT9V024 HORIZONTAL BLANKING
#  ===============================
#  number of blank columns
v4l2-ctl -d [CAM_DEVICE] --set-ctrl=horizontal_blanking=94
