STRUCT MPU3050(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct mpu3050(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” yes it's a whole manual, and yes this page is about struct mpu3050, which is the instance state container for the device. that's the whole vibe: it's the lil bucket where one MPU-3050 keeps all its state. 🫢


✨ NAME ✨

struct mpu3050 β€” literally just the instance state container for the device. that's it, that's the name, she's a container and she's serving πŸ’…


🌸 SYNOPSIS 🌸

struct mpu3050 {
    struct device *dev;
    struct iio_mount_matrix orientation;
    struct regmap *map;
    struct mutex lock;
    int irq;
    struct regulator_bulk_data regs[2];
    enum mpu3050_fullscale fullscale;
    enum mpu3050_lpf lpf;
    u8 divisor;
    s16 calibration[3];
    struct iio_trigger *trig;
    bool hw_irq_trigger;
    bool irq_actl;
    bool irq_latch;
    bool irq_opendrain;
    bool pending_fifo_footer;
    s64 hw_timestamp;
    struct i2c_mux_core *i2cmux;
 };

look at her. every field accounted for. no notes. πŸ‘‘


πŸŽ€ Members πŸŽ€

okay so here's the member-by-member breakdown, and ngl it's kinda the main character section of this whole page:

  • dev β€” the parent device for this instance. the origin story, if you will.
  • orientation β€” the mounting matrix, flipped axis etc. it's giving "your sensor is sideways and we respect that."
  • map β€” the regmap to reach the registers. the lil translator between you and the hardware's inner monologue.
  • lock β€” the serialization lock to marshal all requests. one at a time babes, we queue 😌
  • irq β€” the IRQ used for this device.
  • regs β€” the regulators to power this device. gotta feed her πŸ’–
  • fullscale β€” the current fullscale setting for the device.
  • lpf β€” the digital low pass filter setting for the device.
  • divisor β€” the base frequency divider: it divides 8 or 1 kHz.
  • calibration β€” the three signed 16-bit calibration settings that get written into the offset registers for each axis to compensate for DC offsets. three of them. signed. 16-bit. doing the math so you don't have to ✨
  • trig β€” the trigger for the MPU-3050 interrupt, if present. if present β€” she's optional, she's mysterious.
  • hw_irq_trigger β€” hardware interrupt trigger is in use.
  • irq_actl β€” interrupt is active low.
  • irq_latch β€” latched IRQ, this means that it is a level IRQ. important detail, don't skip it.
  • irq_opendrain β€” the interrupt line shall be configured open drain.
  • pending_fifo_footer β€” tells us if there is a pending footer in the FIFO that we have to read out first when handling the FIFO. read the footer first, bestie, order matters 🫑
  • hw_timestamp β€” the latest hardware timestamp from the trigger IRQ, when in use.
  • i2cmux β€” an I2C mux reflecting the fact that this sensor is a hub with a pass-through I2C interface coming out of it: this device needs to be powered up in order to reach devices on the other side of this mux. no power, no pass-through, no devices. periodt. ⚑

πŸ¦‹ SEE ALSO πŸ¦‹

go read the Kernel file ./drivers/iio/gyro/mpu3050.h, and also enum mpu3050_fullscale(9) and enum mpu3050_lpf(9) β€” the enum girlies are right there and they're iconic, iykyk πŸ’œ


fr fr that's the whole page. nothing skipped, nothing invented, all facts intact. mwah πŸ“

and that's a wrap on this one β€” brought to you by the source in ./drivers/iio/gyro, dated October 2026, which is honestly so far away and yet here we are πŸ’€βœ¨

πŸ“¦ where this page comes from