STRUCT REG_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 accumulated vpower values. it's been stacking them up, icon behaviour fr
  • vpower β€” a snapshot of the vpower registers
  • vbus β€” a snapshot of the vbus registers
  • vbus_avg β€” the averages of the vbus registers. not a snapshot, an average, okurrr πŸ“Š
  • vsense β€” a snapshot of the vsense registers
  • vsense_avg β€” the averages of the vsense registers
  • num_enabled_channels β€” the count of how many chip channels are currently enabled. like a headcount but for channels πŸ‘‘
ngl bestie, notice how vbus_avg and vsense_avg are averages while vbus and vsense are 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