EasyManua.ls Logo

SIYI HM30 - Page 96

SIYI HM30
157 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...
HM30 User Manual v1.3
88
2024 SIYI Technology Copyright
2) USB COM (USB to Serial) (Baud rate is the same with datalink baud rate)
3) Bluetooth
4) MK15 RC Upgrade Port / MK32 RC Type-C Port (Virtual serial port based on USB port)
4.8.4 SDK CRC16 Check 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;
return 2;

Table of Contents

Other manuals for SIYI HM30