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

Update Adafruit_MMA8451.h #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

waymond91
Copy link

@waymond91 waymond91 commented Aug 26, 2022

Unprotected the readRegister8 method in Adafruit_MMA8451.h

Leaving this function protected makes it impossible to implement some of the key features in the chip. These methods are detailed in NXPs application notes .
For example, in AN4070 on page 11: clearing interrupts register flags is completed by a direct register read, and safely bit setting the MMA8451 control registers is completed by first reading the current register state, setting the relevant bits, and then writing the updated state.

If I have time at the completion of my project I would gladly add the features we're building into the main library, but for the time being, protecting readRegister8 makes many of the chips features unusable with this library's current state.

@waymond91
Copy link
Author

Any chance we can get this in?

@waymond91
Copy link
Author

Bump

@caternuson
Copy link
Contributor

Ideally, the missing capabilities would be provided by new public methods that then use the protected methods. Can you restate the issue in terms of missing capabilities? Like "enable free fall detection".

@waymond91
Copy link
Author

By restate, do you mean re-work the info in the PR, or update my PR with the missing functionality that I wrote as a private method in the library??

@caternuson
Copy link
Contributor

It'd be good to first open an issue to state the general problem. That would allow discussion to be had about approaches for solving. Then a PR could be made in that context.

Leaving this function protected makes it impossible to implement some of the key features in the chip.

What key features? Why are they needed? Example use cases also help - to demonstrate why the current library lacks the capability to support it.

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.

None yet

2 participants