Skip to content

LIS3MDL driver implementation for LimiFrog V1#3495

Merged
haukepetersen merged 1 commit intoRIOT-OS:masterfrom
ReneHerthel:lis3mdl
Mar 29, 2016
Merged

LIS3MDL driver implementation for LimiFrog V1#3495
haukepetersen merged 1 commit intoRIOT-OS:masterfrom
ReneHerthel:lis3mdl

Conversation

@ReneHerthel
Copy link
Copy Markdown
Contributor

LIS3MDL driver implementation for LimiFrog V1

Original Issue: board: RIOT port for LimiFrof V1 #3020

@ReneHerthel
Copy link
Copy Markdown
Contributor Author

@PeterKietzmann Here's the initial create for the LIS3MDL driver. It should be testable, when the port is done, I hope I didn't forgot anything :-).

@LudwigKnuepfer LudwigKnuepfer added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: drivers Area: Device drivers labels Jul 26, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please check the https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions - you could also check what astyle does for you.

This particular case:

if (...)
{

should become

if (...) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@LudwigOrtmann Okey, Thanks for the link.

@PeterKietzmann
Copy link
Copy Markdown
Member

@ReneHerthel thx! Running astyle is a good idea (maybe before each PR you open). The bluefrog port-PR should be available in some days.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you briefly explain what this does?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@PeterKietzmann It blocks the update process for magnetic data, until MSb and LSb was read.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And you are disabling that functionality with this command, right? Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@PeterKietzmann Yes, I thought it's better to block the data update process within the registers until the entire data has been read.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok I understand that point. Maybe one should spend some more thoughts if this is wanted. The questions should be: 1. when are the values updated if this functionality is disabled and 2. what if the data is not being read for a while? The measured values may be outdated at that time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@PeterKietzmann Hmm, okey. Yes two good Points, maybe I should remove this for the Moment, and later, when we can test the device, we can look, if this is a good idea or not.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do whatever you think is best :-) and we'll prove it then.

@PeterKietzmann
Copy link
Copy Markdown
Member

@ReneHerthel the PR looks really good. Nice!

@OlegHahm
Copy link
Copy Markdown
Member

I think this PR contains an error: http://www.limifrog.io/2015/07/la-bluefrog-changes-name/ ;-)

@PeterKietzmann
Copy link
Copy Markdown
Member

But AFAIK the limifrog has a slightly different hardware. That's why we stayed with "bluefrog". I will ask Xavier

@OlegHahm
Copy link
Copy Markdown
Member

Ah, okay, I thought it was a name-only change.

@PeterKietzmann PeterKietzmann changed the title LIS3MDL driver implementation for La Blue Frog LIS3MDL driver implementation for LimiFrog V1 Jul 28, 2015
@PeterKietzmann PeterKietzmann self-assigned this Jul 29, 2015
@PeterKietzmann
Copy link
Copy Markdown
Member

The basic support for the LimiFrog board has been merged with #3509. Next, we need to test this driver with the on-board sensor.

@ReneHerthel
Copy link
Copy Markdown
Contributor Author

Rebase.

@ReneHerthel
Copy link
Copy Markdown
Contributor Author

@PeterKietzmann The basic functionality should work now!
The issue with the I2C connection is gone.
The problem was the address of the magnetometer.
It needs a 7-bit address, instead of 8-bit :-).
I found out that the /cpu/stm32l1/periph/i2c.c:523 shifts the address to the left by one.
Then there was this comment in the LimiFrog repository.

AND there is some code missing in the /cpu/stm32l1/periph/i2c.c, just to remind.

@PeterKietzmann
Copy link
Copy Markdown
Member

Jippie! Hope we can make some progress next week. Regarding the i2c driver for stm32l1 CPUs: @ReneHerthel, @katezilla, @haukepetersen, @thomaseichinger anyone willing to extend/renew this peripheral driver? Any capacities?

@PeterKietzmann
Copy link
Copy Markdown
Member

(PS: We need to use I2C_1 or _2 ?)

@ReneHerthel
Copy link
Copy Markdown
Contributor Author

@PeterKietzmann I use I2C_1 for this.

@OlegHahm OlegHahm modified the milestone: Release NEXT MAJOR Sep 2, 2015
@ReneHerthel
Copy link
Copy Markdown
Contributor Author

@PeterKietzmann Would you like to test my latest work?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any reason to enable the temp sensor while not using it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ups, never mind. Overlooked the reading of temp values at the bottom of the main...

@OlegHahm
Copy link
Copy Markdown
Member

Realistic to have this ready until next Wednesday?

*/
typedef struct {
i2c_t i2c; /** I2C device */
uint8_t addr; /** Magnometer I2C address */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you fix the indent here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • [x]

@katezilla
Copy link
Copy Markdown
Contributor

tested it, magnometer works, if close to laptop or phone it shows higher values.
temperature also fine. code looks sane with minor issues.
@ReneHerthel please address the issues.
@OlegHahm yes.

@katezilla katezilla added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Mar 24, 2016
@PeterKietzmann PeterKietzmann modified the milestones: Release 2016.07, Release 2016.04 Mar 24, 2016
@ReneHerthel ReneHerthel force-pushed the lis3mdl branch 2 times, most recently from d184198 to d72c2be Compare March 25, 2016 19:38
@ReneHerthel
Copy link
Copy Markdown
Contributor Author

@katezilla I addressed your comments.

@PeterKietzmann PeterKietzmann added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable labels Mar 29, 2016
@PeterKietzmann
Copy link
Copy Markdown
Member

Added CI build label to compile-check that PR

@PeterKietzmann PeterKietzmann added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 29, 2016
@cgundogan
Copy link
Copy Markdown
Member

Please rebase this PR and replace all uses of vtimer with xtimer

@ReneHerthel ReneHerthel force-pushed the lis3mdl branch 3 times, most recently from af1bf3e to d905e5a Compare March 29, 2016 14:39
@ReneHerthel
Copy link
Copy Markdown
Contributor Author

Changed from xtimer to vtimer and rebase + squash

@ReneHerthel ReneHerthel force-pushed the lis3mdl branch 2 times, most recently from 671b789 to 44ee645 Compare March 29, 2016 18:55
@haukepetersen
Copy link
Copy Markdown
Contributor

ACK and go

@haukepetersen haukepetersen merged commit 26bbb6a into RIOT-OS:master Mar 29, 2016
@ReneHerthel ReneHerthel deleted the lis3mdl branch March 30, 2016 14:26
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.

8 participants