Alarm Sensor Module  0.1
⇒ back to Project Page

◆ calculate_crc32()

uint32_t calculate_crc32 ( uint8_t *  buffer,
uint8_t  number_bytes,
uint8_t  mode 
)

Calculates the CRC value for a given buffer. Depending on the mode it can perform a complete calculation or specific parts of it, in case of a splitted CRC calculation. The generator polynom is specified in the corresponding header file crc.h.

Parameters
[in]bufferinput data buffer
[in]number_bytesnumber of bytes in buffer (buffer length)
[in]modespecifies the mode of operation:
CRC_INITIALIZATION - perform only the initialization step
CRC_UPDATE - perform only an update, no initialization or finalization
CRC_FINALIZATION - perform only the finalization step
CRC_COMPLETE - perform the whole CRC calculation, including initialization and finalization
Returns
calculated CRC value
See also
generator polynom CRC_REV_POLYNOM
Date
  • Created 20.01.2019
  • Modified 20.01.2019
Author
Michael Skutek, micha.nosp@m.el@s.nosp@m.kutek.nosp@m..de

Definition at line 70 of file crc.c.

Referenced by main().

Here is the caller graph for this function: