STRUCT YAS5XX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct yas5xx β€” state container for the YAS5xx driver ✨

okay so bestie, this is a page from the Kernel API Manual (section 9, the kernel-API girlies) and it's literally just the struct that holds everything the YAS5xx driver needs to keep track of. it's giving "one big tote bag full of magnetometer essentials" πŸ’… no cap.


πŸŽ€ SYNOPSIS πŸŽ€

struct yas5xx {
    struct device *dev;
    const struct yas5xx_chip_info *chip_info;
    unsigned int version;
    struct yas5xx_calibration calibration;
    s8 hard_offsets[3];
    struct iio_mount_matrix orientation;
    struct regmap *map;
    struct regulator_bulk_data regs[2];
    struct gpio_desc *reset;
    struct mutex lock;
    struct {
      s32 channels[4];
      aligned_s64 ts;
    } scan;
 };

like, yes, that's the whole vibe. now let's meet the members one by one 🫢


πŸ¦‹ Members πŸ¦‹

  • dev β€” the parent device pointer, aka who's your daddy device ✨
  • chip_info β€” device-specific data and function pointers, so your chip knows its own lore πŸ”₯
  • version β€” the device version. iconic, numbered, gender-neutral.
  • calibration β€” calibration settings straight out of the OTP storage πŸ’–
  • hard_offsets β€” offsets for each axis, measured with initcoil actuated. yes, all three axes, she's thorough πŸ’…
  • orientation β€” the mounting matrix, for when your axis is flipped etc 🌈
  • map β€” regmap to access the YAX5xx registers over I2C (that spelling is what the page says, bestie, don't come for me πŸ™ˆ)
  • regs β€” the vdd and vddio power regulators πŸ“
  • reset β€” optional GPIO line used for handling RESET, the "have you tried turning it off and on again" wire ⭐
  • lock β€” locks the magnetometer for exclusive use during a measurement. and lowkey this one matters: a measurement involves several register transactions, so the regmap lock is not enough on its own 😭 the result is that measurements get serialized in a first-come-first-serve manner. queue up, girlies πŸ‘‘
  • scan β€” naturally aligned measurements πŸ’«

🌸 SEE ALSO 🌸

Kernel file ./drivers/iio/magnetometer/yamaha-yas530.c, struct yas5xx_chip_info(9), yas530_measure(9), yas537_measure(9), yas530_get_measure(9), yas537_get_measure(9), yas530_extract_calibration(9) πŸ’œ


ok that's the whole page, go read the actual driver now, mwah πŸ’‹

and that's a wrap, bestie!! this little beauty lives in ./drivers/iio/magnetometer and it's dated October 2026 β€” she's from the future, she's thriving, she's literally the main character of the IIO magnetometer directory πŸ§šβœ¨πŸ’–

πŸ“¦ where this page comes from