Skip to content

Commit

Permalink
removed i2c handle
Browse files Browse the repository at this point in the history
  • Loading branch information
caiodasilva2005 committed Oct 27, 2024
1 parent 172529a commit 2d4813d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions general/include/lsm6dso.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ enum lsm6dso_axes {
*
*/
typedef struct {
I2C_HandleTypeDef *i2c_handle;

uint8_t accel_config; // TODO: We should make these cfg packed unions with
// bitfield structs

Expand All @@ -83,11 +81,9 @@ typedef struct {
/**
* @brief Initializes the LSM6DSO IMU
*
* @param i2c_handle
* @return 0 if OK, other if ERROR
*/
int lsm6dso_init(I2C_HandleTypeDef *i2c_handle, I2C_Read read_func,
I2C_Write write_func);
int lsm6dso_init(I2C_Read read_func, I2C_Write write_func);

/* IMU Setting Configuration */
/**
Expand Down
5 changes: 1 addition & 4 deletions general/src/lsm6dso.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,10 @@ int lsm6dso_set_gyro_cfg(int8_t odr_sel, int8_t fs_sel, int8_t fs_125)
return lsm6dso_write_reg(&imu.gyro_config, LSM6DSO_REG_GYRO_CTRL);
}

int lsm6dso_init(I2C_HandleTypeDef *i2c_handle, I2C_Read read_func,
I2C_Write write_func)
int lsm6dso_init(I2C_Read read_func, I2C_Write write_func)
{
int status;

imu.i2c_handle = i2c_handle;

imu.accel_data[LSM6DSO_X_AXIS] = 0;
imu.accel_data[LSM6DSO_Y_AXIS] = 0;
imu.accel_data[LSM6DSO_Z_AXIS] = 0;
Expand Down

0 comments on commit 2d4813d

Please sign in to comment.