ms_sensors_crc_valid(9)
π ms_sensors_crc_valid β like, the Kernel API Manual version, bestie β¨
Okay so real talk, this one's from the Kernel API Manual (section 9, iykyk) and it's the CRC check function. It's short, it's sweet, it's lowkey iconic. Let's get into it π«Ά
β¨ NAME β¨
ms_sensors_crc_valid β the CRC check function, periodt. That's her whole job π
πΈ SYNOPSIS πΈ
bool ms_sensors_crc_valid (u32 value );
π ARGUMENTS π
valueβ your input and your CRC compare value, all bundled into one. She's doing double duty, we love a multitasker π
π¦ DESCRIPTION π¦
So this is the Cyclic Redundancy Check function, and it's the one used in TSYS02D, HTU21, and MS8607. Bestie, it's literally the same girl working three jobs π
What she does: performs a x^8 + x^5 + x^4 + 1 polynomial CRC. That's the math. That's the whole vibe. No cap π₯
Now for the fun part β how the argument is laid out. The argument carries the CRC value in the LSB byte, while bytes 1 and 2 are the ones actually used for the CRC computation. So likeβ¦ one byte for the compare, two bytes for the crunching β¨ Don't mix them up or it's giving chaos π
β RETURN β
1if the CRC is valid π0otherwise π
That's it. Binary queen. No in-between, no "maybe", no "it's complicated" π
π SEE ALSO π
The kernel file herself:
./drivers/iio/common/ms_sensors/ms_sensors_i2c.c
And the whole friend group, fr fr:
ms_sensors_reset(9)ms_sensors_read_prom_word(9)ms_sensors_convert_and_read(9)ms_sensors_read_serial(9)ms_sensors_write_resolution(9)ms_sensors_show_battery_low(9)ms_sensors_show_heater(9)ms_sensors_write_heater(9)ms_sensors_ht_read_temperature(9)ms_sensors_ht_read_humidity(9)ms_sensors_tp_crc4(9)ms_sensors_tp_crc_valid_112(9)ms_sensors_tp_crc_valid_128(9)ms_sensors_tp_read_prom(9)ms_sensors_read_temp_and_pressure(9)
Bestie heads up: that SEE ALSO list is the actual whole squad, don't skip a single one β they'd notice π€π
And that's the page!! Signing off from ./drivers/iio/common/ms_sensors, dated October 2026, living under the Kernel API Manual umbrella π§π Go check some CRCs, you're gonna slay πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms