Hi guys, could anyone please instruct me how I can implement this function that I attached it down in matlab? exactly the if condition and bit left shifting and bitwise and in matlab..
here's my function in c++: ( Im not professionaly in matlab and would be appreciated for any help) ..this function gets two input, one is crcData which it's uint8_t(byte type), second is two bytes type (uint16_t)
thanks alot !
uint16_t calcCRC(uint8_t crcData, uint16_t crcReg)
for (i = 0; i < 8; i++)
if (((crcReg & 0x8000) >> 8) ^ (crcData & 0x80))
crcReg = (crcReg << 1) ^ CRC16_POLY;
crcReg = (crcReg << 1);
crcData <<= 1;