LSM6DS3 driver implementation for LimiFrog V1#3263
LSM6DS3 driver implementation for LimiFrog V1#3263ReneHerthel wants to merge 4 commits intoRIOT-OS:masterfrom
Conversation
|
@ReneHerthel nice! I will have a deeper look when you finished your todos. Are there any questions for this? |
drivers/include/lsm6ds3.h
Outdated
There was a problem hiding this comment.
Add HAW Hamburg here and let FU Berlin in, as you code seems to base on Thomas Eichingers code
There was a problem hiding this comment.
If we stay with the (below discussed) decision that you are the only author, please replace FU by HAW
|
Just a side question: How similar are the LSM6DS3 and the LSM303DLHC drivers? Does it make sense to merge them into the same codebase? |
|
@ReneHerthel? I don't know about the internals... |
|
The LSM6DS3 is a little different as the LSM303DLHC. See here: and: If you want to have an overview.. |
|
I tend to have separate implementations. Here are just some reasons I found during a quick look in the datasheets:
@haukepetersen if you have other opinions please state them as fast as you can! |
|
@PeterKietzmann any ideas? did you look at my latest push? :-) |
|
@ReneHerthel no I didn't. As long as no message plopps up here I'm not aware of new commits :-) . Will look inside soon. Are there open questions? |
|
@PeterKietzmann Ooh, I forgot to tell you... ehm, yes I'm not sure with the FIFO-registers, because the LSM303DLHC has constant addresses to the two sensors, and the LSM6DS3 not, so should I use the address, of the FIFO-output-register, where the data from the sensors are stored? .. I guess this was the only thing i didn't implemented yet.. |
|
@ReneHerthel if reading from the fifos is the only way to get the measurement data from the sensors, I think there is no way around :-). Or did I get you wrong? I don't know if you're aware of it, or even if it's interesting, but did you see #3054? If you need more help here, please rephrase your question so I can specifically search in the datasheet. |
drivers/include/lsm6ds3.h
Outdated
There was a problem hiding this comment.
Does this correlate with the fifo stuff you've been explaining?
There was a problem hiding this comment.
Ok. Then the next question is, do you need these defines? Or as you want to have them in for "template"-reasons, you could add a comment...
|
The driver should be compatible as long as the sensor is connected via I2C (I don't even know if this device supports other bus protocols). Only thing that should need adaption is the pin configuration and probably the slave address. I fear that there might be some relicts that I plan to fix as soon as I have the hardware available. In best case this only concerns the usage of |
|
@PeterKietzmann, will test, probably tomorrow afternoon |
| @@ -0,0 +1,48 @@ | |||
| /* | |||
There was a problem hiding this comment.
Can this file be moved to drivers/lsm6ds3/include so one can use it with the default params and the sensor plugged on another board ?
|
|
| data->z_axis = raw[2] * sensitivity / GYR_DIVIDER; | ||
| } | ||
|
|
||
| void lsm6ds3_read_temp(lsm6ds3_t *dev, int16_t *data) |
There was a problem hiding this comment.
should be value instead of data here or data below instead of value, otherwise it doesn't build
| i2c_read_reg(dev->i2c, dev->addr, LSM6DS3_WHO_AM_I_REG, &tmp); | ||
|
|
||
| if (tmp != LSM6DS_CHIP_ID) { | ||
| DEBUG("LIS3MDL: Failed to identify sensor\n"); |
|
Tested on my ST nucleo iks01a1 shield where there's a LSM6DS0. Following the datasheet the ID is |
|
I also tried to skip the sensor ID verification and the read values were wrong (empty). |
|
|
||
| i2c_acquire(dev->i2c); | ||
|
|
||
| i2c_init_master(i2c, I2C_SPEED_NORMAL); |
There was a problem hiding this comment.
I think this line should go before i2c_aquire
|
@ReneHerthel please don't take it personally but I'm wondering how you even tested this. (i) Your demo application doesn't even compile and (ii) with compilation errors fixed the application simply hard-faults and reboots the device constantly which might be related to #6432. Btw, I fetched your branch. When I offered to shepherd this implementation I've assumed there are only minor style fixes left over but this requires more work which I can't provide before the release. I'm sorry. |
|
@aabadie in case you are willing to take this over in the context of your board and driver enhancement-mania :-), feel free to do so! Otherwise I will try my best to provide fixes for the limifrog first and this driver after the release. Thanks for the review! |
|
Ping? |
|
with #6835 already merged it might be possible to unify these drivers?! A quick look into some of the defines showed that both devices share lots of values. |
|
Ping again then ;-) |
|
I see no reason for this PR so stay open. No progress since months or years. #6835 provides a driver for a similar device. Maybe a 'busy bee' will merge both drivers in some time in future. Closing with memo label set. |
Needed for the port of the board: LimiFrog.
board: RIOT port for LimiFrog V1 #3020
@PeterKietzmann Here's my first implementation for the lsm6ds3 driver, but there are still some TODO's, which I have to handle in the next time..