dotnet / iot

This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs.
MIT License
2.12k stars 574 forks source link

Add LIS3DSHTR to LIS3DHTR code #2283

Closed JTrotta closed 3 months ago

JTrotta commented 4 months ago

Is your feature request related to a problem? Please describe. No problem.

Yes: LIS3DH

Describe the ideal solution It would be nice to use the same library/code to use both. It's just a matter of registry addresses.

Choose the version of LIS during object creation.

krwq commented 4 months ago

@JTrotta can you find specific differences between those? If it's just the address difference you should be able to reuse existing binding - if the registers are completely different it probably makes sense to keep them separate anyway.

JTrotta commented 4 months ago

The differences are not related only to the slave address, but to the whole register addresses (CTRL_REG1, 2, 3, 4 , etc.). But the usage it's identical. You suggest to create a new device or to generalize the existing one?

pgrawehr commented 4 months ago

If possible, we generally try to generalize, e.g. with subclasses. It's also OK to rename namespaces, if needed.

krwq commented 3 months ago

[Triage] @JTrotta we're not tracking device requests, please open a PR if you're interested in contributing or re-open / create a new issue if you have any more questions