msa311_set_odr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ msa311_set_odr(9) πŸŽ€

okay bestie, we're in the Kernel API Manual, section 9, and today's main character is msa311_set_odr β€” literally the function that sets the Output Data Rate on the MSA311 accelerometer. yes, that one. let's get into it πŸ’…


✨ NAME ✨

msa311_set_odr β€” Setup Output Data Rate (ODR) value for MSA311 accel πŸ¦‹

✨ SYNOPSIS ✨

int msa311_set_odr (struct msa311_priv *msa311 , unsigned int odr );

like, that's the whole signature. no cap.

✨ ARGUMENTS ✨

  • msa311 β€” the MSA311 internal private state, aka its whole little diary of vibes πŸ™ˆ
  • odr β€” the requested ODR value. the one you're asking for. be nice to it.

✨ DESCRIPTION ✨

okay so hear me out β€” this function should be called under msa311->lock. like, that's not a suggestion, that's the rule. hold the lock, bestie, or things get messy 😭

Here are the possible ODR values, and yes I'm listing every single one because they all matter:

  • 1Hz (not available in normal mode) πŸ“
  • 1.95Hz (not available in normal mode) πŸ“
  • 3.9Hz
  • 7.81Hz
  • 15.63Hz
  • 31.25Hz
  • 62.5Hz
  • 125Hz
  • 250Hz
  • 500Hz
  • 1000Hz

the way that first two are lowkey restricted to non-normal power modes... iykyk πŸ‘‘

✨ RETURN ✨

  • 0 on success β€” slay, it worked πŸ’–
  • -EINVAL for a bad ODR value in the certain power mode β€” like, wrong value for that mode, be so fr
  • -ERRNO in other failures β€” the generic "something went sideways" bucket πŸ’€

✨ SEE ALSO ✨


✨ reminder bestie: call it under msa311->lock or the vibe check fails ✨

and that's the page! brought to you by the fine folks living in ./drivers/iio/accel, stamped October 2026, page msa311_set_odr(9) β€” mwah, go set some ODRs responsibly πŸ«ΆπŸŒΈπŸ’œ

πŸ“¦ where this page comes from