Skip to content

Commit

Permalink
Change names of IMU config functions (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyton-McKee authored Oct 25, 2023
1 parent fb6c67f commit fb86eda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions general/include/lsm6dso.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ HAL_StatusTypeDef lsm6dso_init(lsm6dso_t *imu, I2C_HandleTypeDef *i2c_handle);
* @param lp_f2_enable
* @return HAL_StatusTypeDef
*/
HAL_StatusTypeDef lsm6dso_accelerometer_config(lsm6dso_t *imu, int8_t odr_sel, int8_t fs_sel, int8_t lp_f2_enable);
HAL_StatusTypeDef lsm6dso_set_accel_cfg(lsm6dso_t *imu, int8_t odr_sel, int8_t fs_sel, int8_t lp_f2_enable);

/**
* @brief Configures the accelerometer of the LSM6DSO IMU
Expand All @@ -98,7 +98,7 @@ HAL_StatusTypeDef lsm6dso_accelerometer_config(lsm6dso_t *imu, int8_t odr_sel, i
* @param fs_125
* @return HAL_StatusTypeDef
*/
HAL_StatusTypeDef lsm6dso_gyroscope_config(lsm6dso_t *imu, int8_t odr_sel, int8_t fs_sel, int8_t fs_125);
HAL_StatusTypeDef lsm6dso_set_gyro_cfg(lsm6dso_t *imu, int8_t odr_sel, int8_t fs_sel, int8_t fs_125);

/* Data Aquisition */
/**
Expand Down
4 changes: 2 additions & 2 deletions general/src/lsm6dso.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ HAL_StatusTypeDef lsm6dso_set_accel_cfg(lsm6dso_t *imu, int8_t odr_sel, int8_t f
return lsm6dso_write_reg(imu, LSM6DSO_REG_ACCEL_CTRL, &imu->accel_config);
}

HAL_StatusTypeDef lsm6dso_gyro_cfg(lsm6dso_t *imu, int8_t odr_sel, int8_t fs_sel, int8_t fs_125)
HAL_StatusTypeDef lsm6dso_set_gyro_cfg(lsm6dso_t *imu, int8_t odr_sel, int8_t fs_sel, int8_t fs_125)
{
uint8_t config = (((odr_sel << 4) | (fs_sel << 2) | (fs_125 << 1)) << 1);
imu->gyro_config = config;
Expand Down Expand Up @@ -106,7 +106,7 @@ HAL_StatusTypeDef lsm6dso_init(lsm6dso_t *imu, I2C_HandleTypeDef *i2c_handle)
if (status != HAL_OK)
return status;

status = lsm6dso_gyro_cfg(imu, 0x08, 0x02, 0x00);
status = lsm6dso_set_gyro_cfg(imu, 0x08, 0x02, 0x00);
if (status != HAL_OK)
return status;

Expand Down

0 comments on commit fb86eda

Please sign in to comment.