| công cụ tìm kiếm bảng dữ liệu linh kiện điện tử |
|
SCD40-D-R2 bảng dữ liệu(PDF) 18 Page - Sensirion AG Switzerland |
|
|
|||||||||||||||||||||||||||||
SCD40-D-R2 bảng dữ liệu(HTML) 18 Page - Sensirion AG Switzerland |
|
18 / 22 page ![]() www.sensirion.com Version 1.1 – April 2021 18/22 3.11 Checksum Calculation The 8-bit CRC checksum transmitted after each data word is generated by a CRC algorithm. Its properties are displayed in Table 30. The CRC covers the contents of the two previously transmitted data bytes. To calculate the checksum only these two previously transmitted data bytes are used. Note that command words are not followed by CRC. Property Value Example code (C/C++) Name CRC-8 #define CRC8_POLYNOMIAL 0x31 #define CRC8_INIT 0xFF uint8_t sensirion_common_generate_crc(const uint8_t* data, uint16_t count) { uint16_t current_byte; uint8_t crc = CRC8_INIT; uint8_t crc_bit; /* calculates 8-Bit checksum with given polynomial */ for (current_byte = 0; current_byte < count; ++current_byte) { crc ^= (data[current_byte]); for (crc_bit = 8; crc_bit > 0; --crc_bit) { if (crc & 0x80) crc = (crc << 1) ^ CRC8_POLYNOMIAL; else crc = (crc << 1); } } return crc; } Width 8 bit Protected Data read and/or write data Polynomial 0x31 (x8 + x5 + x4 + 1) Initialization 0xFF Reflect input False Reflect output False Final XOR 0x00 Examples CRC (0xBEEF) = 0x92 Table 30 I2C CRC properties. |
|
|
Link URL |
| Cho đến nay ALLDATASHEET có giúp ích cho doanh nghiệp của bạn hay không? [ DONATE ] |
Alldatasheet là | Quảng cáo | Liên lạc với chúng tôi | Chính sách bảo mật | Liên kết đến bảng dữ liệu | Trao đổi link | Tìm kiếm theo nhà sản xuất All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |