Skip to content

Commit

Permalink
driver working on both boards
Browse files Browse the repository at this point in the history
  • Loading branch information
Miquel-HAW committed Dec 12, 2023
1 parent e97f9a7 commit 7d7894a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
9 changes: 9 additions & 0 deletions boards/b-l475e-iot01a/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ extern "C" {
#define LSM6DSL_PARAM_ADDR (0x6A)
/** @} */


Check warning on line 78 in boards/b-l475e-iot01a/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

too many consecutive empty lines
/**
* @name LSM6DSXX accelerometer sensor configuration
* @{
*/
#define LSM6DSXX_PARAM_I2C I2C_DEV(1)

Check failure on line 83 in boards/b-l475e-iot01a/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

Member LSM6DSXX_PARAM_I2C (macro definition) of file board.h is not documented.
#define LSM6DSXX_PARAM_ADDR (0x6A)
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 4 additions & 2 deletions boards/feather-nrf52840-sense/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ extern "C" {
/** @} */

/**
* @name Adress parameter for lsm6ds33 sensor
* @name LSM6DSXX accelerometer sensor configuration
* @{
*/
#define LSM6DSXX_PARAM_ADDR (0x6A)
#define LSM6DSXX_PARAM_I2C I2C_DEV(0)
#define LSM6DSXX_PARAM_ADDR (0x6A)
#define LSM6DSXX_WHO_AM_I (0b01101001)

Check failure on line 91 in boards/feather-nrf52840-sense/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

trailing whitespace.

Check warning on line 91 in boards/feather-nrf52840-sense/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

trailing whitespace
/** @} */

#ifdef __cplusplus

Check failure on line 94 in boards/feather-nrf52840-sense/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

trailing whitespace.

Check warning on line 94 in boards/feather-nrf52840-sense/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

trailing whitespace
Expand Down
5 changes: 4 additions & 1 deletion drivers/lsm6dsxx/include/lsm6dsxx_internal.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "board.h"

#ifndef LSM6DSXX_INTERNAL_H
#define LSM6DSXX_INTERNAL_H
Expand Down Expand Up @@ -124,7 +125,9 @@ extern "C" {
/** @} */

/** WHO_AM_I value */
#define LSM6DSXX_WHO_AM_I (0b01101001)
#ifndef LSM6DSXX_WHO_AM_I
#define LSM6DSXX_WHO_AM_I (0b01101010) /* In feather board value=0b01101001 b-l475e-iot01a board=0b01101010*/

Check warning on line 129 in drivers/lsm6dsxx/include/lsm6dsxx_internal.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#endif

/**
* @name CTRL_x registers
Expand Down
2 changes: 1 addition & 1 deletion drivers/lsm6dsxx/include/lsm6dsxx_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extern "C" {
#define LSM6DSXX_PARAM_I2C I2C_DEV(0)
#endif
#ifndef LSM6DSXX_PARAM_ADDR
#define LSM6DSXX_PARAM_ADDR (0x6B) /* (0x6B) for b-l475e-iot01a (0x6A) for feather-sense*/
#define LSM6DSXX_PARAM_ADDR (0x6A)

Check failure on line 21 in drivers/lsm6dsxx/include/lsm6dsxx_params.h

View workflow job for this annotation

GitHub Actions / static-tests

trailing whitespace.
#endif
#ifndef LSM6DSXX_PARAM_ACC_ODR
#define LSM6DSXX_PARAM_ACC_ODR (LSM6DSXX_DATA_RATE_52HZ)
Expand Down
2 changes: 1 addition & 1 deletion drivers/lsm6dsxx/lsm6dsxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "lsm6dsxx.h"
#include "lsm6dsxx_internal.h"

#define ENABLE_DEBUG 0
#define ENABLE_DEBUG 1
#include "debug.h"

#define BUS (dev->params.i2c)
Expand Down
3 changes: 1 addition & 2 deletions tests/drivers/lsm6dsxx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ int main(void)
lsm6dsxx_3d_data_t acc_value;

puts("LSM6DSXX test application");
printf("Initializing LSM6DSXX sensor at I2C_%i... ", lsm6dsxx_params->i2c);
printf("Initializing LSM6DSXX sensor at I2C_%i...\n ", lsm6dsxx_params->i2c);

if (lsm6dsxx_init(&dev, lsm6dsxx_params) != LSM6DSXX_OK) {
printf("Error: %i not equal to %i\n",lsm6dsxx_params->i2c,lsm6dsxx_init(&dev, lsm6dsxx_params));
puts("[ERROR]");

Check failure on line 22 in tests/drivers/lsm6dsxx/main.c

View workflow job for this annotation

GitHub Actions / static-tests

trailing whitespace.
return 1;
Expand Down

0 comments on commit 7d7894a

Please sign in to comment.