[riot-notifications] [RIOT-OS/RIOT] RFC: Change of sensor and actuator API & auto initialization (#11826)

MichelRottleuthner notifications at github.com
Mon Jul 15 11:36:19 CEST 2019

@maribu thanks for starting this RFC. I agree that its worth having this discussion and there are problems we should try to solve.
Adding my opinion:
> 1. Is auto-initialization of sensor and actuator drivers is desired?

Yes sure! But optional, IMO even on a per device level.

> 2. Should using the native sensor/actuator API and SAUL no longer be mutually exclusive?


> And, if the first two questions are answered with yes: How should the sensor/actuator APIs be changed to achieve this?

Collecting viable solutions and comparing their ups and downs should help here ;)
As you already pointed out, other APIs handle it similarly with a dev index. A relevant difference between those cases is that the number of SPI etc. peripherals can be considered fixed for one specific platform, while external devices could be added in basically arbitrary numbers. Arguably though, you would probably know your setup beforehand...
One problem I see is that this requires you to have all devices in this one centralized array, whereas a reference to the dev is more flexible and makes it easier to (dynamically) allocate devices wherever you want them.
An option to access the low-level device handle thru SAUL, as @jcarrano mentioned above also sounds interesting.

Generally speaking: just because SAUL is simplifying/generalizing the use of devices it shouldn't keep you from accessing device specific functionality if _you know what you are doing_â„¢. 

Recently I also had a case where my application could have benefited a lot from using SAUL with the exception of one sensor where I needed low-level access. For this case, our SAUL/auto_init/build-config procedure was missing flexibility to specify exactly what should be initialized, and what not.

Only partly related, but just in case there are overlaps of both topics we should also keep an eye on the SAUL/phydat issues regarding flexibility (e.g. dimensions) and resolution, as already described in [#10157

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190715/8ffae79e/attachment-0001.html>

More information about the notifications mailing list