You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Jacob Rosenthal <ja...@gmail.com> on 2017/12/20 06:25:22 UTC

sensor_itf Is a handy implementation that would be useful for non sensor 'drivers'

The sensor itf struct is kind of handy implementation
https://github.com/apache/mynewt-core/blob/master/hw/drivers/sensors/bme280/src/bme280.c#L233

 It lets you generalizes sensors (or drivers) to pass a struct to each
function call, which in my mind means, even if we havent tested any of
them, it should allow multiple instantiations of a driver/sensor

I noticed others think so too, because the sensor package is being included
in 'drivers' that dont utilize anything else from the driver package
https://github.com/apache/mynewt-core/blob/master/hw/drivers/lp5523/src/lp5523.c

So is there some reasoning for bringing that lower level? Vipul posted some
stuff here and on slack earlier about pushing that struct to os_dev but
that leads. to a bunch of macros and others structures needing to move as
well.

Perhaps you want to weigh in again fresh Vipul?

Thanks,
Jacob