MeshProtocolSimulator  1.0.0
Macros
CRC polynomial terms

Those macros can be used to determine CRC polynomials. Those macros contains all possible terms, that can be used. Example CRC-8: X^8 + X^5 + X^4 + 1 => CRC_X5 | CRC_X4 | CRC_X0. Polynomial is represented in binary form. More...

Macros

#define CRC_X0   (0x01UL)
 
#define CRC_X1   (0x01UL << 1U)
 
#define CRC_X2   (0x01UL << 2U)
 
#define CRC_X3   (0x01UL << 3U)
 
#define CRC_X4   (0x01UL << 4U)
 
#define CRC_X5   (0x01UL << 5U)
 
#define CRC_X6   (0x01UL << 6U)
 
#define CRC_X7   (0x01UL << 7U)
 
#define CRC_X8   (0x01UL << 8U)
 
#define CRC_X9   (0x01UL << 9U)
 
#define CRC_X10   (0x01UL << 10U)
 
#define CRC_X11   (0x01UL << 11U)
 
#define CRC_X12   (0x01UL << 12U)
 
#define CRC_X13   (0x01UL << 13U)
 
#define CRC_X14   (0x01UL << 14U)
 
#define CRC_X15   (0x01UL << 15U)
 
#define CRC_X16   (0x01UL << 16U)
 
#define CRC_X17   (0x01UL << 17U)
 
#define CRC_X18   (0x01UL << 18U)
 
#define CRC_X19   (0x01UL << 19U)
 
#define CRC_X20   (0x01UL << 20U)
 
#define CRC_X21   (0x01UL << 21U)
 
#define CRC_X22   (0x01UL << 22U)
 
#define CRC_X23   (0x01UL << 23U)
 
#define CRC_X24   (0x01UL << 24U)
 
#define CRC_X25   (0x01UL << 25U)
 
#define CRC_X26   (0x01UL << 26U)
 
#define CRC_X27   (0x01UL << 27U)
 
#define CRC_X28   (0x01UL << 28U)
 
#define CRC_X29   (0x01UL << 29U)
 
#define CRC_X30   (0x01UL << 30U)
 
#define CRC_X31   (0x01UL << 31U)
 

Detailed Description

Those macros can be used to determine CRC polynomials. Those macros contains all possible terms, that can be used. Example CRC-8: X^8 + X^5 + X^4 + 1 => CRC_X5 | CRC_X4 | CRC_X0. Polynomial is represented in binary form.

Note
CRC polynomial have to be odd, so always have to contain X⁰ (CRC_X0), else it is invalid.
Polynomial doesn't have to contain highest coefficient, because it is added automatically from CRC length. For example CRC-8 polynomial is X^8 + X^5 + X^4 + 1, so you have to enter (CRC_X5 | CRC_X4 | CRC_X0), CRC_X8 is added automatically by CRC length.