Closed ladislas closed 4 years ago
Première comparaison effectuée, je remets ici le contenu de l'analyse et résultat:
In order to pick the right driver among proposed list (see README.md in above directory).
Different criteria could be :
mbed-ST_LSM6DSOX
refer to LSM6DSOX driver on mbed, it is published by ST (manufacturer) [Link].github-STMicroelectronics_STMems_Standard_C_drivers
refer to LSM6DSOX driver on github, it is published by STMicroelectronics (manufacturer) [Link].github-stm32duino_LSM6DSOX
refer to LSM6DSOX driver on github, it is published by stm32duino for Arduino application [Link]. Date of writing: 13 May 2020
mbed-ST_LSM6DSOX
has 1 commit, the last was 10 July 2019.github-STMicroelectronics_STMems_Standard_C_drivers
has 515 commits, the last was 8 May 2020.github-stm32duino_LSM6DSOX
has 7 commits, the last was 10 March 2020.Several files were generated in compare
folder, they represent differences in code among different drivers files.
Drivers’ names were replaced by numbers in order to simplify:
1 : mbed-ST_LSM6DSOX
3 : github-stm32duino_LSM6DSOX
3_old : github-stm32duino_LSM6DSOX (25 July 2019)
_old
refer to a previous version, contemporary of last version of driver on mbed.
(later)
refer to current version of the driver.
(Diff in color available with Sublime Text software.)
mbed-ST_LSM6DSOX commit is similar to commit 88cfaac89e885c2ccbbbf924912230b13be77e4f
of github-STMicroelectronics_STMems_Standard_C_drivers , the only difference between both is different I3C value in register but don’t have impact on normal running.
Other differences between last version of both drivers can be seen in history (11 commits ago at this time).
LSM6DSOXSensor.*
files missing in github-STMicroelectronics_STMems_Standard_C_drivers.group Basic configuration
[Link] with a lot of new functions and associated struct
.lsm6dsox_all_sources_get()
and all lsm6dsox_pin_int[1/2]_route_[set/get]()
with all associated struct
.struct ucf_line_t
for .ucf
files (Machine Learning model).lsm6dsox_timestamp_rst()
.lsm6dsox_pin_int2_route_set()
.lsm6dsox_xl_data_rate_set()
and lsm6dsox_gy_data_rate_set()
checking data rate constraints of Finite State Machine (FSM) and Machine Learning Core (MLC).LSM6DSOX_PEDO_ADV_MODE
.lsm6dsox_ctx_t
by stmdev_ctx_t
.LSM6DSOX_XL_ODR_6Hz5
by LSM6DSOX_XL_ODR_1Hz6
.bytecopy()
Several files were generated in compare
folder, they represent differences in code among different drivers files.
Drivers’ names were replaced by numbers in order to simplify:
1 : mbed-ST_LSM6DSOX
3 : github-stm32duino_LSM6DSOX
3_old : github-stm32duino_LSM6DSOX (25 July 2019)
_old
refer to a previous version, contemporary of last version of driver on mbed.
(later)
refer to current version of the driver.
(Diff in color available with Sublime Text software.)
MotionSensor
and GyroSensor
in LSM6DSOXSensor.*
are mandatory in mbed-ST_LSM6DSOX.Wire
and TwoWire
used in github-stm32duino_LSM6DSOX instead of DevI2C
in mbed-ST_LSM6DSOX.Attach()
, Enable()
and Disable()
functions are missing for both interrupts (INT1, INT2) in github-stm32duino_LSM6DSOX.class LSM6DSOXSensor
constructor.SPI
in LSM6DSOXSensor.*
is mandatory in github-stm32duino_LSM6DSOX.io_read()
and io_write()
are slightly different but do same task in both drivers.Constructor
of class LSM6DSOXSensor
in github-stm32duino_LSM6DSOX is equivalent as Constructor
+ init()
of class LSM6DSOXSensor
in mbed-ST_LSM6DSOX.LSM6DSOXSensor.*
act as bridge to existing functions in lsm6dsox_reg.*
(Get_MLC_Status()
and Get_MLC_Output()
)enum LSM6DSOXStatusTypeDef
in github-stm32duino_LSM6DSOX.float_t
in mbed-ST_LSM6DSOX replaced by float
in github-stm32duino_LSM6DSOXvirtual
functions in mbed-ST_LSM6DSOX.lsm6dsox_reg.*
) is compatible but above layer (LSM6DSOXSensor.*
) is made for arduino and have to be adapted to mbed.LSM6DSOXSensor.*
It is a necessity to stay up to date, so driver lsm6dsox_reg.*
should be the one provided by manufacturer on github.
A new abstraction layer LSM6DSOXSensor.*
can be done based on drivers of mbed and stm32duino versions but also recent add group Basic configuration
on ST version on github.
However only relevant functions should be kept and dependencies should be removed.
now that we know that the nucleo and the LSM6DSOX are working fine, let's build a clean example with mbed and the only the sensor drivers.
It would be nice to compare different drivers and see what works best for us.