Re: [RFC] Sensor API

Vlad Dogaru <vlad.dogaru@...>


I have uploaded another iteration of the sensor API patches on Gerrit [1].
This addresses some minor issues that have been raised this week and
also ports another driver, the SX9500 SAR proximity.

There is also an API change: previously, there were two functions for
reading a channel. One operated on a sensor_value, in the interest of
avoiding floating point operations, while the other used floating point.
I folded these two functions into a single one and there is now a
SENSOR_TYPE_DOUBLE to indicate that the structure actually contains a
valid floating point value. The sensor_value structure now includes a
union to accomodate this case.

Documentation has also been updated, the most significant change being
that each channel now has a comment specifying the unit of measurement.

At the moment I feel that the API, infrastructure and two drivers are
ready to be merged, unless there are more comments, of course.

If everything is on track, we will start porting the other drivers [2]
to this iteration of the API.

[1] Introduce new sensor API Add infrastructure for sensor drivers sensor: Add driver for MCP9808 temperature sensor samples: Add sample app for MCP9808 sensor sensor: Add threshold trigger support for MCP9808 sensor: Add sx9500 SAR proximity driver samples: Add sample app for sx9500 sensor driver



Join { to automatically receive all group messages.