admin管理员组

文章数量:1122832

Suppose that we have an accelerometer device that allows to trigger an inactivity interrupt after some period of inactivity. The device allows to configure inactivity using 8 bit register where scale factor is 1s/LSB.

The IIO subsystem allows then to read / write this value through eg:

iio:device0/events/in_accel_thresh_falling_period

What should be the unit of this value? Is it defined in the kernel, or is it device specific? If my device does not allow to configure inactivity time with granularity finer than 1s, should it be expressed in seconds? Or perhaps microseconds?

Suppose that we have an accelerometer device that allows to trigger an inactivity interrupt after some period of inactivity. The device allows to configure inactivity using 8 bit register where scale factor is 1s/LSB.

The IIO subsystem allows then to read / write this value through eg:

iio:device0/events/in_accel_thresh_falling_period

What should be the unit of this value? Is it defined in the kernel, or is it device specific? If my device does not allow to configure inactivity time with granularity finer than 1s, should it be expressed in seconds? Or perhaps microseconds?

Share Improve this question asked Nov 22, 2024 at 21:56 bielu000bielu000 2,2213 gold badges28 silver badges53 bronze badges 1
  • Does below answers your question? – 0andriy Commented Dec 15, 2024 at 19:48
Add a comment  | 

1 Answer 1

Reset to default 0

Either you have a typo in the output example, or a custom kernel. If the latter is the case you need to ask the vendor of that kernel.

Otherwise the kernel documentation is clear about this:

Period of time (in seconds) for which the condition must be met before an event is generated. If direction is not specified then this period applies to both directions.

Just out of curiosity if you need a better granularity for a value, the IIO subsystem provides different markers for the drivers to signal that to the user space, e.g., integer + micro.

本文标签: linux kernelIIO period unitStack Overflow