This repository has been archived on 2026-06-17. You can view files and clone it, but cannot push or open issues or pull requests.
FireWatchTower_2axis/firmware/lib/tmc/helpers/CRC.h

26 lines
884 B
C
Executable File

/*******************************************************************************
* Copyright © 2017 TRINAMIC Motion Control GmbH & Co. KG
* (now owned by Analog Devices Inc.),
*
* Copyright © 2023 Analog Devices Inc. All Rights Reserved.
* This software is proprietary to Analog Devices, Inc. and its licensors.
*******************************************************************************/
#ifndef TMC_HELPERS_CRC_H_
#define TMC_HELPERS_CRC_H_
#include "Types.h"
// Amount of CRC tables available
// Each table takes ~260 bytes (257 bytes, one bool and structure padding)
#define CRC_TABLE_COUNT 2
uint8_t tmc_fillCRC8Table(uint8_t polynomial, bool isReflected, uint8_t index);
uint8_t tmc_CRC8(uint8_t *data, uint32_t bytes, uint8_t index);
uint8_t tmc_tableGetPolynomial(uint8_t index);
bool tmc_tableIsReflected(uint8_t index);
#endif /* TMC_HELPERS_CRC_H_ */