diff --git a/drivers/sensors/as5048b.c b/drivers/sensors/as5048b.c index 9a213655d2..1de47ea323 100644 --- a/drivers/sensors/as5048b.c +++ b/drivers/sensors/as5048b.c @@ -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; } diff --git a/include/nuttx/sensors/as5048b.h b/include/nuttx/sensors/as5048b.h index 76ea307c23..f348b88d9b 100644 --- a/include/nuttx/sensors/as5048b.h +++ b/include/nuttx/sensors/as5048b.h @@ -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