Arduino Core for STM32  1.0
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.

Macro Definition Documentation

◆ CRC_X0

#define CRC_X0   (0x01UL)

◆ CRC_X1

#define CRC_X1   (0x01UL << 1U)

◆ CRC_X2

#define CRC_X2   (0x01UL << 2U)

◆ CRC_X3

#define CRC_X3   (0x01UL << 3U)

◆ CRC_X4

#define CRC_X4   (0x01UL << 4U)

◆ CRC_X5

#define CRC_X5   (0x01UL << 5U)

◆ CRC_X6

#define CRC_X6   (0x01UL << 6U)

◆ CRC_X7

#define CRC_X7   (0x01UL << 7U)

◆ CRC_X8

#define CRC_X8   (0x01UL << 8U)

◆ CRC_X9

#define CRC_X9   (0x01UL << 9U)

◆ CRC_X10

#define CRC_X10   (0x01UL << 10U)

◆ CRC_X11

#define CRC_X11   (0x01UL << 11U)

◆ CRC_X12

#define CRC_X12   (0x01UL << 12U)

◆ CRC_X13

#define CRC_X13   (0x01UL << 13U)

◆ CRC_X14

#define CRC_X14   (0x01UL << 14U)

◆ CRC_X15

#define CRC_X15   (0x01UL << 15U)

◆ CRC_X16

#define CRC_X16   (0x01UL << 16U)

◆ CRC_X17

#define CRC_X17   (0x01UL << 17U)

◆ CRC_X18

#define CRC_X18   (0x01UL << 18U)

◆ CRC_X19

#define CRC_X19   (0x01UL << 19U)

◆ CRC_X20

#define CRC_X20   (0x01UL << 20U)

◆ CRC_X21

#define CRC_X21   (0x01UL << 21U)

◆ CRC_X22

#define CRC_X22   (0x01UL << 22U)

◆ CRC_X23

#define CRC_X23   (0x01UL << 23U)

◆ CRC_X24

#define CRC_X24   (0x01UL << 24U)

◆ CRC_X25

#define CRC_X25   (0x01UL << 25U)

◆ CRC_X26

#define CRC_X26   (0x01UL << 26U)

◆ CRC_X27

#define CRC_X27   (0x01UL << 27U)

◆ CRC_X28

#define CRC_X28   (0x01UL << 28U)

◆ CRC_X29

#define CRC_X29   (0x01UL << 29U)

◆ CRC_X30

#define CRC_X30   (0x01UL << 30U)

◆ CRC_X31

#define CRC_X31   (0x01UL << 31U)