spinnaker_tools (BMP) latest
SpiNNaker BMP firmware
Loading...
Searching...
No Matches
Functions | Variables
bmp_crc.c File Reference

CRC32 routines for BMP LPC1768. More...

#include <stdint.h>

Functions

uint32_t crc32 (void *buf, uint32_t len, uint32_t crc)
 Compute CRC32 for a buffer of given length.
 
uint32_t crc32_chk (void *buf, uint32_t len)
 Compute the CRC of a buffer.
 
void crc32_buf (void *buf, uint32_t len)
 Compute and insert CRC32 of a buffer where the CRC is placed in the last 4 bytes.
 

Variables

const uint32_t crc_table []
 CRC constants, precomputed from CRC polynomial.
 

Detailed Description

CRC32 routines for BMP LPC1768.

Author
Steve Temple, APT Group, School of Computer Science

Function Documentation

◆ crc32()

uint32_t crc32 ( void *  buf,
uint32_t  len,
uint32_t  crc 
)

Compute CRC32 for a buffer of given length.

Parameters
[in]bufthe data to compute the CRC of
[in]lennumber of bytes in buf
[in]crccan be 0xffffffff to start checking, or result of a previous call.
Returns
The final result needs to be inverted to produce valid CRC32.

◆ crc32_chk()

uint32_t crc32_chk ( void *  buf,
uint32_t  len 
)

Compute the CRC of a buffer.

Parameters
[in]bufthe data to compute the CRC of
[in]lennumber of bytes in buf
Returns
The CRC of the buffer

◆ crc32_buf()

void crc32_buf ( void *  buf,
uint32_t  len 
)

Compute and insert CRC32 of a buffer where the CRC is placed in the last 4 bytes.

Parameters
[in]bufthe data to compute the CRC of
[in]lennumber of bytes in buf