Skip to content

Commit

Permalink
fixed naming
Browse files Browse the repository at this point in the history
  • Loading branch information
caiodasilva2005 committed Oct 27, 2024
1 parent db07c79 commit eee3b4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions general/include/lsm6dso.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ HAL_StatusTypeDef lsm6dso_init(lsm6dso_t *imu, I2C_HandleTypeDef *i2c_handle);
* @param reg
* @return 0 if HAL_OK, 1 if HAL_ERROR
*/
uint8_t read_reg(uint8_t *data, uint8_t reg);
uint8_t lsm6dso_read(uint8_t *data, uint8_t reg);

/**
* @brief reads multiple LSM6DSO memory registers
Expand All @@ -110,7 +110,7 @@ uint8_t read_reg(uint8_t *data, uint8_t reg);
* @param length
* @return 0 if HAL_OK, 1 if HAL_ERROR
*/
uint8_t read_mult_reg(uint8_t *data, uint8_t reg, uint8_t length);
uint8_t lsm6dso_read_mult(uint8_t *data, uint8_t reg, uint8_t length);

/**
* @brief wrties to LSM6DSO memory register
Expand All @@ -119,7 +119,7 @@ uint8_t read_mult_reg(uint8_t *data, uint8_t reg, uint8_t length);
* @param reg
* @return 0 if HAL_OK, 1 if HAL_ERROR
*/
uint8_t write_reg(uint8_t *data, uint8_t reg);
uint8_t lsm6dso_write(uint8_t *data, uint8_t reg);

/* IMU Setting Configuration */
/**
Expand Down
14 changes: 7 additions & 7 deletions general/src/lsm6dso.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ static inline HAL_StatusTypeDef lsm6dso_read_mult_reg(lsm6dso_t *imu,
static inline HAL_StatusTypeDef lsm6dso_write_reg(lsm6dso_t *imu, uint8_t reg,
uint8_t *data)
{
return (imu->i2c_handle, LSM6DSO_I2C_ADDRESS, reg, I2C_MEMADD_SIZE_8BIT,
return HAL_I2C_Mem_Write(imu->i2c_handle, LSM6DSO_I2C_ADDRESS, reg, I2C_MEMADD_SIZE_8BIT,
data, 1, HAL_MAX_DELAY);
}

uint8_t read_reg(uint8_t *data, uint8_t reg)
uint8_t lsm6dso_read(uint8_t *data, uint8_t reg)
{
return hal_lsm6dso_read_reg(imu, data, reg);
return lsm6dso_read_reg(imu, data, reg);
}

uint8_t read_mult_reg(uint8_t *data, uint8_t reg, uint8_t length)
uint8_t lsm6dso_read_mult(uint8_t *data, uint8_t reg, uint8_t length)
{
return hal_lsm6dso_read_mult_reg(imu, data, reg, length);
return lsm6dso_read_mult_reg(imu, data, reg, length);
}

uint8_t write_reg(uint8_t *data, uint8_t reg)
uint8_t lsm6dso_write(uint8_t *data, uint8_t reg)
{
return hal_lsm6dso_write_reg(imu, data, reg);
return lsm6dso_write_reg(imu, reg, data);
}

static int16_t accel_data_convert(int16_t raw_accel)
Expand Down

0 comments on commit eee3b4a

Please sign in to comment.