STRUCT MCP3564_STATE(9)
β¨ 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β theSPI 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 astruct mutex, it's giving bouncer-at-the-club energy, nobody touches the state without going through her π.dev_addrβ hardware device address. au8, so tiny but iconic.oversamplingβ the index inside oversampling list of the ADC. anenum 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'sscale_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 littleint.calib_scaleβ calibration scale value, also anint, 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 anenum 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. abool, so she's either on or off, periodt.auto_zeroing_refβ set if ADC auto-Zeroing Reference Buffer Setting is enabled. also abool. also on or off. the auto-zeroing is thriving in this struct π.have_vrefβ does the ADC have an internal voltage reference? it's abool, 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
- 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