STRUCT REG_DATA(9)
β¨ struct reg_data(9) β¨
okay so this is a page from the Kernel API Manual, and bestie, we're about to talk about struct reg_data β literally the data that comes out of the registers π
πΈ SYNOPSIS πΈ
struct reg_data {
u8 meas_regs[PAC1934_MEAS_REG_LEN];
u8 ctrl_regs[PAC1934_CTRL_REG_LEN];
s64 energy_sec_acc[PAC1934_MAX_NUM_CHANNELS];
s64 vpower_acc[PAC1934_MAX_NUM_CHANNELS];
s32 vpower[PAC1934_MAX_NUM_CHANNELS];
s32 vbus[PAC1934_MAX_NUM_CHANNELS];
s32 vbus_avg[PAC1934_MAX_NUM_CHANNELS];
s32 vsense[PAC1934_MAX_NUM_CHANNELS];
s32 vsense_avg[PAC1934_MAX_NUM_CHANNELS];
u8 num_enabled_channels;
};
like, that's the whole vibe. ten members, all doing their little jobs π«Ά
π Members π
let me walk you through each one, no skips, we're doing all of them:
meas_regsβ a snapshot of the raw measurements registers. just a little pic of them at that moment πΈctrl_regsβ a snapshot of the control registers. same energy, different registers π«energy_sec_accβ a snapshot of the energy values β‘vpower_accβ the accumulatedvpowervalues. it's been stacking them up, icon behaviour frvpowerβ a snapshot of thevpowerregistersvbusβ a snapshot of thevbusregistersvbus_avgβ the averages of thevbusregisters. not a snapshot, an average, okurrr πvsenseβ a snapshot of thevsenseregistersvsense_avgβ the averages of thevsenseregistersnum_enabled_channelsβ the count of how many chip channels are currently enabled. like a headcount but for channels π
ngl bestie, notice howvbus_avgandvsense_avgare averages whilevbusandvsenseare snapshots β do not mix those up, that's the whole plot twist π
π SEE ALSO π
go read these next, they're in the same universe, main-character adjacent:
- Kernel file
./drivers/iio/adc/pac1934.c struct pac1934_features(9)struct pac1934_chip_info(9)
and that's the page π¦ this little gem lives in ./drivers/iio/adc, dated October 2026 β mwah, slay, periodt β¨ππ
π¦ 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