sgp_read_cmd(9)
β¨ sgp_read_cmd(9) β Kernel API Manual π
okay so this page is from the Kernel API Manual, and itβs giving βsensor readback core loreβ π«Ά. Stay for the lock warning, bestie β itβs important.
πΈ NAME πΈ
sgp_read_cmd β reads data from the sensor after issuing a command. The caller must hold data->data_lock for the duration of the call. no cap, that lock is not optional π
.
β οΈ bestie, the caller must hold data->data_lock for the duration of the call. like, the whole call. do not let go early π.
β¨ SYNOPSIS β¨
int sgp_read_cmd (struct sgp_data *data , enum sgp_cmd cmd , union
sgp_reading *buf , size_t word_count , unsigned long duration_us );
π ARGUMENTS π
dataβ SGP data. the main character struct, periodt π.cmdβ SGP Command to issue. like, the command weβre sending before the read happens.bufβ Raw data buffer to use. this is where the raw data lands π.word_countβ Num words to read, excluding CRC bytes. yes, CRC bytes are not included in this count, bestie π.duration_usβ Time taken to sensor to take a reading and data to be ready. the sensor-reading + data-ready time situation π§.
π₯ RETURN π₯
Returns 0 on success, negative error otherwise. zero = slay β¨, negative = something went sideways π.
π¦ SEE ALSO π¦
Kernel file ./drivers/iio/chemical/sgp30.c, plus sgp_verify_buffer(9) and sgp_measure_iaq(9). go read those if you want the full friend-group lore π.
and finally, mwah π: this pageβs source/version situation is ./drivers/iio/chemical, and itβs dated October 2026. thatβs the sign-off, bestie β now go hold that lock π«Άβ¨
π¦ 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