Is your feature request related to a problem? Please describe.
Every app currently needs to provide custom uses and calls to various peripherals. This means that every reasonable sized application will eventually need a way to manage the communication to all these peripherals. The side-effect of this is that testing is usually an after thought and is generally very difficult.
Describe the solution you'd like
Add two new subsystems (possibly more in the future).
The first will build Android's CHRE.. This can be done by adding a subsys/chre along with Kconfig such as CONFIG_CHRE_PATH. By default we can even add the CHRE as a submodule to Zephyr so that checkout of zephyr can also (optionally) include CHRE. If this is done, this value can have a default path that's relative to the zephyr tree (something like third_party/chre).
Add another subsys/sensor_framework that will be compatible with CHRE's APIs for the Sensor PAL (Platform Abstraction Layer). This will be configured via nodes from devicetree and will communicate with the CHRE (or optionally any other client that is using the same chrePalSensorCallback interface)
The benefits of this approach are:
CHRE is very well tested.
Uses of the raw peripheral data can be written in nanoapps which are easier to test and possibly upstreamed to Zephyr for shared use (things like lid angle calculation from 2 accelerometers, car crash detection, sensor calibration, geo-fencing, etc).
Provides a unified approach for managing and consuming raw peripheral data.
Will work with other drivers (outside of sensors)
Describe alternatives you've considered
The only other sensor framework I know of that is open source and is recently maintained is Chromium's. I came across a few others such as open-sensor-platform, but none of them have been updated recently. In all cases, the effort to bring them up to using the Zephyr drivers, Kconfig, and devicetree seems too great.
Is your feature request related to a problem? Please describe. Every app currently needs to provide custom uses and calls to various peripherals. This means that every reasonable sized application will eventually need a way to manage the communication to all these peripherals. The side-effect of this is that testing is usually an after thought and is generally very difficult.
Describe the solution you'd like Add two new subsystems (possibly more in the future).
subsys/chre
along with Kconfig such asCONFIG_CHRE_PATH
. By default we can even add the CHRE as a submodule to Zephyr so that checkout of zephyr can also (optionally) include CHRE. If this is done, this value can have a default path that's relative to the zephyr tree (something likethird_party/chre
).subsys/sensor_framework
that will be compatible with CHRE's APIs for the Sensor PAL (Platform Abstraction Layer). This will be configured via nodes from devicetree and will communicate with the CHRE (or optionally any other client that is using the same chrePalSensorCallback interface)The benefits of this approach are:
Describe alternatives you've considered The only other sensor framework I know of that is open source and is recently maintained is Chromium's. I came across a few others such as open-sensor-platform, but none of them have been updated recently. In all cases, the effort to bring them up to using the Zephyr drivers, Kconfig, and devicetree seems too great.
Additional context
Ongoing discussions: