fix as5048b by adding missing frequency parameter

This commit is contained in:
ahb 2017-03-09 12:01:01 +01:00
parent f50072bd6b
commit e1da80af5b
2 changed files with 4 additions and 2 deletions

View File

@ -63,6 +63,7 @@ struct as5048b_dev_s
struct qe_lowerhalf_s lower; /* AS5048B quadrature encoder lower half */
FAR struct i2c_master_s *i2c; /* I2C interface */
uint8_t addr; /* I2C address */
uint32_t frequency; /* I2C frequency */
};
/****************************************************************************
@ -595,7 +596,7 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd,
****************************************************************************/
FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c,
uint8_t addr)
uint8_t addr, uint32_t frequency)
{
FAR struct as5048b_dev_s *priv;
@ -613,6 +614,7 @@ FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c,
priv->lower.ops = &g_qeops;
priv->i2c = i2c;
priv->addr = addr;
priv->frequency = frequency;
return &priv->lower;
}

View File

@ -130,7 +130,7 @@ extern "C"
****************************************************************************/
FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c,
uint8_t addr);
uint8_t addr, uint32_t frequency);
#undef EXTERN
#ifdef __cplusplus