Select one of the symbols to view example projects that use it.
 
Outline
#include <stdint.h>
#include "esp_rom_crc.h"
esp_crc32_le(uint32_t, const uint8_t *, uint32_t)
esp_crc32_be(uint32_t, const uint8_t *, uint32_t)
esp_crc16_le(uint16_t, const uint8_t *, uint32_t)
esp_crc16_be(uint16_t, const uint8_t *, uint32_t)
esp_crc8_le(uint8_t, const uint8_t *, uint32_t)
esp_crc8_be(uint8_t, const uint8_t *, uint32_t)
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/esp_hw_support/include/esp_crc.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #pragma once #ifdef __cplusplus extern "C" { #endif #include <stdint.h> // This header is only a wrapper on ROM CRC API #include "esp_rom_crc.h" /** * @brief CRC32 value in little endian. * * @param crc: Initial CRC value (result of last calculation or 0 for the first time) * @param buf: Data buffer that used to calculate the CRC value * @param len: Length of the data buffer * @return CRC32 value *//* ... */ static inline uint32_t esp_crc32_le(uint32_t crc, uint8_t const *buf, uint32_t len) { return esp_rom_crc32_le(crc, buf, len); }{ ... } /** * @brief CRC32 value in big endian. * * @param crc: Initial CRC value (result of last calculation or 0 for the first time) * @param buf: Data buffer that used to calculate the CRC value * @param len: Length of the data buffer * @return CRC32 value *//* ... */ static inline uint32_t esp_crc32_be(uint32_t crc, uint8_t const *buf, uint32_t len) { return esp_rom_crc32_be(crc, buf, len); }{ ... } /** * @brief CRC16 value in little endian. * * @param crc: Initial CRC value (result of last calculation or 0 for the first time) * @param buf: Data buffer that used to calculate the CRC value * @param len: Length of the data buffer * @return CRC16 value *//* ... */ static inline uint16_t esp_crc16_le(uint16_t crc, uint8_t const *buf, uint32_t len) { return esp_rom_crc16_le(crc, buf, len); }{ ... } /** * @brief CRC16 value in big endian. * * @param crc: Initial CRC value (result of last calculation or 0 for the first time) * @param buf: Data buffer that used to calculate the CRC value * @param len: Length of the data buffer * @return CRC16 value *//* ... */ static inline uint16_t esp_crc16_be(uint16_t crc, uint8_t const *buf, uint32_t len) { return esp_rom_crc16_be(crc, buf, len); }{ ... } /** * @brief CRC8 value in little endian. * * @param crc: Initial CRC value (result of last calculation or 0 for the first time) * @param buf: Data buffer that used to calculate the CRC value * @param len: Length of the data buffer * @return CRC8 value *//* ... */ static inline uint8_t esp_crc8_le(uint8_t crc, uint8_t const *buf, uint32_t len) { return esp_rom_crc8_le(crc, buf, len); }{ ... } /** * @brief CRC8 value in big endian. * * @param crc: Initial CRC value (result of last calculation or 0 for the first time) * @param buf: Data buffer that used to calculate the CRC value * @param len: Length of the data buffer * @return CRC8 value *//* ... */ static inline uint8_t esp_crc8_be(uint8_t crc, uint8_t const *buf, uint32_t len) { return esp_rom_crc8_be(crc, buf, len); }{ ... } #ifdef __cplusplus }{...} #endif
Details