EasyManua.ls Logo

SIYI A2mini - SDK CRC16 Code

SIYI A2mini
64 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
A2 mini User Manual V1.1
28
2023 SIYI Technology Co., Ltd, All Rights Reserved
Acquire Attitude Data
55 66 01 00 00 00 00 0d e8 05
Set Video Output as HDMI (Only available on A8 mini, restart to take effect)
55 66 01 01 00 00 00 0c 06 f2 ae
Set Video Output as CVBS (Only available on A8 mini, restart to take effect)
55 66 01 01 00 00 00 0c 07 d3 be
Turn Off both CVBS and HDMI Output (Only available on A8 mini, restart to take effect)
55 66 01 01 00 00 00 0c 08 3c 4f
Read Range from Laser Rangefinder (Low byte in the front, high byte in the back, available on ZT30)
55 66 01 00 00 00 00 15 D1 96
3.3.5 SDK CRC16 Code
const uint16_t crc16_tab[256];
/***********************************************************
CRC16 Coding & Decoding G(X) = X^16+X^12+X^5+1
***********************************************************/
uint16_t CRC16_cal(uint8_t *ptr, uint32_t len, uint16_t crc_init)
{
uint16_t crc, oldcrc16;
uint8_t temp;
crc = crc_init;
while (len--!=0)
{
temp=(crc>>8)&0xff;
oldcrc16=crc16_tab[*ptr^temp];
crc=(crc<<8)^oldcrc16;
ptr++;
}
//crc=~crc; //??
return(crc);
}
uint8_t crc_check_16bites(uint8_t* pbuf, uint32_t len,uint32_t* p_result)
{
uint16_t crc_result = 0;
crc_result= CRC16_cal(pbuf,len, 0);
*p_result = crc_result;

Related product manuals