Sharing a driver between similar devices


Michael Hope
 

Hi there.  I'm porting Zephyr to the Arduino Nano 33 IOT.  The board has a LSM6DS3 IMU which is very similar to the LSM6DSL that's already supported by Zephyr and I'd like to re-use it.

I've refactored [1] the lsm6dsl driver to be multi-instance.  What's the best way of then using the same driver for two different compats?  The best I've come up with is [2] but that has name collision issues.

Note that the chips also have a different WHO_AM_I value, so need very slightly different configuration.


-- Michael

Join devel@lists.zephyrproject.org to automatically receive all group messages.