STRUCT AD5766_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 (type enum 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 a u16, 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 of u32 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