STRUCT MCP3564_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct mcp3564_state(9) ✨

okay so this is a page from the Kernel API Manual, and we're talking about struct mcp3564_state β€” literally the working data for a ADC device πŸ’… that's it, that's the whole vibe. she's the little state box that keeps everything the driver needs to remember, and bestie, she holds a LOT. πŸŽ€


🌸 SYNOPSIS 🌸

struct mcp3564_state {
    const struct mcp3564_chip_info  *chip_info;
    struct spi_device               *spi;
    unsigned short                  vref_mv;
    struct mutex                    lock;
    u8 dev_addr;
    enum mcp3564_oversampling       oversampling;
    unsigned int                    hwgain;
    unsigned int                    scale_tbls[MCP3564_MAX_PGA][2];
    int calib_bias;
    int calib_scale;
    unsigned int                    current_boost_mode;
    enum mcp3564_burnout            burnout_mode;
    bool auto_zeroing_mux;
    bool auto_zeroing_ref;
    bool have_vref;
    const char                      *labels[MCP3564_MAX_CHANNELS];
};

like, look at her. she's got layers. she's got range. πŸ¦‹


πŸ’– Members πŸ’–

  • chip_info β€” chip specific data ✨ the deets on which chip we're dealing with, no cap.
  • spi β€” the SPI device structure, aka the actual SPI device hanging out in here.
  • vref_mv β€” voltage reference value, and it's in millivolts so watch your units bestie 😭.
  • lock β€” synchronize access to driver's state members. it's a struct mutex, it's giving bouncer-at-the-club energy, nobody touches the state without going through her πŸ”’.
  • dev_addr β€” hardware device address. a u8, so tiny but iconic.
  • oversampling β€” the index inside oversampling list of the ADC. an enum mcp3564_oversampling, lowkey just a pointer into a list 🫢.
  • hwgain β€” the index inside hardware gain list of the ADC. unsigned int, same deal, different list πŸ’….
  • scale_tbls β€” table with precalculated scale. it's scale_tbls[MCP3564_MAX_PGA][2] and yes the precalculation is doing the most so you don't have to πŸ”₯.
  • calib_bias β€” calibration bias value, a comfy little int.
  • calib_scale β€” calibration scale value, also an int, also comfy.
  • current_boost_mode β€” the index inside current boost list of the ADC. unsigned int, index-into-a-list situation, we love consistency ✨.
  • burnout_mode β€” the index inside current bias list of the ADC. it's an enum mcp3564_burnout. (yes it's called burnout mode, no it's not about finals week πŸ’€)
  • auto_zeroing_mux β€” set if ADC auto-zeroing algorithm is enabled. a bool, so she's either on or off, periodt.
  • auto_zeroing_ref β€” set if ADC auto-Zeroing Reference Buffer Setting is enabled. also a bool. also on or off. the auto-zeroing is thriving in this struct 🌈.
  • have_vref β€” does the ADC have an internal voltage reference? it's a bool, so it's giving yes/no main character energy πŸ‘‘.
  • labels β€” table with channels labels. const char *labels[MCP3564_MAX_CHANNELS], one label per channel, all cute and accounted for πŸŽ€.

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/iio/adc/mcp3564.c
  • struct mcp3564_chip_info(9)

ngl bestie, if you're poking at this struct directly you better be holding that lock. synchronize access to driver's state members. i said what i said πŸ’…

okay that's the whole page, ily, go read struct mcp3564_chip_info(9) next for the lore πŸ§šπŸ’œ

β€” sourced from ./drivers/iio/adc, dated October 2026. bye bestie, mwah! πŸ“πŸŒΈ

πŸ“¦ where this page comes from