STRUCT VEML6046X00_GAIN_PD(9)
β¨ struct veml6046x00_gain_pd(9) β¨
okay so bestie, welcome to the Kernel API Manual π
this is the page for struct veml6046x00_gain_pd, and it's literally just a little lookup table with main character energy. it's giving "translation dictionary" but for sensor settings π¦
πΈ NAME πΈ
struct veml6046x00_gain_pd β Translation of gain and photodiode size (PD).
like, it speaks both languages: driver-speak and sensor-hardware-speak π«Ά
π SYNOPSIS π
struct veml6046x00_gain_pd {
unsigned int gain_sen;
unsigned int pd;
};
(yeah the closing brace is indented one space in the original, and we keep it exactly, no touchy β¨)
π Members π
gain_senβ the gain actually used in the sensor, as described in the datasheet of the sensor. that's the raw hardware truth πpdβ the photodiode size in the sensor. yes, the PD of thePD. obsessed π
π Description π
so here's the vibe: this is the translation table π§ that maps the gain used in the driver (which is also the gain the userspace interface in sysfs uses) over to the gain and the PD that the sensor hardware actually gets.
there are six gain values visible to the user (0.25 .. 2), and those translate to:
- two different gains in the sensor hardware (
x0.5 .. x2), and - two PD values (
1/2and2/2).
theoretically there would be eight combinations, but plot twist π β the gain values 0.5 and 1 are doubled, so for those the combination with the larger PD (2/2) is the one that gets taken. the reasoning is honestly iconic: more photodiode cells are supposed to deliver a more precise result, so the bigger PD wins. periodt π
ngl, this is the whole reason the struct exists: the user sees 6, the hardware sees fewer, and the table does the matchmaking π
π¦ SEE ALSO π¦
- Kernel file
./drivers/iio/light/veml6046x00.c struct veml6046x00_rf(9)struct veml6046x00_data(9)- Valid integration times (IT)(9)
- Handling of gain and photodiode size (PD)(9)
- Factors for calculation of lux(9)
veml6046x00_read_data_ready(9)veml6046x00_wait_data_available(9)
go read those next bestie, iykyk πβ¨
and that's the page! π this one lives in ./drivers/iio/light, dated October 2026, and it's filed under struct veml6046x00_gain_pd(9) β mwah, slay, bye ππ
π¦ 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