-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
STMicro LIS2MDL mag support #13150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STMicro LIS2MDL mag support #13150
Conversation
Do you want to test this code? You can flash it directly from Betaflight Configurator:
WARNING: It may be unstable. Use only for testing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use https://github.com/betaflight/betaflight/blob/master/DEFAULT_LICENCE.md on new files?
Don’t have one yet @SteveCEvans but it’s comi bf from airbot |
AUTOMERGE: (FAIL)
|
@@ -204,6 +205,22 @@ bool compassDetect(magDev_t *magDev, uint8_t *alignment) | |||
#endif | |||
FALLTHROUGH; | |||
|
|||
case MAG_LIS2MDL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's almost time to use some cleaner way to do initialization.. The code duplication is incredible ...
Fixed. Thanks. |
Thanks, Steve. |
The datasheet is linked in the description 😉 |
Let's get this merged, to be included with 4.5 RC1. |
* STMicro LIS2MDL mag support * Fix copyright headers * Update PG_COMPASS_CONFIG
* STMicro LIS2MDL mag support * Fix copyright headers * Update PG_COMPASS_CONFIG
@SteveCEvans Is there any reason why BDU and OFF_CANC are not used? |
This PR adds support for the STMicro LIS2MDL magnetometer.
This has been tested on a MATEKH743 and STMicro STEVAL-MKI181V1 eval card using the following config changes with the eval board wired to I2C bus 1 and the eval card
CS
pin tied toVdd
.