Skip to content

Conversation

haukepetersen
Copy link
Contributor

@haukepetersen haukepetersen commented Jan 23, 2018

Contribution description

The PR adapts the lis2dh12 driver to work also in I2C mode, which is the used configuration on the thingy52.

Issues/PRs references

@haukepetersen haukepetersen added State: waiting for other PR State: The PR requires another PR to be merged first 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 labels Jan 23, 2018
@haukepetersen
Copy link
Contributor Author

the initialization order for the i2c mode was broken (see #8446), fixed now.

@haukepetersen haukepetersen force-pushed the opt_driver_lis2dh12i2c branch from 1d4de88 to f54e0cc Compare January 31, 2018 11:29
@haukepetersen haukepetersen force-pushed the opt_driver_lis2dh12i2c branch from 908500d to ee7592a Compare March 2, 2018 08:37
@haukepetersen
Copy link
Contributor Author

All dependencies are merged, ready for review and testing.

@haukepetersen haukepetersen removed the State: waiting for other PR State: The PR requires another PR to be merged first label Mar 2, 2018
Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

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

Tested with thingy52.

I had to add PSEUDOMODULES += lis2dh12_i2c to the makefiles/pseudomodules.inc.mk but after that everything worked.

I took me a little while to figure out how to flash and term in but I think #11341 helps with that.

Tested with the test/driver_lis2dh12 and with examples/default, both work and have expected values.

Maybe also rebase and fix the conflicts.

@aabadie
Copy link
Contributor

aabadie commented May 6, 2019

Tested with thingy52.

Maybe you want to have a look at #10793 ?

@benpicco benpicco added the Type: new feature The issue requests / The PR implemements a new feature for RIOT label Sep 13, 2019
@benpicco
Copy link
Contributor

benpicco commented Sep 13, 2019

@haukepetersen mind to rebase? I happen to have a board with this very sensor here.
You can squash directly while you are at it.


#ifndef MODULE_LIS2DH12_SPI
/* in the current state, the I2C driver expects the bus to be acquired
* before the init function is called, so we have to switch order */
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still true?

static int _init_bus(const lis2dh12_t *dev)
{
/* for I2C, we initialize the bus in master mode */
if (i2c_init_master(BUS, BUS_CLK) != BUS_OK) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function does not exist anymore.

@benpicco
Copy link
Contributor

Because we need that driver anyway, I have taken the liberty to rebase this to master and adopt it to the changes in the i2c API.

See #12290 for the updated version.

@haukepetersen
Copy link
Contributor Author

closin in favor of #12290

thanks to @benpicco for taking over!

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 Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants