32 b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;
33 b = (b & 0xCC) >> 2 | (b & 0x33) << 2;
34 b = (b & 0xAA) >> 1 | (b & 0x55) << 1;
54static constexpr uint8_t
crc8Bootloader(
const uint8_t* data,
size_t len)
noexcept {
56 const uint16_t POLY = 0x107;
59 for (
size_t i = 0; i < len; i++) {
63 for (
int bit = 7; bit >= 0; bit--) {
64 crc = (crc << 1) | ((byte_reversed >> bit) & 1);
72 for (
int i = 0; i < 8; i++) {
79 return static_cast<uint8_t
>(crc & 0xFF);
Definition bootloader_config.hpp:9
static constexpr uint8_t crc8Bootloader(const uint8_t *data, size_t len) noexcept
CRC-8 calculation for UART protocol (TMC9660 datasheet method).
Definition bootloader_utils.hpp:54
static constexpr uint8_t reverseByte(uint8_t b) noexcept
Helper function for CRC-8 calculation (UART only).
Definition bootloader_utils.hpp:31