Communication protocol =================================== .. note:: This demo is based on a 5MP camera From camera to host -------------------------------------------- ======= ================ ================================= ========== ========= Start CommandType payloadLength payload Stop ======= ================ ================================= ========== ========= 0X55AA CMD(bit[8:0]) lenght(Little-endian,bit[32:0]) payload 0x55BB ======= ================ ================================= ========== ========= +-------+---------+---------------+-------------------------------+------+ | start | cmdtype | payloadlength | payload | stop | +=======+=========+===============+===============================+======+ | 55aa | 01 | image length | image date | 55bb | +-------+---------+---------------+-------------------------------+------+ | 55aa | 02 | info length | camera info | 55bb | +-------+---------+---------------+-------------------------------+------+ | 55aa | 03 | 04 00 00 00 | yy mm dd version([7:4].[3-0]) | 55bb | +-------+---------+---------------+-------------------------------+------+ | 55aa | 05 | 04 00 00 00 | yy mm dd version([7:4].[3-0]) | 55bb | +-------+---------+---------------+-------------------------------+------+ | 55aa | 06 | 09 00 00 00 | "streamoff" | 55bb | +-------+---------+---------------+-------------------------------+------+ From host to camera --------------------------------------- ======= ======== ========= ==== Start Command Parameter Stop ======= ======== ========= ==== 0X55 CMD parameter 0xAA ======= ======== ========= ==== +-----+----------------------+-----------------------------------------------------------------------------+ | CMD | Command effect | parameter | +=====+======================+=============================================================================+ |0x01 |Set camera resolution | bit[6:4]: Camera data format | | | | - 1: Indicates that the resolution of the JPEG format is set | | | | - 2: Indicates the resolution of the RGB565 format | | | | - 3: Indicates the resolution of the YUV format bit | | | | [3:0]: Set the resolution of the camera | | | | - 0: 160x120 | | | | - 1: 320x240 | | | | - 2: 640x480 | | | | - 3: 800x600 | | | | - 4: 1280x720 | | | | - 5: 1280x960 | | | | - 6: 1600x1200 | | | | - 7: 1920x1080 | | | | - 8: 2048x1536 | | | | - 9: 2592x1944 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x02 |Start streaming mode | - 1: 320x240 | | | | - 2: 640x480 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x03 |Set brightness | - 0:default | | | | - 1:+1 | | | | - 2:-1 | | | | - 3:+2 | | | | - 4:-2 | | | | - 5:+3 | | | | - 6:-3 | | | | - 7:+4 | | | | - 8:-4 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x04 |Set contrast | - 0:default | | | | - 1:+1 | | | | - 2:-1 | | | | - 3:+2 | | | | - 4:-2 | | | | - 5:+3 | | | | - 6:-3 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x05 |Set saturation | - 0:default | | | | - 1:+1 | | | | - 2:-1 | | | | - 3:+2 | | | | - 4:-2 | | | | - 5:+3 | | | | - 6:-3 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x06 |Set EV | - 0:default | | | | - 1:+1 | | | | - 2:-1 | | | | - 3:+2 | | | | - 4:-2 | | | | - 5:+3 | | | | - 6:-3 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x07 |Set white balance | - 0:Auto | | | | - 1:Sunny | | | | - 2:Office | | | | - 3:Cloudy | | | | - 4:Home | +-----+----------------------+-----------------------------------------------------------------------------+ |0x08 |Set special effects | - 0:Normal | | | | - 1:Cool light | | | | - 2:Warm | | | | - 3:Black and white | | | | - 4:Sepia | | | | - 5:Negative | | | | - 6:Greenish | | | | - 7:Overexposure | | | | - 8:Solarize | | | | - 9: Yellowish | +-----+----------------------+-----------------------------------------------------------------------------+ | | | Exclusive to 5MP | |0x09 |Focus control | - 0:Open auto focus basic configuration | | | | - 1:Single auto focus | | | | - 2:Continuous autofocus | | | | - 3:Pause auto focus | | | | - 4:Turn off auto focus | +-----+----------------------+-----------------------------------------------------------------------------+ |0x0a |Exposure control | - 1: Turn on auto exposure | | | | - 0: Turn off auto exposure | +-----+----------------------+-----------------------------------------------------------------------------+ |0x0b |Gain control | - 1: Turn on auto gain | | | | - 0: Turn off auto gain | +-----+----------------------+-----------------------------------------------------------------------------+ |0x0c |White balance control | - 1: Turn on auto white balance | | | | - 0: Turn off auto white balance | +-----+----------------------+-----------------------------------------------------------------------------+ |0x0d |Manual gain | Gain value of two bytes | | | | - 5MP adjustment range: 10~1023 | | | | - 3MP adjustment range: 1~31 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x0e |Manual exposure | exposure value of three bytes | | | | - 5MP adjustment range: 1000~30000 | | | | - 3MP adjustment range: 100~1400 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x0f |getting information | Get the basic information of the camera. For example: the resolution | | | | supported by the camera, whether the camera supports auto focus | +-----+----------------------+-----------------------------------------------------------------------------+ |0x10 |Taking Pictures | | +-----+----------------------+-----------------------------------------------------------------------------+ | | | Exclusive to 3MP | |0x11 |Set sharpness | - 0:default | | | | - 1:+1 | | | | - 2:+2 | | | | - 3:+3 | | | | - 4:+4 | | | | - 5:+5 | | | | - 6:+6 | | | | - 7:+7 | | | | - 8:+8 | +-----+----------------------+-----------------------------------------------------------------------------+ |0x12 |Debug mode | Three bytes | | | | - Byte 1 represents the high eight bits of the register | | | | - Byte 2 represents the lower eight bits of the register | | | | - Byte 3 represents the value written to the register | +-----+----------------------+-----------------------------------------------------------------------------+ |0x21 |Stop streaming mode | | +-----+----------------------+-----------------------------------------------------------------------------+