From 2d4813dc34c5a44c5517ddf77ce8d571a798b317 Mon Sep 17 00:00:00 2001 From: Caio Date: Mon, 30 Sep 2024 13:15:46 -0400 Subject: [PATCH] removed i2c handle --- general/include/lsm6dso.h | 6 +----- general/src/lsm6dso.c | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/general/include/lsm6dso.h b/general/include/lsm6dso.h index 8ba9e47..0fa009f 100644 --- a/general/include/lsm6dso.h +++ b/general/include/lsm6dso.h @@ -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 @@ -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 */ /** diff --git a/general/src/lsm6dso.c b/general/src/lsm6dso.c index 0d0d048..ae11648 100644 --- a/general/src/lsm6dso.c +++ b/general/src/lsm6dso.c @@ -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;