Skip to content

Commit

Permalink
changed function names
Browse files Browse the repository at this point in the history
  • Loading branch information
caiodasilva2005 committed Oct 27, 2024
1 parent 455c440 commit db07c79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions general/include/lsm6dso.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 */
/**
Expand Down
22 changes: 11 additions & 11 deletions general/src/lsm6dso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit db07c79

Please sign in to comment.