diff --git a/drivers/sensors/Kconfig b/drivers/sensors/Kconfig index 195367a084..71f08706a1 100644 --- a/drivers/sensors/Kconfig +++ b/drivers/sensors/Kconfig @@ -143,6 +143,10 @@ config SENSORS_BH1749NUC if SENSORS_BH1749NUC +config BH1749NUC_I2C_FREQUENCY + int "BH1749NUC I2C frequency" + default 400000 + config SENSORS_BH1749NUC_UORB bool "BH1749NUC UORB Interface" default n diff --git a/drivers/sensors/bh1749nuc.c b/drivers/sensors/bh1749nuc.c index 8e5940b4da..d9405fb1d8 100644 --- a/drivers/sensors/bh1749nuc.c +++ b/drivers/sensors/bh1749nuc.c @@ -203,7 +203,7 @@ int bh1749nuc_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, priv->i2c = i2c; priv->addr = addr; - priv->freq = BH1749NUC_I2C_FREQ; + priv->freq = CONFIG_BH1749NUC_I2C_FREQUENCY; /* Check Device ID */ diff --git a/drivers/sensors/bh1749nuc_base.h b/drivers/sensors/bh1749nuc_base.h index 0292538275..838ceff125 100644 --- a/drivers/sensors/bh1749nuc_base.h +++ b/drivers/sensors/bh1749nuc_base.h @@ -41,8 +41,6 @@ * Pre-processor Definitions ****************************************************************************/ -#define BH1749NUC_I2C_FREQ 400000 - #define BH1749NUC_MANUFACTID 0xE0 /* Manufact ID */ #define BH1749NUC_PARTID 0x0D /* Part ID */ diff --git a/drivers/sensors/bh1749nuc_uorb.c b/drivers/sensors/bh1749nuc_uorb.c index 1e9b1e1ea1..53f3debb84 100644 --- a/drivers/sensors/bh1749nuc_uorb.c +++ b/drivers/sensors/bh1749nuc_uorb.c @@ -450,7 +450,7 @@ int bh1749nuc_register_uorb(int devno, FAR struct bh1749nuc_config_s *config) dev->dev.i2c = config->i2c; dev->dev.addr = config->addr; - dev->dev.freq = BH1749NUC_I2C_FREQ; + dev->dev.freq = CONFIG_BH1749NUC_I2C_FREQUENCY; /* Check Device ID */