STRUCT AD5766_STATE(9)
π NAME π
struct ad5766_state β the driver instance's own little data stash β¨ (this is from the Kernel API Manual, section 9, bestie π
)
π¦ SYNOPSIS π¦
okay so here's the whole struct, no cap, copy it exactly:
struct ad5766_state {
struct spi_device *spi;
struct mutex lock;
const struct ad5766_chip_info *chip_info;
struct gpio_desc *gpio_reset;
enum ad5766_voltage_range crt_range;
u16 dither_enable;
u16 dither_invert;
u32 dither_source;
u32 dither_scale;
union {
u32 d32;
u16 w16[2];
u8 b8[4];
} data[3];
};
like, look at her. she's holding everything the driver needs to remember about one device ππ
πΈ Members πΈ
spiβ the SPI device. literally the whole reason we're here π«Άlockβ a mutex that keeps concurrent access to the SPI device from getting messy. one at a time, bestie, no cutting in line πchip_infoβ chip-model-specific constants. every chip's little personality card β¨gpio_resetβ the reset GPIO, used to reset the device. the big red button, basically π₯crt_rangeβ the currently selected output range (typeenum ad5766_voltage_range, iykyk) πdither_enableβ power enable bit for each channel's dither block (for example,D15 = DAC 15,D8 = DAC 8, and D0 = DAC 0).0= normal operation,1= power down. lowkey important: it's au16, one bit per channel πdither_invertβ inverts the dither signal applied to the selected DAC outputs. flip it and the vibe flips too πdither_sourceβ selects between 2 possible sources:1: N0,2: N1. two bits are used for each channel. choose wisely bestie π¦dither_scaleβ two bits used for each of the 16 channels:0: 1 SCALING,1: 0.75 SCALING,2: 0.5 SCALING,3: 0.25 SCALING. a whole little menu of scaling options, obsessed βdataβ the SPI transfer buffers. it's a union ofu32 d32,u16 w16[2],u8 b8[4], and there's[3]of them β so you can peek at the same bytes three different ways, main character energy π
π SEE ALSO π
- the kernel file
./drivers/iio/dac/ad5766.c struct ad5766_chip_info(9)
okay that's the whole page, go read the source fr fr ππ
this was struct ad5766_state(9) from the Kernel API Manual, living in ./drivers/iio/dac, dated October 2026 β mwah, slay, see u next time π
πβ¨
π¦ 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