sensors/bh1749nuc: configure I2C frequency

This commit is contained in:
raiden00pl 2024-05-01 18:55:46 +02:00 committed by Xiang Xiao
parent 147b5762f0
commit c9bf7a841e
4 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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 */

View File

@ -41,8 +41,6 @@
* Pre-processor Definitions
****************************************************************************/
#define BH1749NUC_I2C_FREQ 400000
#define BH1749NUC_MANUFACTID 0xE0 /* Manufact ID */
#define BH1749NUC_PARTID 0x0D /* Part ID */

View File

@ -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 */