OSDN Git Service

iio-sensors: Add suport for STEP_DETECTOR sensor
authorDaniel Baluta <daniel.baluta@intel.com>
Tue, 3 Feb 2015 16:13:03 +0000 (18:13 +0200)
committerDaniel Baluta <daniel.baluta@intel.com>
Fri, 6 Feb 2015 12:26:54 +0000 (14:26 +0200)
commit93ec5a9528f88f69ffee17278b56ba65b4dbc781
tree0aa8ab2ebcfe094d52beb1090fee8830d32c3f69
parent7dd11cd72d9d69570c0d9ed4ef7d9251d7b23ce1
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>
common.h
control.c
description.c
enumeration.c