Synopsis
uint32_t libmem_crc32(const uint8_t *start,
                      size_t size,
                      uint32_t crc);
Description

libmem_crc32 computes the CRC-32 checksum of an address range using a LIBMEM driver.

start — A pointer to the start of the address range.

size — The size of the address range in bytes.

crc — The initial CRC-32 value.

libmem_crc32 returns — The computed CRC-32 value.

This function locates the LIBMEM driver for the address pointed to by start, then calls the LIBMEM driver's crc32 extended function if it has one and returns the result. If the driver hasn't implemented the crc32 extended function then the libmem_crc32_direct function is called which accesses the memory directly. The intention for this function is to allow you to use the LIBMEM library for memory that doesn't appear on the address bus by providing a virtual address range for the device.

Example:

uint32_t crc = 0xFFFFFFFF;

crc = libmem_crc32((uint8_t *)0x10000000, 1024, crc);