STRUCT AD5421_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct ad5421_state(9) ✨

okay so bestie, this is a page straight outta the Kernel API Manual β€” it's all about struct ad5421_state, which is literally the driver instance specific data πŸŽ€. Think of it as the little vibe-holder that keeps track of one specific AD5421 driver instance. iykyk πŸ’…


🌸 NAME 🌸

struct ad5421_state β€” driver instance specific data 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

struct ad5421_state {
    struct spi_device               *spi;
    unsigned int                    ctrl;
    enum ad5421_current_range       current_range;
    unsigned int                    fault_mask;
    struct mutex                    lock;
    union {
      __be32 d32;
      u8 d8[4];
    } data[2];
 };

no cap, that's the whole struct. slay. ✨


πŸ‘‘ Members πŸ‘‘

  • spi β€” the spi_device, bestie. it's giving "who am I talking to" energy πŸ’–
  • ctrl β€” the control register cache. yeah, we're caching it. lowkey iconic πŸŽ€
  • current_range β€” an enum ad5421_current_range, i.e. the current range the device is configured for. highkey important πŸ”₯
  • fault_mask β€” software masking of events. keeping some of that event noise out of your feed, fr fr πŸ™ˆ
  • lock β€” a struct mutex whose whole job is protecting the data buffer during SPI ops. main character energy for a mutex, honestly πŸ’…
  • data β€” the spi transfer buffers. it's a data[2] array of a union that's either a __be32 d32 or a u8 d8[4]. two buffers, two ways to look at 'em. ate. πŸ“

🧚 SEE ALSO 🧚

  • Kernel file ./drivers/iio/dac/ad5421.c β€” go read the source, bestie, it's right there 🌈

and that's the whole page, periodt. this lil gem lives in ./drivers/iio/dac and the version/date stamp is from October 2026 πŸ’œ β€” so like, future vibes only. byeeeee πŸ‘‘βœ¨πŸ¦‹

πŸ“¦ where this page comes from