Skip to content
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

LSM9DS1 interrupts #5

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

seanboe
Copy link
Member

@seanboe seanboe commented Apr 15, 2022

Added interrupt functionality to the LSM9DS1 library.

seanboe added 6 commits April 14, 2022 10:09
Only some very slight changes, but I (at least within main.cpp and the SPIDevice and LSM9DS1 libraries) removed the dependency on the UART.h library since this isn't support for teensy lc. The main change was modifying all references to pin_size_t to uint16_t and adding SPI.begin() to setup.
@seanboe seanboe requested a review from UselessMnemonic April 15, 2022 22:17
@@ -105,6 +110,18 @@ void LSM9DS1::readGyroscope(float &x, float &y, float &z) {
}


void LSM9DS1::setGyroActivity(bool wake) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review this method and the registers used, please add clarifying comments on the register in the header file

@@ -125,6 +142,154 @@ void LSM9DS1::readMagnetosensor(float &x, float &y, float &z) {
z = z_raw * resolution / 1000;
}

void LSM9DS1::configXLInterrupt(INT_XL_CONFIG intConfig, bool andInterrupt, uint8_t duration) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the configuration in the registers here and update those values instead of writing directly to the register to avoid overwriting bits that were already set

@@ -1,21 +1,24 @@
#include <Arduino.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please migrate main code here to its own test file that we can invoke individually

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigate what testing suite or general testing support is offered by PlatformIO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants