Crc16 ===== Function description: --------------------- This demo shows the calculation of **16 bits CRC**. Configure the size of the polynomial is 16 bits for CRC16 calculation. * Configure the CRC16. * Write data to CRC calculator to start hardware calculation. * Calculate the result of the CRC16 by software, then to compare with the hardware. Detail configuration: --------------------- Crc16/ibm ^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0 byte byte 16 bits 0x8005 0 ================= ================ ================== =================== ================ ============= Crc16/maxim ^^^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0 byte byte 16 bits 0x8005 0xffff ================= ================ ================== =================== ================ ============= Crc16/usb ^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0xffff byte byte 16 bits 0x8005 0xffff ================= ================ ================== =================== ================ ============= Crc16/modbus ^^^^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0xffff byte byte 16 bits 0x8005 0 ================= ================ ================== =================== ================ ============= Crc16/ccitt ^^^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0 byte byte 16 bits 0x1021 0 ================= ================ ================== =================== ================ ============= Crc16/ccitt-false ^^^^^^^^^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0xffff no no 16 bits 0x1021 0 ================= ================ ================== =================== ================ ============= Crc16/x25 ^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0xffff byte byte 16 bits 0x1021 0xffff ================= ================ ================== =================== ================ ============= Crc16/xmodem ^^^^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0 no no 16 bits 0x1021 0 ================= ================ ================== =================== ================ ============= Crc16/dnp ^^^^^^^^^ ================= ================ ================== =================== ================ ============= Initial value Reverse input Reverse output Polynomial size Coefficients Xor value ----------------- ---------------- ------------------ ------------------- ---------------- ------------- 0 byte byte 16 bits 0x3d65 0xffff ================= ================ ================== =================== ================ ============= Test result: ------------ If the output result is same as the result calculated by software according to the theory, then print \"pass\", or print \"fail\". IO connection: -------------- None