iio-sensors: Add suport for STEP_DETECTOR sensor
The step detector is a sensor that will trigger an event every
time the user takes a step. More information on the step detector
can be found in Google's documentation:
http://source.android.com/devices/sensors/composite_sensors.html#detector.
The iio interface for the step detector is available with commit
a88bfe785 ("iio: core: Introduce STEPS channel, ENABLE mask and INSTANCE
event") soon to be found in linux kernel 3.20. Also the interface is
documented under Documentation/ABI/testing/sysfs-bus-iio
This is how the interface should be used:
- to enable the step detector, we need to write 1 to events/in_steps_instance_en
- each time a step is detected, an iio event will be generated
- to disable the step detector, we need to write 0 to events/in_steps_instance_en
This patch adds support for the step counter in the HAL:
- add helper functions for iio events
- add support for the step detector sensor
Change-Id: I658b537773c6d9a1cafe3a47f3804034b358a125
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>