Documente Academic
Documente Profesional
Documente Cultură
Communication Protocol
User Manual
V 3.00
2015.01
Notes1: The information is subject to change without notice. Before using this document, please confirm that
this is the latest version.
Notes2: Not all products and/or types are available in every country. Please check with a ZhongAnXin sales
representative for availability and additional information.
Revision Table
Date Rev. Content of revision Approval
2007-8 1.00 Composing a first draft Mr. Zheng
2011-1 2.00 The second Amendment Mr. Feng
2015-1 3.00 The third revised edition Mr. Lin
Catalogue
Introduce protocol.................................................................................................................................................................. 4
Protocol format ...................................................................................................................................................................... 4
Communication command..................................................................................................................................................... 5
Command list ........................................................................................................................................................................ 5
Command detailed description .............................................................................................................................................. 6
EXIT_HOST_MODE.............................................................................................................................................................. 9
SYSTEM_RESET.................................................................................................................................................................. 9
EXEC_COMM_FORMULA .................................................................................................................................................... 9
READ_DATA ....................................................................................................................................................................... 10
WRITE_DATA ...................................................................................................................................................................... 11
READ_FBUF ....................................................................................................................................................................... 13
WRITE_FBUF ..................................................................................................................................................................... 15
GET_FBUF_LEN ................................................................................................................................................................. 17
SET_FBUF_LEN ................................................................................................................................................................. 18
FBUF_CTRL........................................................................................................................................................................ 18
COMM_MOTION_CTRL ..................................................................................................................................................... 19
COMM_MOTION _STATUS ................................................................................................................................................. 19
COMM_MOTION _DETECTED .......................................................................................................................................... 20
MIRROR_CTRL................................................................................................................................................................... 20
MIRROR_STATUS.............................................................................................................................................................. 21
COLOR_CTRL .................................................................................................................................................................... 21
COLOR_STATUS ................................................................................................................................................................ 22
POWER_SAVE_CTRL ......................................................................................................................................................... 22
POWER_SAVE _STATUS .................................................................................................................................................... 24
AE_CTRL ............................................................................................................................................................................ 25
AE_STATUS ....................................................................................................................................................................... 27
MOTION_CTRL .................................................................................................................................................................. 28
MOTION_STATUS ............................................................................................................................................................... 30
TV_OUT_CTRL ................................................................................................................................................................... 32
OSD_ADDR_CHAR ............................................................................................................................................................ 32
GET_FLASH_SIZE.............................................................................................................................................................. 33
ERASE_FLASH_SECTOR .................................................................................................................................................. 33
ERASE_FLASH_ALL .......................................................................................................................................................... 33
SET_TIME ........................................................................................................................................................................... 34
GET_TIME .......................................................................................................................................................................... 34
ZOOM_CTRL ...................................................................................................................................................................... 34
ZOOM_STATUS................................................................................................................................................................... 35
DOWNSIZE_CTRL .............................................................................................................................................................. 35
DOWNSIZE_STATUS .......................................................................................................................................................... 36
BATCH_WRITE ................................................................................................................................................................... 37
READ_LOGO ...................................................................................................................................................................... 38
SET_BITMAP ...................................................................................................................................................................... 38
Introduce protocol
VC0706 support multiple serial port, and used with the same standard communication protocol in serial
port communication.
We can gain VC0706 information from serial port communication protocol, and make control.
VC0706 communication protocol allowed to connect multiple VC0706 equipment at same time, and the each
equipment can transmission and reception the protocol command.
Protocol format
The document is sending side by client side serial port tool, and VC0706 is reception side. The format of
Serial port communication protocol as follow:
Receive command format: protocol mark(1 byte)+serial data(1 byte)+data length(1 byte) +data (0~16
bytes)
Reply command format: protocol mark(1 byte)+serial data(1 byte)+command word(1 byte)
+condition byte(1 byte)+date length(1 byte)+data(0~16 bytes).
And among them:
Protocol mark: It is used to mark the protocol as VC0706 serial port communication protocol. Receive
protocol mark is 0x56(‘V’); Reply protocol mark is 0x76(‘v’).
Serial data: It is used to differentiate each equipment when many equipment simultaneous
connection. Just the serial data of the serial port command is the same as the serial
data of the equipment, the equipment be able to accept these command. The value
range of the serial data is 0~255.
Command word: It is used to mark specific serial port communication command.
Data length: It show data length, but it not include protocol mark, serial data, command
word and data length. The value range is 0~16.
Data: Command used data, different command with different data length and format,
16 bytes max.
Status byte: Write commands for control commands and data. The data first byte indicates
the command success or not. 0 indicates success. 0x01~0xFF indicates
failure.
Meaning of state type as follow:
1 Illicit command word, it indicates that the command word system does not support
2 Illicit data length, it indicates that the command does not support the data length
Communication command
Command list
User interface command:
Command Definition CW Command meaning
GET_VERSION 0x11 Get Firmware program version
SET_SERIAL_NUMBER 0x21 Set the serial data
SET_PORT 0x24 Set the serial port property
EXIT_HOST_MODE 0x25 Exit the Host control mode
SYSTEM_RESET 0x26 System reset
EXEC_COMM_FORMULA 0x27 Perform the serial port formula
READ_DATA 0x30 Read the equipment's register
WRITE_DATA 0x31 Writes data to equipment registers
READ_FBUF 0x32 Read images from FBUF
WRITE _FBUF 0x33 Write images to FBUF
GET_FBUF_LEN 0x34 Get the length of images in FBUF
SET_FBUF_LEN 0x35 Set the length of images in FBUF
FBUF_CTRL 0x36 Control FBUF
COMM_MOTION_CTRL 0x37 Start or stop the serial port Motion monitoring
COMM_MOTION_STATUS 0x38 Get the Motion monitoring status of the serial port
COMM_MOTION_DETECTED 0x39 When start serial port Motion detection, for the serial
port send detection to Motion
MIRROR_CTRL 0x3A Set image to Mirror display or not
MIRROR_STATUS 0x3B Get states of current image whether Mirror
COLOR_CTRL 0x3C Color control
COLOR_STATUS 0x3D Get the current color control mode and the current color
POWER_SAVE_CTRL 0x3E Control the entry and exit mode of energy saving
POWER_SAVE_STATUS 0x3F Check to see whether enter mode of energy saving
AE_CTRL 0x40 Set the AE related properties
AE_STATUS 0x41 Get the AE related properties
MOTION_CTRL 0x42 Motion control
MOTION_STATUS 0x43 Get Motion states
TV_OUT_CTRL 0x44 Control video on/off
OSD_ADD_CHAR 0x45 Add OSE character
SET_TIME 0x50 Set RTC clock time
GET_TIME 0x51 Get RTC clock time
ZOOM_CTRL 0x52 Zoom control
ZOOM_STATUS 0x53 Zoom state
DOWNSIZE_CTRL 0x54 DownSize control
DOWNSIZE _STATUS 0x55 DownSize state
GET_FLASH_SIZE 0x60 Get the size of SPI Flash
ERASE_FLASH_SECTOR 0x61 Erasure one piece of Flash
ERASE_FLASH_ALL 0x62 Erasure whole Flash
READ_LOGO 0x70 Read LOGO and display
SET_BIZTMAP 0x71 OperateBitmap
BATCH_ WRITE 0x80 Batch write data
The INTER and FRAC of the commonly used baud rates as follow:
Explanation:
This command is used to pass host flow to open mode or start mode. After finished all the setting in
this mode system, Send the command to the end of the Host configuration operation, make the
system enter the running state.
SYSTEM_RESET
Command function: System reset command. Reset the entire system software and hardware
Explanation: About 10 milliseconds later reset the entire system, after return reply
EXEC_COMM_FORMULA
Command function: Execute serial port formula
Explanation:
After the system receives the command, the system to read the information of formula from the
control information, finished the operation to return the reply command.
The reply time of this command is related to formula data. If have time-out handle, need add
execute time of formula data.
READ_DATA
Command function: read data of chip register, Sensor register, I2C E2prom, SPI equipment or
CCIR656 equipment.
Command format: 0x56+ serial data +0x30+ data length + equipment type(1 byte)+ The number
of data to be read (1 byte)+ configuration information
1: Chip register
2: Sensor register
3: CCIR656 register
4: I2C E2prom
5: SPI E2prom
6: SPI Flash
The number of data read: Represents the number of consecutive reads starting at the specified
address. The number of data read is limited. “The number of data read” x “data wide” can’t greater
than 16 bytes, Otherwise, it can cause the system to go wrong.
About Sensor and CCIR656 equipment, the data width of registers may be different. Register width
represents the data width of each register, value as 1~3 byte.
If running correct, then reply: 0x76+serial data+0x30+0x00+the value of the read register.
If equipment type in the command is incorrect or when operating the Sensor and CCIR656, The
register address width is different from the set in the system, then reply: 0x76+serial data
+0x30+0x03+0x00
The number of data contained in the reply command: “The number of data to be read” x “data width”
For example:
0x56+0x00+0x30+0x04+0x01+0x02+0x18+0x00
0x56+0x00+0x30+0x05+0x02+0x01+0x01+0x00+0x20
Start reading 1 byte of data from Sensor register address 0x0020 (Sensor register data
width is 1 byte)
0x56+0x00+0x30+0x05+0x02+0x02+0x02+0x00+0x20
Start reading 2 bytes of data from Sensor register address 0x0020 (Sensor register data
width is 2 bytes)
0x56+0x00+0x30+0x05+0x03+0x03+0x01+0x00+0x40
Start reading 3 bytes of data from CCIR656 register address 0x0040 (CCIR656 register
data width is 1 byte)
0x56+0x00+0x30+0x04+0x04+0x04+0x02+0x40
0x56+0x00+0x30+0x04+0x05+0x03+0x08+0x00
0x56+0x00+0x30+0x06+0x06+0x08+0x00+0x20+0x40+0x60
WRITE_DATA
Command function: Write data to chip register, Sensor register, I2C of E2prom, SPI
equipment or CCIR equipment.
1: Chip register
2: Sensor register
3: CCIR656 register
4: I2C E2prom
5: SPI E2prom
6: SPI Flash
CCIR656 equipment: 0x56+ serial data +0x31+ data length +0x03+ The number of data to be write
+ register width (1 byte)+ register address (2 bytes) + data
I2C E2prom: 0x56+ serial data +0x31+ data length +0x04+ The number of data to be write +
register address (2 bytes) + data
SPI E2prom: 0x56+ serial data +0x31+ data length +0x05+ The number of data to be write
+ register address (2 bytes) + data
SPI equipment: 0x56+ serial data +0x31+ data length +0x06+ The number of data to be write +
register address (4 bytes) + data
The number of data to be written: Represents the number of consecutive write starting at the
specified address. The number of data write is limited. The number of data written is limited to the
data in the command; they can’t greater than 16 bytes.
When the Sensor and CCIR656 equipment is writing operation, if the data widen greater than 1 byte,
the storage mode in each data of multiple bytes is high data in front and low data in behind.
For SPI equipment (SPI E2prom and SPI Flash), the address of write operation cannot span two 2
pages, Otherwise, it can cause the write in to go wrong. Different SPI equipment has different Page
sizes. For SPI equipment should be attention to write operation of multi-byte.
If equipment type in the command is incorrect or when operating the Sensor and CCIR656, The
register address width is different from the set in the system, then reply: 0x76+serial datas
+0x31+0x03+0x00
For example:
0x56+0x00+0x31+0x06+0x01+0x02+0x18+0x00+0x11+0x22
Write in 0x11, 0x22 of data from 0x1800 addresses to Chip register address
0x56+0x00+0x31+0x06+0x02+0x01+0x01+0x00+0x20+0x80
Write in 0x80 of data to Sensor register 0x0020 addresses (Sensor register data width is 1
byte)
0x56+0x00+0x31+0x09+0x02+0x02+0x02+0x00+0x20+0x01+0x00+0x02+0x00
Write in 0x0100, 0x0200 of data from 0x0020 addresses to Sensor register (Sensor
register data width is 2 bytes)
0x56+0x00+0x31+0x06+0x03+0x03+0x01+0x00+0x20+0x41+0x42+0x43
Write in 0x41, 0x42, 0x43 of date from 0x0020 address to CCIR656 register (CCIR656
register data width is 1 byte)
0x56+0x00+0x31+0x08+0x04+0x04+0x02+0x40+0x11+0x12+0x13+0x14
0x56+0x00+0x31+0x07+0x05+0x03+0x02+0x40+0x21+0x22+0x23
0x56+0x00+0x31+0x0D+0x06+0x07+0x00+0x20+0x40+0x60+0x30+0x31+0x32+0x33+0x3
4+0x35+0x36
It need writing the data from the address 0x00204060 into SPI Flash, according to the
sequential writes 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36. It is total of 7 bytes of data
READ_FBUF
Command function: Read images from FBUF
Command format: 0x56+ serial data +0x32+0x0C+ FBUF frame type (1 byte)+ operating
mode (1 byte)+ start address (4 bytes)+ data length (4 bytes)+ delay time(2 bytes)
FBUF frame type: Which one is the target image between the current frame and next frame?
0: current frame
1: next frame
Bit[2:1]: Indicates the port type that receives the image data
2b’01: MCU serial port (just support MCU data read-write mode)
2b’10: High speed serial port (support DMA and MCU data read-write mode)
2b’11: SPI port (support DMA and MCU data read-write mode)
Bit3: When the port of receive image data is SIP port, used to represent equipment
type of SPI connect. For non SPI port, the bit is 1.
0: connect SPI Flash (Indicates the image obtained from reading FBUF is stored in
the SPI Flash)
1: connect SPI Host (Indicates the image read from FBUF is sent out by the SPI
port)
Start address: The starting address of the data read in the FBUF
If the port of receiving image data is SPI port, and connect SPI Flash, This control represents the
starting address of the SPI Flash memory FBUF image. The FBUF read data is fixed at 0 at the start
address of FBUF. So, In this case, the length of the data is generally specified as the length of the
entire image.
Delay time: The time interval between the command and the data, the unit is 0.01ms.
Reply format:
If running correctly, reply: 0x76+ serial data +0x32+0x00+0x00 and then send the data.
After sent the data, send the return command to indicate that the data is sent.
If parameter setting or communication error, reply 0x76+ serial data +0x32+ error code +0x01
For example:
0x56+0x00+0x32+0x0C+0x00+0x0C+0x00+0x00+0x00+0x00+0x00+0x00+0xA0+0xB0+0x
10+0x00
To read FBUF current frame image through MCU serial port by MCU mode. Image data
start from address 0x0000, length is 0xA0B0.
0x56+0x00+0x32+0x0C+0x01+0x0D+0x00+0x00+0x00+0x10+0x00+0x00+0x02+0x00+0x
10+0x00
To read FBUF next frame image through high speed serial port by DMA mode. Image data
start from address 0x0100, length is 0x0200.
0x56+0x00+0x32+0x0C+0x00+0x0F+0x00+0x00+0x00+0x10+0x00+0x00+0x02+0x00+0x
10+0x00
To read FBUF current frame image through SPI port by DMA mode. Image data start from
address 0x0100, length is 0x0200.
0x56+0x00+0x32+0x0C+0x00+0x07+0x00+0x02+0x80+0x00+0x00+0x00+0xB0+0x20+0x
10+0x00
To read FBUF current frame image through SPI port by DMA mode and store to SPI Flash.
The Flash address of storage image data is address 0x28000, length is 0xB020.
Explanation:
The system receives the command, first reply command, then read the specified length data from
FBUF and send it to the set port, after the data is sent, the reply command indicates that the data is
sent.
Must stop the specified frame before invoking the command, Otherwise, images in FBUF have been
updated, it will result in reading image data is wrong.
To read the images in FBUF, can read it all at once through this command, also can be read
multiple times. If use high speed serial port or SPI port as the data read port, recommended read
data by DMA mode.
WRITE_FBUF
Command function: Write images from FBUF
2b’01: MCU serial port (Only support MCU data read-write mode)
2b’10: High speed serial port (support DMA and MCU data read-write mode)
2b’11: SPI port (support DMA and MCU data read-write mode)
Bit3: When the port that receives the image data is the SPI port, used to represent
equipment type of SPI connect.
0: Connect SPI Flash (Indicates write the image of in SPI Flash to FBUF)
1: Connect SPI Host (Indicates write the image to FBUF by SPI port)
Bit4: Indicates when the input source is FBUF, this write operation whether is the first
time in the operation of writing images to FBUF.
1: First time
If the image is written multiple times, set this bit to 1 at the first time, set it to 0 in future operations.
This control is only useful the input source as FBUF, useless other input sources.
It need to send the image data by SPI port, and connect SPI Flash, the control bit represents the
image to be read at the start address of SPI Flash. The FBUF write data is fixed at 0 at the start
address of FBUF. So, In this case, the length of the data is generally specified as the length of the
entire image.
Delay time: The time interval between the command and the data, the unit is 0.01ms
Reply format:
If run correctly, reply: 0x76+serial data+0x3+0x00+0x00 and then send the data.
After sent the data, send the return command to indicate that the data is sent.
For example:
0x56+0x00+0x33+0x0B+0x0C+0x00+0x00+0x00+0x00+0x00+0x00+0xA0+0xB0+0x10+0x
00
Write image to FBUF through MCU serial port by MCU mode. Image data start from
address 0x0000, length is 0xA0B0
0x56+0x00+0x33+0x0B+0x0D+0x00+0x00+0x00+0x10+0x00+0x00+0x02+0x00+0x10+0x
00
Write image to FBUF through high speed serial port by DMA mode. Image data start from
address 0x0100. Length is 0x0200
0x56+0x00+0x33+0x0B+0x1D+0x00+0x00+0x00+0x00+0x00+0x00+0x02+0x00+0x10+0x
00
When input source is FBUF, write image to FBUF through high speed serial port by DMA
mode. Image data start from address 0x0000. length is 0x0200. And this operation is the
first time in the whole image writing operation
0x56+0x00+0x33+0x0B+0x0F+0x00+0x00+0x00+0x10+0x00+0x00+0x02+0x00+0x10+0x0
0
Write image to FBUF through SPI port by DMA mode. Image data start from address
0x0100, length is 0x0200.
0x56+0x00+0x33+0x0B+0x07+0x00+0x02+0x80+0x00+0x00+0x00+0xB0+0x20+0x10+0x
00
Read image in SPI flash through SPI port by DMA mode and write image to FBUF. The
SPI Flash address of image data is address 0x28000, length is 0xB020.
Explanation:
The system receives the command, first setting relevant, then reply command, then wait for receive
data, then reply command again.
We must to stop the specified image frame before who will invoke this command.
If use high speed serial port or SPI port as the data write port, recommended write data by DMA
mode.
GET_FBUF_LEN
Command function: Gets the size of the image in FBUF
FBUF frame type: Indicates that the image in the current frame or next frame is to be
obtained
0: current frame
1: next frame
Reply format:
If the FBUF frame type parameter sets the error, reply: 0x76+ serial data +0x34+0x03+0x00
For example:
This command invoking before read FBUF image, used to obtain the length of image in FBUF, in
order to read the FBUF image.
SET_FBUF_LEN
Command function: Set the image size in the next frame of FBUF
For example:
Explanation:
The set image size must be the same write the image size of FBUF; otherwise, the final image may
be displayed.
FBUF_CTRL
Command function: FBUF frame control. Include stop frame, Switch frame and Restore frame
2: Switch frame
Reply format:
For example:
COMM_MOTION_CTRL
Command function: Used to control whether open the Motion monitoring of the serial port
0: Turn-off
1: Turn-on
Reply format:
If the control mark set error, reply: 0x76+ serial data +0x37+0x03+0x00
For example:
Explanation:
After open the serial port Motion detection, If detect Motion, system will send command
“COMM_MOTION_DETECTED” by serial port.
COMM_MOTION _STATUS
Command function: Obtain current serial port Motion monitoring
Reply format:
If run correctly, reply: 0x76+ serial data +0x38+0x00+0x01+ control mark (1 byte)
0: turn-off
1: turn-on
For example:
Command format:
After the serial port has been opened, when the system detects Motion, send the command
notification monitor by serial port.
For example:
Explanation:
MIRROR_CTRL
Command function: control Sensor Mirror and Non Mirror display
0: by GPIO
1: by serial port
Mirror mode: When control by serial port, it is Mirror display or Non Mirror display.
1: Mirror display
This control only works when the control mode is by serial port. When control by GPIO, It is set
according to the GPIO value of the control Mirror.
Reply format:
If the parameter is error, reply: 0x76+ serial data +0x3A+ error code +0x00
For example:
0x56+0x00+0x3A+0x02+0x01+0x00 set to control the Mirror by serial port, and set to non-
Mirror display
0x56+0x00+0x3A+0x02+0x01+0x01 set to control the Mirror by serial port, and set to Mirror
display
MIRROR_STATUS
Command function: Get Sensor whether Mirror display, and Mirror control mode
0: Indicates by GPIO
For example:
COLOR_CTRL
Command function: Set color control mode and color display mode
0: Indicates by GPIO
Control mode: When control by serial port, this is the color display mode
This control is only effective when control mode is by serial port. When control by GPIO, then the set
on the basis of control color GPIO value.
Reply format:
For example:
0x56+0x00+0x3C+0x02+0x01+0x00 set to control the color through the serial port, and set up
automatic switch black and white color
0x56+0x00+0x3C+0x02+0x01+0x01 set to control the color through the serial port, and set
color display
0x56+0x00+0x3C+0x02+0x01+0x02 set to control the color through the serial port, and set the
black and white display
COLOR_STATUS
Command function: Set color control mode and color display mode
0: Indicates by GPIO
For example:
0x56+0x00+0x3D+0x00 Gets the current color control mode and color status
POWER_SAVE_CTRL
Command function: Control whether to enter energy saving mode
Control item:
The first byte is mean that the control of energy saving mode through serial port or GPIO.
0: Indicates by GPIO
The second byte is used to indicate whether to enter Power Save state
This control is only effective when control mode is by serial port. When control by GPIO,
then the set on the basis of control energy saving mode GPIO value.
If want to set energy saving mode relevance with Motion, then energy saving mode control cannot
be Set to GPIO port control. Otherwise the GPIO control will be final.
The second and three bytes indicate, when energy saving mode relevance with Motion, The unit is
10 milliseconds of the time interval from no Motion to the energy saving mode.
Reply format:
For example:
0x56+0x00+0x3E+0x03+0x00+0x01+0x01
The control command of energy saving mode, enter energy saving mode through serial port control
0x56+0x00+0x3E+0x03+0x00+0x01+0x00
The control command of energy saving mode, exit energy saving mode through serial port control
0x56+0x00+0x3E+0x03+0x00+0x00+0x00
The control command of energy saving mode, control energy saving mode through GPIO
0x56+0x00+0x3E+0x04+0x01+0x02+0x01+0x2C
POWER_SAVE _STATUS
Command function: Get current energy saving mode status
Reply format:
Control item:
The first bytes indicate, currently through the serial port or GPIO to carry out the control of
energy-saving mode.
Bit2: Control energy saving mode whether linkage with Motion, If linkage, then
specifying the time enter energy saving mode after no Motion. And exit
the energy saving mode when Motion is detected.
If you want to set energy saving mode linkage with Motion, Energy saving mode control cannot be
set to GPIO port control; otherwise the GPIO control will be final
The second and three bytes indicate, when energy saving mode relevance with Motion, The unit is
10 milliseconds of the time interval from no Motion to the energy saving mode.
For example:
0x56+0x00+0x3F+0x01+0x00
Get energy saving mode control mode and energy saving mode state
0x56+0x00+0x3F+0x01+0x01
AE_CTRL
Command function: AE Attribute Control
0: Set 50Hz/60Hz
Control mode: Indicate control this AE attributive through serial port or GPIO
0: GPIO control
0: 50Hz
1: 60Hz
When set automatically switch / force indoor: Indicate the mode of switching to set
The control item is only valid when control mode is controlled by serial port. When control by GPIO,
the set is based on the GPIO value of control the energy saving mode.
Reply format:
For example:
AE_STATUS
Command function: Get specified AE attribute configuration
0: Set 50Hz/60Hz
Reply format:
0: Set 50Hz/60Hz
Control mode: Indicate control this AE attribute through serial port or GPIO
0: GPIO control
0: 50Hz
1: 60Hz
When set automatically switch / force indoor: Indicate the current mode of switching
For example:
MOTION_CTRL
Command function: Motion control
Command format: 0x56+ serial data +0x42+ data length +Motion Control Attribute + control
item
Control item: Indicate the configuration of the Motion control attribute to be set
0: GPIO control
The second byte represents if is serial port control, need to set Motion Enabling state
0: Normal output of low level output, Output high level when alarm
1: Normal output high level output, output low level when alarm
The second and three bytes indicate the alarm time: Data storage mode is high in front,
low behind, unit is 10ms.
The first byte indicates whether to open or close the alarm output function
Reply format:
For example:
0x56+0x00+0x42+0x03+0x00+0x01+0x01
Sets the enabling of Motion detection for the serial port, and turn on Motion detection
0x56+0x00+0x42+0x03+0x00+0x01+0x00
Sets the enabling of Motion detection for the serial port , and turn off Motion detection
0x56+0x00+0x42+0x03+0x00+0x00+0x00
Explanation:
If the alarm output is to be used, please distribute GPIO port for alarm output.
MOTION_STATUS
Command function: Get the configuration for the specified Motion attribute
Reply format:
Control item: The first byte indicate GPIO control or serial port control
0: GPIO control
1: Continue alarm
0: Normal output of low level output, Output high level when alarm
1: Normal output high level output, output low level when alarm
The second and three bytes indicate the alarm time: high in front, low behind, unit is 10ms.
The first byte indicates whether to open or close the alarm output function
For example:
Reply format:
For example:
OSD_ADDR_CHAR
Command function: Add OSD characters to the OSD character channel (channel 1)
Start address: Indicate the starting address of the character to display. Indicate format:
Bit[4-0]: Indicate the column coordinates of the character in a line of the character
channel
Reply format:
For example:
0x56+0x00+0x45+0x07+0x06+0x24+0x1F+0x2C+0x30+0x2C+0x26+0x35+0x32
GET_FLASH_SIZE
Command function: Get SPI Flash size
For example:
Explanation:
The system can only recognize the capacity of part SPI Flash. For SPI Flash that cannot be
recognized, the length get from this command is 0
ERASE_FLASH_SECTOR
Command function: Erase the Sector that SPI Flash specifies
ERASE_FLASH_ALL
Command function: Erase the whole SPI Flash
GET_TIME
Command function: Get current RTC time
ZOOM_CTRL
Command function: Zoom control
ZoomWidth: Image width after Zoom, The value must be a multiple of 16, and not
greater than the width of the image in FBUF
ZoomHeight: Image height after Zoom, The value must be a multiple of 8, and not
greater than the height of the image in FBUF
hStartPos: The initial X coordinates of the image in FBUF image after Zoom. The
value must be a multiple of 2.
vStartPos: The initial X coordinates of the image in FBUF image after Zoom. The
value must be a multiple of 8.
Note: The sum of Zoom Width and hStartPos can’t exceed the Width of the image in FBUF
The sum of Zoom Height and vStartPos can’t exceed the height of the image in FBUF
Reply format:
If the image doesn't pass FBUF, Zoom is not allowed, reply:0x76+serial data+0x52+0x04+0x00
After Zoom, Set image width is 320, height is 240, initial position X-coordinate is 64, Y-coordinate is
32
ZOOM_STATUS
Command function: Get the configuration for the Zoom attribute
Reply format:
Image attributes: 12-byte Image correlation attribute, Each attribute item is 2 bytes
byte 9,10: hStartPos, The Zoom window is the x-coordinate of the starting position in
the FBUF image
byte 11,12: vStartPos, The Zoom window is the x-coordinate of the starting position in
the FBUF image
If the image doesn't pass FBUF, Zoom is not allowed, reply: 0x76+serial data+0x53+0x04+0x00
DOWNSIZE_CTRL
Command function: DownSize control, the width and height of the image that will enter the
LBUF JPE module are to zoom, then Put in FBUF module.
2b’11: Reservation
2b’11: Reservation
Note:
The width of the image in the FBUF must be a multiple of 16, The height must be a multiple of 8.
So when set the DownSize, must ensure that the width of the image after DownSize can
satisfies this condition
In the control item, set the height scaling cannot be larger than the width scaling
For example:
0x56+0x00+0x53+0x01+0x05 Scale the image width and height to 1/2 than original image
DOWNSIZE_STATUS
Command function: Gets the configuration for the DownSize attribute
Reply format: 0x76+ serial data +0x54+0x00+0x01+ DownSize control item(1 byte)
2b’11: Reservation
Bit[3:2]: Image height scaling
2b’11: Reservation
BATCH_WRITE
Command function: Write the data of the batch data format, and start the write operation
Data length: The total length of the data written into the batch register, the maximum
value is 400 bytes
Delay time: After the system receives the data, delay the specified time, then send
the reply commander, the unit is 0.01 milliseconds
After the system receives the command, make relevant Settings, and then reply to command, and
then wait for receiving data. After receiving the data, perform batch write operations, and then reply
to command.
Reply format:
If run correctly, reply: 0x76+serial data+0x50+0x00+0x00 then wait for receiving data. After
receiving the data and perform batch write operation, reply again: 0x76+ serial data
+0x50+0x01+0x00
If the data length set is greater than 400, reply: 0x76+serial data+0x50+error code+0x00
For example:
Explanation:
Batch data is batch write data format. Write the register a series of operation to batch write data
format, and then sent by the command. After System receiving the data again, will parse and
complete the corresponding register write operation
READ_LOGO
Command function: Read the Logo from the control information and display it
The system will to command responds after the Logo read the OSD from the control information
Start reading 512 byte of Logo data into OSD from 0x800 address control information, and display.
SET_BITMAP
Command function: Operate Bitmap. Read Bitmap from the control information and control the
Bitmap display.
Command format: 0x56+ serial data +0x71+ data length + operation type(1 byte)+ data
size(2 bytes)+start address(4 bytes)
1: Stop transfer Bitmap from SPI Memory(SPI E2prom or SPI Flash), and stop Bitmap display.
2: Start transfer Bitmap from SPI Memory(SPI E2prom or SPI Flash), and open Bitmap display
Data size: The Bitmap length of need to be transmitted. When the operation type is 1,
there is no this control
Start address: Initial position of Bitmap data of need to be remitted in SPI Memory. Only
operation type 2 needs this control item.
Reply format:
0x56+0x00+0x71+0x01+0x01
0x56+0x00+0x71+0x07+0x02+0x25+0x80+0x00+0x00+0x40+0x00
Read Bitmap with a length of 0x2580 bytes from SPI Memory address 0x4000, and display
0x56+0x00+0x71+0x03+0x04+0x25+0x80
Explanation:
If Bitmap display is started and the way is read SPI Memory, then the SPI channel is monopolized, it
can’t make SPI Memory Read and write access. If want to read and write the SPI Memory, must
stop the Bitmap display.