adxl345_set_inact_time(9)
β¨ adxl345_set_inact_time β¨
okay so bestie, welcome to the kernel API manual for adxl345_set_inact_time β yes that's the section 9 one, the kernel-api girlies know π
this is the function that sorts out your accelerometer's inactivity time situation.
πΈ NAME πΈ
adxl345_set_inact_time β configure the inactivity time explicitly, or just let the ODR handle it for you. no cap, it does both π«Ά
π SYNOPSIS π
int adxl345_set_inact_time (struct adxl345_state *st , u32 val_int , u32
val_fract );
π¦ ARGUMENTS π¦
stβ the sensor state instance. your main character struct, literally πval_intβ the inactivity time, integer part. the whole seconds energy β¨val_fractβ the inactivity time, fractional part β but only whenval_intis0. iykyk π
π DESCRIPTION π
so here's the tea β β inactivity time can be configured anywhere between 1 and 255 seconds. that's the range, periodt.
but likeβ¦ if a user sets val_s to 0, a default inactivity time gets calculated automatically, because 0 is also invalid and undefined by the sensor. so yeah, the sensor said "not me" to zero π
in those cases, power consumption should be considered, fr fr: the inactivity period should be shorter at higher sampling frequencies and longer at lower ones. it's giving "match the vibe of your clock" π
specifically, bestie:
- for frequencies above 255 Hz, the default is set to 10 seconds
- for frequencies below 10 Hz, it defaults to 255 seconds
the calculation method is honestly iconic: it subtracts the integer part of the configured sample frequency from 255 to estimate the inactivity time in seconds. sub-Hertz values are ignored in this approximation β they just don't get an invite to the party π
and since the recommended output data rates (ODRs) for features like activity/inactivity detection, sleep modes, and free fall range between 12.5 Hz and 400 Hz, frequencies outside this range will either use the defined boundary defaults or require explicit configuration via val_s. so if you're out here in the wild frequencies, know that π
β RETURN β
0 or error value. that's it, that's the whole mood π
π SEE ALSO π
- Kernel file
./drivers/iio/accel/adxl345_core.c adxl345_set_measure_en(9)adxl345_is_act_inact_ac(9)adxl345_set_act_inact_ac(9)adxl345_get_samples(9)adxl345_fifo_transfer(9)adxl345_fifo_reset(9)adxl345_irq_handler(9)adxl345_core_probe(9)
aaaand that's the whole page π§ this one lives in ./drivers/iio/accel and the version is dated October 2026 β so like, future girlie energy β³π« go off and configure those inactivity times responsibly, bestie, and remember: every detail above is load-bearing, no skipping π₯π«Ά
π¦ 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