OpenOCD
crc32.c File Reference
Include dependency graph for crc32.c:

Go to the source code of this file.

Functions

uint32_t crc32_le (uint32_t poly, uint32_t seed, const void *_data, size_t data_len)
 Calculate the CRC32 value of the given data. More...
 
static uint32_t crc_le_step (uint32_t poly, uint32_t crc, uint32_t data_in, unsigned int data_bits)
 

Function Documentation

◆ crc32_le()

uint32_t crc32_le ( uint32_t  poly,
uint32_t  seed,
const void *  data,
size_t  data_len 
)

Calculate the CRC32 value of the given data.

Parameters
polyThe polynomial of the CRC
seedThe seed to use (mostly either 0 or 0xffffffff)
dataThe data to calculate the CRC32 of
data_lenThe length of the data in data in bytes
Returns
The CRC value of the first data_len bytes at data
Note
This function can be used to incrementally compute the CRC one chunk of data at a time by using the CRC32 of the previous chunk as seed for the next chunk.

Definition at line 33 of file crc32.c.

References crc_le_step().

Referenced by adbg_wb_burst_read(), adbg_wb_burst_write(), and qn908x_probe().

◆ crc_le_step()

static uint32_t crc_le_step ( uint32_t  poly,
uint32_t  crc,
uint32_t  data_in,
unsigned int  data_bits 
)
static

Definition at line 19 of file crc32.c.

Referenced by crc32_le().