/*
 * crc32.h
 *
 *  Created on: 13 août 2022
 *      Author: xavie
 */

#ifndef INC_CRC32_H_
#define INC_CRC32_H_

#include <stdint.h>

#ifdef SYS_CRC
uint32_t TM_CRC_Calculate32(uint32_t* arr, uint32_t count, uint8_t reset);
uint32_t crc32_check (CRC_HandleTypeDef *hcrc, uint8_t* buf, uint16_t len);
#endif

uint8_t reflect8(uint8_t val);
uint32_t reflect32(uint32_t val);
uint32_t calcCRC32stm(void *data, uint32_t len, uint32_t poly, uint32_t seed, uint32_t initCRC, uint32_t inR, uint32_t outR);
uint32_t calcCRC32std(void *data, uint32_t len, uint32_t poly, uint32_t seed, uint32_t initCRC, uint32_t inR, uint32_t outR);

#endif /* INC_CRC32_H_ */
