sensors/bh1749nuc: configure I2C frequency
This commit is contained in:
parent
147b5762f0
commit
c9bf7a841e
|
@ -143,6 +143,10 @@ config SENSORS_BH1749NUC
|
||||||
|
|
||||||
if SENSORS_BH1749NUC
|
if SENSORS_BH1749NUC
|
||||||
|
|
||||||
|
config BH1749NUC_I2C_FREQUENCY
|
||||||
|
int "BH1749NUC I2C frequency"
|
||||||
|
default 400000
|
||||||
|
|
||||||
config SENSORS_BH1749NUC_UORB
|
config SENSORS_BH1749NUC_UORB
|
||||||
bool "BH1749NUC UORB Interface"
|
bool "BH1749NUC UORB Interface"
|
||||||
default n
|
default n
|
||||||
|
|
|
@ -203,7 +203,7 @@ int bh1749nuc_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
|
||||||
|
|
||||||
priv->i2c = i2c;
|
priv->i2c = i2c;
|
||||||
priv->addr = addr;
|
priv->addr = addr;
|
||||||
priv->freq = BH1749NUC_I2C_FREQ;
|
priv->freq = CONFIG_BH1749NUC_I2C_FREQUENCY;
|
||||||
|
|
||||||
/* Check Device ID */
|
/* Check Device ID */
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,6 @@
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define BH1749NUC_I2C_FREQ 400000
|
|
||||||
|
|
||||||
#define BH1749NUC_MANUFACTID 0xE0 /* Manufact ID */
|
#define BH1749NUC_MANUFACTID 0xE0 /* Manufact ID */
|
||||||
#define BH1749NUC_PARTID 0x0D /* Part ID */
|
#define BH1749NUC_PARTID 0x0D /* Part ID */
|
||||||
|
|
||||||
|
|
|
@ -450,7 +450,7 @@ int bh1749nuc_register_uorb(int devno, FAR struct bh1749nuc_config_s *config)
|
||||||
|
|
||||||
dev->dev.i2c = config->i2c;
|
dev->dev.i2c = config->i2c;
|
||||||
dev->dev.addr = config->addr;
|
dev->dev.addr = config->addr;
|
||||||
dev->dev.freq = BH1749NUC_I2C_FREQ;
|
dev->dev.freq = CONFIG_BH1749NUC_I2C_FREQUENCY;
|
||||||
|
|
||||||
/* Check Device ID */
|
/* Check Device ID */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue