Skip to content

mma8652: add support for all mma8x5x accelerometers#5433

Merged
PeterKietzmann merged 1 commit intoRIOT-OS:masterfrom
OTAkeys:pr/mma8x5x
Nov 18, 2016
Merged

mma8652: add support for all mma8x5x accelerometers#5433
PeterKietzmann merged 1 commit intoRIOT-OS:masterfrom
OTAkeys:pr/mma8x5x

Conversation

@vincent-d
Copy link
Copy Markdown
Member

This adds the support of all mma8x5x accelerometers.
The device id is the only difference between the devices with the current driver.
Backward compatibility should work as the MMA8652 has the id 0 in the enum.

@PeterKietzmann PeterKietzmann added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: drivers Area: Device drivers labels May 12, 2016
@PeterKietzmann PeterKietzmann self-assigned this May 12, 2016
@PeterKietzmann
Copy link
Copy Markdown
Member

Won't review until next Hack'n'ACK. If anyone volunteers, go ahead!

@jfischer-no
Copy link
Copy Markdown
Contributor

There is also ./tests/driver_mma8652 that needs to be adapted.

@jfischer-no jfischer-no self-assigned this May 27, 2016
@PeterKietzmann PeterKietzmann removed their assignment May 31, 2016
@jfischer-no
Copy link
Copy Markdown
Contributor

@vincent-d thx and ACK

@jfischer-no jfischer-no added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 31, 2016
* @return -5 if accelerometer configuration failed
*/
int mma8652_init(mma8652_t *dev, i2c_t i2c, uint8_t address, uint8_t dr, uint8_t range);
int mma8652_init(mma8652_t *dev, i2c_t i2c, uint8_t address, uint8_t dr, uint8_t range, uint8_t type);
Copy link
Copy Markdown
Member

@PeterKietzmann PeterKietzmann May 31, 2016

Choose a reason for hiding this comment

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

Don't you think it's a bit confusing to stay with the mma8652 while changing the driver to mma8x5x? Was it because of the API change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree it can be confusing.
I did not want to do the full API change to avoid breaking compatibility. But we can imagine a couple of macro to translate calls if needed.
So I can still make the change API if you prefer it.

@PeterKietzmann
Copy link
Copy Markdown
Member

What is the difference between these sensors actually?

@vincent-d
Copy link
Copy Markdown
Member Author

@PeterKietzmann There is no common datasheet for the whole family, so it's not so easy to point out every difference. Some have tap detection, others freefall detection, or the output precision can differ. But from what I saw, the subset of functionalities implemented in this driver is common to all devices. Only the device id changes.

@PeterKietzmann
Copy link
Copy Markdown
Member

Currently I don't know which way to go for merging sensor drivers. #5484 shows another way for that. I'd like to hear @haukepetersen's opinion on that.
As it seems you did not add functionality to the driver. What was your rational behind this PR?

@vincent-d
Copy link
Copy Markdown
Member Author

We use a mma8653 which works the same but has a different device ID, and I didn't want to do a big api change without having a feedback.

I thought at this time this was the simplest way to support it.

@PeterKietzmann
Copy link
Copy Markdown
Member

Well, I don't have a design decision by hand. Is it urgent for you to get this feature in? Otherwise I tend to give it some more time and find a good way to merge similar sensor drivers

@smlng smlng mentioned this pull request Jun 2, 2016
@vincent-d
Copy link
Copy Markdown
Member Author

I would not say it's really urgent, but I would rather have that merged and then spend a bit of time later on to refactor with a new design than just wait. The changes are pretty small anyway. It's up to you ;)

@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 18, 2016

Then let's try to get this merged for 2016.10.

@miri64 miri64 added this to the Release 2016.10 milestone Oct 18, 2016
@PeterKietzmann
Copy link
Copy Markdown
Member

@miri64 the change itself is ok -> "mergable". The question is about how to combine device drivers for "similar" devices. Anyway, I won't NACK this one. But please decide you!

@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 19, 2016

I would say that is something we always can decide later on. Wouldn't be the first time that consolidation happened, after two similar features were merged ;-) (see …_common in cpu/boards)

@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 31, 2016

Feature freeze -> postponed

@miri64 miri64 modified the milestones: Release 2017.01, Release 2016.10 Oct 31, 2016
@vincent-d
Copy link
Copy Markdown
Member Author

Ping ?

@PeterKietzmann PeterKietzmann added the Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. label Nov 16, 2016
@PeterKietzmann
Copy link
Copy Markdown
Member

Just saw that this PR implies an API change. Anyone affected by this??? Otherwise I would approve and merge this PR soon.

@PeterKietzmann
Copy link
Copy Markdown
Member

@vincent-d would you squash your second commit please?

@vincent-d
Copy link
Copy Markdown
Member Author

@PeterKietzmann squashed

Copy link
Copy Markdown
Member

@PeterKietzmann PeterKietzmann left a comment

Choose a reason for hiding this comment

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

Enough time for objections. ACK and go. I will add the memo label cause we should find a way to better handle similar device drivers and adapt this one accordingly.

@PeterKietzmann PeterKietzmann merged commit 7114153 into RIOT-OS:master Nov 18, 2016
@PeterKietzmann PeterKietzmann added the State: archived State: The PR has been archived for possible future re-adaptation label Nov 18, 2016
@toonst toonst deleted the pr/mma8x5x branch August 21, 2018 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. State: archived State: The PR has been archived for possible future re-adaptation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants