ryanrightmer / lis3mdl

A platform agnostic driver to interface with the LIS3MDL (3-axis magnetic sensor)
Apache License 2.0
3 stars 6 forks source link

Support LIS3MDL at any I2C address #1

Closed taruti closed 2 years ago

taruti commented 3 years ago

This adds support for LIS3MDL on other I2C addresses. Needed this to support Adafruit LIS3MDL+LSM6DS33 board.

justacec commented 2 years ago

I came here to see if anybody had done this! :).

I see that there are two solutions proposed. While this provides maximum flexibility, I think that the other proposed solution is a bit easier for the end user as it hard codes all possible addresses based on the sensors data sheet.

ryanrightmer commented 2 years ago

Honestly, I haven't played in the embedded space much for the past several years. How about I make y'all collaborators on this?

justacec commented 2 years ago

@taruti What are your thoughts. I would say that is seems reasonable to go ahead and merge either one of these solutions. I really wish that Rust had an approach for default arguments. I realize that a builder approach would work there, but then you would have to call some function to actually initialize the sensor.

justacec commented 2 years ago

Closing PR in favor of the alternative approach with the limited address space