STRUCT AD7949_ADC_CHIP(9)
π struct ad7949_adc_chip(9) β okay bestie, let's talk
So this is from the Kernel API Manual, section 9, and it's literally the whole struct for the AD ADC chip. Buckle up, we're doing kernel struct lore π
β¨ NAME β¨
struct ad7949_adc_chip β an AD ADC chip, no cap. That's it, that's the vibe. π¦
πΈ SYNOPSIS πΈ
struct ad7949_adc_chip {
struct mutex lock;
struct regulator *vref;
struct iio_dev *indio_dev;
struct spi_device *spi;
u32 refsel;
u8 resolution;
u16 cfg;
unsigned int current_channel;
u16 buffer;
__be16 buf8b;
};
Yes bestie, copy it exactly β every field in this exact order, nothing renamed, nothing merged. The compiler does not care about your feelings π
π Members π
Okay this is the part where I introduce you to every single field like they're my friends at a party π«Ά
lockβ astruct mutexthat protects write sequences. It's giving bouncer at the club: nobody writes until this says so. π₯vrefβ astruct regulator *that's the regulator generating Vref. The voltage reference main character, honestly.indio_devβ astruct iio_dev *, aka your reference to the iio structure. It's the plug πspiβ astruct spi_device *, the reference to the spi structure. Another plug, but SPI-flavored this time β¨refselβ au32holding the reference selection. Which reference? The one you selected, bestie πresolutionβ au8, the resolution of the chip. Literally how much detail this thing can see. πcfgβ au16that's a copy of the configuration register. A little souvenir of the config, love that for us.current_channelβ anunsigned int, the current channel in use. Not the ex-channel, not the future channel. The current one. βbufferβ au16, the buffer to send / receive data to / from device. Two-way queen πbuf8bβ a__be16buffer to exchange data with the device in 8-bit transfers. Different buffer, different transfer size, same icon energy π
ngl the two buffers are lowkey doing different jobs βbufferfor send/receive data with the device,buf8bspecifically for exchanging data in 8-bit transfers. Don't mix them up, bestie π
π¦ SEE ALSO π¦
- Kernel file
./drivers/iio/adc/ad7949.cβ go read it, iykyk π
That's the whole page, periodt. πΈ
And a cute little sign-off for you: this gem lives under ./drivers/iio/adc, it's dated October 2026, and its manual page name is struct ad7949_adc_chip(9) β so if you ever need to cite it, you're welcome πβ¨π
π¦ 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