msa311_set_odr(9)
π 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.9Hz7.81Hz15.63Hz31.25Hz62.5Hz125Hz250Hz500Hz1000Hz
the way that first two are lowkey restricted to non-normal power modes... iykyk π
β¨ RETURN β¨
0on success β slay, it worked π-EINVALfor a bad ODR value in the certain power mode β like, wrong value for that mode, be so fr-ERRNOin other failures β the generic "something went sideways" bucket π
β¨ SEE ALSO β¨
- Kernel file
./drivers/iio/accel/msa311.cstruct msa311_priv(9)β go read the source, it's giving main character energy msa311_get_odr(9)msa311_wait_for_next_data(9)msa311_set_pwr_mode(9)msa311_get_axis(9)
β¨ 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms