Skip to content

Commit

Permalink
include: sensor: Allow sensor private attr/chan/trig
Browse files Browse the repository at this point in the history
Add some flexibility to the sensor API.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
  • Loading branch information
pdunaj authored and MaureenHelm committed May 29, 2019
1 parent 9367161 commit 938a8e1
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions include/sensor.h
Expand Up @@ -134,6 +134,22 @@ enum sensor_channel {

/** All channels. */
SENSOR_CHAN_ALL,

/**
* Number of all common sensor channels.
*/
SENSOR_CHAN_COMMON_COUNT,

/**
* This and higher values are sensor specific.
* Refer to the sensor header file.
*/
SENSOR_CHAN_PRIV_START = SENSOR_CHAN_COMMON_COUNT,

/**
* Maximum value describing a sensor channel type.
*/
SENSOR_CHAN_MAX = INT16_MAX,
};

/**
Expand Down Expand Up @@ -171,6 +187,22 @@ enum sensor_trigger_type {

/** Trigger fires when a double tap is detected. */
SENSOR_TRIG_DOUBLE_TAP,

/**
* Number of all common sensor triggers.
*/
SENSOR_TRIG_COMMON_COUNT,

/**
* This and higher values are sensor specific.
* Refer to the sensor header file.
*/
SENSOR_TRIG_PRIV_START = SENSOR_TRIG_COMMON_COUNT,

/**
* Maximum value describing a sensor trigger type.
*/
SENSOR_TRIG_MAX = INT16_MAX,
};

/**
Expand Down Expand Up @@ -217,6 +249,22 @@ enum sensor_attribute {
* algorithms to calibrate itself on a certain axis, or all of them.
*/
SENSOR_ATTR_CALIB_TARGET,

/**
* Number of all common sensor attributes.
*/
SENSOR_ATTR_COMMON_COUNT,

/**
* This and higher values are sensor specific.
* Refer to the sensor header file.
*/
SENSOR_ATTR_PRIV_START = SENSOR_ATTR_COMMON_COUNT,

/**
* Maximum value describing a sensor attribute type.
*/
SENSOR_ATTR_MAX = INT16_MAX,
};

/**
Expand Down

0 comments on commit 938a8e1

Please sign in to comment.