diff --git a/general/include/lsm6dso.h b/general/include/lsm6dso.h index 4725017..38ff23a 100644 --- a/general/include/lsm6dso.h +++ b/general/include/lsm6dso.h @@ -76,11 +76,11 @@ typedef struct { int16_t gyro_data[3]; - I2C_Read_Reg lsm6dso_read_reg; + I2C_Read_Reg read_reg; - I2C_Read_Mult_Reg lsm6dso_read_mult_reg; + I2C_Read_Mult_Reg read_mult_reg; - I2C_Write_Reg lsm6dso_write_reg; + I2C_Write_Reg write_reg; } lsm6dso_t; @@ -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 lsm6dso_read_reg(uint8_t *data, uint8_t reg); +uint8_t read_reg(uint8_t *data, uint8_t reg); /** * @brief reads multiple LSM6DSO memory registers @@ -110,7 +110,7 @@ uint8_t lsm6dso_read_reg(uint8_t *data, uint8_t reg); * @param length * @return 0 if HAL_OK, 1 if HAL_ERROR */ -uint8_t lsm6dso_read_mult_reg(uint8_t *data, uint8_t reg, uint8_t length); +uint8_t read_mult_reg(uint8_t *data, uint8_t reg, uint8_t length); /** * @brief wrties to LSM6DSO memory register @@ -119,7 +119,7 @@ uint8_t lsm6dso_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 lsm6dso_write_reg(uint8_t *data, uint8_t reg); +uint8_t write_reg(uint8_t *data, uint8_t reg); /* IMU Setting Configuration */ /** diff --git a/general/src/lsm6dso.c b/general/src/lsm6dso.c index dacf89b..80ef5d0 100644 --- a/general/src/lsm6dso.c +++ b/general/src/lsm6dso.c @@ -15,41 +15,41 @@ lsm6dso_t *imu; -static inline HAL_StatusTypeDef hal_lsm6dso_read_reg(lsm6dso_t *imu, - uint8_t *data, uint8_t reg) +static inline HAL_StatusTypeDef lsm6dso_read_reg(lsm6dso_t *imu, uint8_t *data, + uint8_t reg) { return HAL_I2C_Mem_Read(imu->i2c_handle, LSM6DSO_I2C_ADDRESS, reg, I2C_MEMADD_SIZE_8BIT, data, 1, HAL_MAX_DELAY); } -static inline HAL_StatusTypeDef hal_lsm6dso_read_mult_reg(lsm6dso_t *imu, - uint8_t *data, - uint8_t reg, - uint8_t length) +static inline HAL_StatusTypeDef lsm6dso_read_mult_reg(lsm6dso_t *imu, + uint8_t *data, + uint8_t reg, + uint8_t length) { return HAL_I2C_Mem_Read(imu->i2c_handle, LSM6DSO_I2C_ADDRESS, reg, I2C_MEMADD_SIZE_8BIT, data, length, HAL_MAX_DELAY); } -static inline HAL_StatusTypeDef -hal_lsm6dso_write_reg(lsm6dso_t *imu, uint8_t reg, uint8_t *data) +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, data, 1, HAL_MAX_DELAY); } -uint8_t lsm6dso_read_reg(uint8_t *data, uint8_t reg) +uint8_t read_reg(uint8_t *data, uint8_t reg) { return hal_lsm6dso_read_reg(imu, data, reg); } -uint8_t lsm6dso_read_mult_reg(uint8_t *data, uint8_t reg, uint8_t length) +uint8_t read_mult_reg(uint8_t *data, uint8_t reg, uint8_t length) { return hal_lsm6dso_read_mult_reg(imu, data, reg, length); } -uint8_t lsm6dso_write_reg(uint8_t *data, uint8_t reg) +uint8_t write_reg(uint8_t *data, uint8_t reg) { return hal_lsm6dso_write_reg(imu, data, reg); }