write_scratchpad(9)
πΈ write_scratchpad(9) β Kernel API Manual πΈ
okay so bestie, welcome to write_scratchpad(9) from the Kernel API Manual β yes that's the manpage name, we're being β¨officialβ¨ today. This is the little function that writes bytes into the device RAM and honestly? iconic behavior. Let's get into it π
β¨ NAME β¨
write_scratchpad β writes nb_bytes in the device RAM. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
int write_scratchpad (struct w1_slave *sl , const u8 *data , u8 nb_bytes
);
literally the whole signature, copy it exactly, don't get creative with it π«Ά
β¨ ARGUMENTS β¨
slβ pointer to the slave you wanna write in π like, the target. the main character of this operation.dataβ pointer to an array of 3 bytes, because 3 bytes MUST be written. no exceptions, no shortcuts, not me being dramatic β it's literally in the spec πnb_bytesβ how many bytes get written:2for DS18S20,3otherwise. so like, DS18S20 is the special one and everyone else gets three π¦
β¨ RETURN β¨
0if success β¨ slay-kernel error codeotherwise π (it's a kernel error code β not your usual errno situation, don't @ me)
β¨ SEE ALSO β¨
Kernel file ./drivers/w1/slaves/w1_therm.c struct β yes the whole struct, they said what they said π
And the full friend group, no one left out:
w1_therm_family_converter(9)struct w1_therm_family_data(9)struct therm_info(9)reset_select_slave(9)convert_t(9)read_scratchpad(9)copy_scratchpad(9)recall_eeprom(9)read_powermode(9)trigger_bulk_read(9)w1_therm_add_slave(9)w1_therm_remove_slave(9)w1_DS18B20_convert_temp(9)w1_DS18S20_convert_temp(9)w1_DS1825_convert_temp(9)device_family(9)bus_mutex_lock(9)check_family_data(9)bulk_read_support(9)conversion_time(9)temperature_from_RAM(9)int_to_short(9)w1_poll_completion(9)
like, read read_scratchpad(9) next, it's the sibling, they come as a set ππ
ngl the3 bytes MUST be writtenthing is the one rule you cannot fumble. yourdataarray is 3 bytes. periodt. π
and that's the page!! source path is ./drivers/w1/slaves, version date is October 2026, and the page itself is write_scratchpad(9) β mwah, bye bestie, go write some scratchpad ππβ
π¦ 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