I made a first pass at a driver for the LSM303DLHC using the new sensor
API. This sensor was chosen since it has multiple sensors in a single IC
so it can be used to test the multiple data type functionality in the
sensor API. The magnetometer and accelerometer can also be combined
later to generate basic orientation data to test BG processing of sensor
data streams with useful output over the air. A simple step detection
algorithm can also be implemented based solely on streaming accel data
to an appropriate algorithm.
The pull request is available here along with some basic notes on using
it: https://github.com/apache/incubator-mynewt-core/pull/147
Feel free to modify anything, this is just an attempt to get things
moving with real HW (although having a simulated accelerometer is also
very useful for testing purposes).
The current driver implements statistics and logging (configurable via
syscfg.yml flags). For statistics, the sensor reads are tracked for each
range settings for the accelerometer since the final driver will
probably implement an auto ranging system, and it is helpful to evaluate
the ranging system via statistics.
The magnetometer and temperature sensor will be added as the sensor API
stabilizes, but these are easy additions.
Kevin