STRUCT VEML6046X00_GAIN_PD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 the PD. 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/2 and 2/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 πŸ¦‹

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