|
1 | 1 |
|
2 | 2 | [](https://github.com/marketplace/actions/arduino_ci) |
| 3 | +[](https://github.com/RobTillaart/CRC/actions/workflows/arduino-lint.yml) |
| 4 | +[](https://github.com/RobTillaart/CRC/actions/workflows/jsoncheck.yml) |
3 | 5 | [](https://github.com/RobTillaart/CRC/blob/master/LICENSE) |
4 | 6 | [](https://github.com/RobTillaart/CRC/releases) |
5 | 7 |
|
@@ -33,18 +35,18 @@ and many other websites. |
33 | 35 | ## Interface CRC classes |
34 | 36 |
|
35 | 37 | These interfaces are very similar for CRC8, CRC16, CRC32 and CRC64 class. |
36 | | -The only difference is the datatype for polynome, start- and endmask, and the returned CRC. |
| 38 | +The only difference is the data type for polynome, start- and end-mask, and the returned CRC. |
37 | 39 |
|
38 | 40 | Use **\#include "CRC8.h"** |
39 | 41 |
|
40 | 42 | - **CRC8()** Constructor |
41 | 43 | - **void reset()** set all internals to constructor defaults. |
42 | 44 | - **void restart()** reset internal CRC and count only; reuse values for other e.g polynome, XOR masks and reverse flags. |
43 | 45 | - **void setPolynome(polynome)** set polynome, note reset sets a default polynome. |
44 | | -- **void setStartXOR(start)** set startmask, default 0. |
45 | | -- **void setEndXOR(end)** set endmask, default 0. |
46 | | -- **void setReverseIn(bool reverseIn)** reverse the bitpattern of input data (MSB vs LSB). |
47 | | -- **void setReverseOut(bool reverseOut)** reverse the bitpattern of CRC (MSB vs LSB). |
| 46 | +- **void setStartXOR(start)** set start-mask, default 0. |
| 47 | +- **void setEndXOR(end)** set end-mask, default 0. |
| 48 | +- **void setReverseIn(bool reverseIn)** reverse the bit pattern of input data (MSB vs LSB). |
| 49 | +- **void setReverseOut(bool reverseOut)** reverse the bit pattern of CRC (MSB vs LSB). |
48 | 50 | - **void add(value)** add a single value to CRC calculation. |
49 | 51 | - **void add(array, uint32_t length)** add an array of values to the CRC. In case of a warning/error use casting to (uint8_t \*). |
50 | 52 | - **uint8_t getCRC()** returns CRC calculated so far. This allows to check the CRC of a really large stream at intermediate moments, e.g. to link multiple packets. |
@@ -77,7 +79,7 @@ Use **\#include "CRC.h"** |
77 | 79 |
|
78 | 80 | Most functions have a default polynome, same start and end masks, and default there is no reversing. |
79 | 81 | However these parameters allow one to tweak the CRC in all aspects known. |
80 | | -In all the examples encountered the reverseflags were set both to false or both to true. |
| 82 | +In all the examples encountered the reverse flags were set both to false or both to true. |
81 | 83 | For flexibility both parameters are kept available. |
82 | 84 |
|
83 | 85 | - **uint8_t crc8(array, length, polynome = 0xD5, start = 0, end = 0, reverseIn = false, reverseOut = false)** idem with default polynome |
|
0 commit comments