diff --git a/configs/stm32f4discovery/src/Makefile b/configs/stm32f4discovery/src/Makefile index d7154251b3d..601d3f3e5fa 100644 --- a/configs/stm32f4discovery/src/Makefile +++ b/configs/stm32f4discovery/src/Makefile @@ -60,11 +60,11 @@ ifeq ($(CONFIG_STM32_OTGFS),y) CSRCS += stm32_usb.c endif -ifeq ($(CONFIG_BH1750FVI),y) +ifeq ($(CONFIG_SENSORS_BH1750FVI),y) CSRCS += stm32_bh1750fvi.c endif -ifeq ($(CONFIG_BMP180),y) +ifeq ($(CONFIG_SENSORS_BMP180),y) CSRCS += stm32_bmp180.c endif diff --git a/configs/stm32f4discovery/src/stm32_appinit.c b/configs/stm32f4discovery/src/stm32_appinit.c index 9382ffab67b..3b6446a3fed 100644 --- a/configs/stm32f4discovery/src/stm32_appinit.c +++ b/configs/stm32f4discovery/src/stm32_appinit.c @@ -82,7 +82,7 @@ int board_app_initialize(uintptr_t arg) { -#ifdef CONFIG_BMP180 +#ifdef CONFIG_SENSORS_BMP180 stm32_bmp180initialize("/dev/press0"); #endif diff --git a/configs/stm32f4discovery/src/stm32_bh1750fvi.c b/configs/stm32f4discovery/src/stm32_bh1750fvi.c index be896409644..8ac3fe68467 100644 --- a/configs/stm32f4discovery/src/stm32_bh1750fvi.c +++ b/configs/stm32f4discovery/src/stm32_bh1750fvi.c @@ -49,7 +49,7 @@ #include "stm32_i2c.h" #include "stm32f4discovery.h" -#if defined(CONFIG_I2C) && defined(CONFIG_BH1750FVI) +#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BH1750FVI) /************************************************************************************ * Pre-processor Definitions @@ -102,4 +102,4 @@ int stm32_bh1750initialize(FAR const char *devpath) return ret; } -#endif /* CONFIG_I2C && CONFIG_BH1750FVI && CONFIG_STM32_I2C1 */ +#endif /* CONFIG_I2C && CONFIG_SENSORS_BH1750FVI && CONFIG_STM32_I2C1 */ diff --git a/configs/stm32f4discovery/src/stm32_bmp180.c b/configs/stm32f4discovery/src/stm32_bmp180.c index bd90a808f77..f66ccbb5a76 100644 --- a/configs/stm32f4discovery/src/stm32_bmp180.c +++ b/configs/stm32f4discovery/src/stm32_bmp180.c @@ -49,7 +49,7 @@ #include "stm32_i2c.h" #include "stm32f4discovery.h" -#if defined(CONFIG_I2C) && defined(CONFIG_BMP180) +#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180) /************************************************************************************ * Pre-processor Definitions diff --git a/configs/stm32f4discovery/src/stm32_bringup.c b/configs/stm32f4discovery/src/stm32_bringup.c index ba7fe283415..c6a22313b01 100644 --- a/configs/stm32f4discovery/src/stm32_bringup.c +++ b/configs/stm32f4discovery/src/stm32_bringup.c @@ -106,7 +106,7 @@ int stm32_bringup(void) #endif int ret = OK; -#ifdef CONFIG_BH1750FVI +#ifdef CONFIG_SENSORS_BH1750FVI stm32_bh1750initialize("/dev/light0"); #endif diff --git a/configs/stm32f4discovery/src/stm32f4discovery.h b/configs/stm32f4discovery/src/stm32f4discovery.h index eaeed154482..c3be6d5cf58 100644 --- a/configs/stm32f4discovery/src/stm32f4discovery.h +++ b/configs/stm32f4discovery/src/stm32f4discovery.h @@ -412,7 +412,7 @@ void weak_function stm32_spidev_initialize(void); * ****************************************************************************/ -#ifdef CONFIG_BH1750FVI +#ifdef CONFIG_SENSORS_BH1750FVI int stm32_bh1750initialize(FAR const char *devpath); #endif @@ -425,7 +425,7 @@ int stm32_bh1750initialize(FAR const char *devpath); * ****************************************************************************/ -#ifdef CONFIG_BMP180 +#ifdef CONFIG_SENSORS_BMP180 int stm32_bmp180initialize(FAR const char *devpath); #endif diff --git a/drivers/sensors/Kconfig b/drivers/sensors/Kconfig index 4fdfa0893de..f049e3aabb5 100644 --- a/drivers/sensors/Kconfig +++ b/drivers/sensors/Kconfig @@ -3,7 +3,7 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config AS5048B +config SENSORS_AS5048B bool "AMS AS5048B Magnetic Rotary Encoder support" default n select I2C @@ -11,21 +11,26 @@ config AS5048B ---help--- Enable driver support for the AMS AS5048B magnetic rotary encoder. -config BH1750FVI +config SENSORS_BH1750FVI bool "Rohm BH1750FVI Ambient Light Sensor support" default n select I2C ---help--- Enable driver support for the Rohm BH1750FVI light sensor. -config BMG160 +config BH1750FVI_I2C_FREQUENCY + int "BH1750FVI I2C frequency" + default 400000 + depends on SENSORS_BH1750FVI + +config SENSORS_BMG160 bool "Bosch BMG160 Gyroscope Sensor support" default n select SPI ---help--- Enable driver support for the Bosch BMG160 gyroscope sensor. -config BMP180 +config SENSORS_BMP180 bool "Bosch BMP180 Barometer Sensor support" default n select I2C diff --git a/drivers/sensors/Make.defs b/drivers/sensors/Make.defs index 8e94ef9d763..d9247934ddf 100644 --- a/drivers/sensors/Make.defs +++ b/drivers/sensors/Make.defs @@ -49,7 +49,7 @@ endif ifeq ($(CONFIG_I2C),y) -ifeq ($(CONFIG_AS5048B),y) +ifeq ($(CONFIG_SENSORS_AS5048B),y) CSRCS += as5048b.c endif @@ -77,15 +77,15 @@ ifeq ($(CONFIG_ADXL345_I2C),y) CSRCS += adxl345_i2c.c endif -ifeq ($(CONFIG_BH1750FVI),y) +ifeq ($(CONFIG_SENSORS_BH1750FVI),y) CSRCS += bh1750fvi.c endif -ifeq ($(CONFIG_BMG160),y) +ifeq ($(CONFIG_SENSORS_BMG160),y) CSRCS += bmg160.c endif -ifeq ($(CONFIG_BMP180),y) +ifeq ($(CONFIG_SENSORS_BMP180),y) CSRCS += bmp180.c endif diff --git a/drivers/sensors/as5048b.c b/drivers/sensors/as5048b.c index 1de47ea3230..a0cc34ee3c3 100644 --- a/drivers/sensors/as5048b.c +++ b/drivers/sensors/as5048b.c @@ -52,7 +52,7 @@ #include #include -#if defined(CONFIG_I2C) && defined(CONFIG_QENCODER) && defined(CONFIG_AS5048B) +#if defined(CONFIG_I2C) && defined(CONFIG_QENCODER) && defined(CONFIG_SENSORS_AS5048B) /**************************************************************************** * Private Types @@ -619,4 +619,4 @@ FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c, return &priv->lower; } -#endif /* CONFIG_I2C && CONFIG_QENCODER && CONFIG_AS5048B */ +#endif /* CONFIG_I2C && CONFIG_QENCODER && CONFIG_SENSORS_AS5048B */ diff --git a/drivers/sensors/bh1750fvi.c b/drivers/sensors/bh1750fvi.c index c0c2d38de01..2f90470bcc4 100644 --- a/drivers/sensors/bh1750fvi.c +++ b/drivers/sensors/bh1750fvi.c @@ -53,7 +53,7 @@ #include #include -#if defined(CONFIG_I2C) && defined(CONFIG_BH1750FVI) +#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BH1750FVI) /**************************************************************************** * Pre-process Definitions @@ -459,4 +459,4 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, return ret; } -#endif /* CONFIG_I2C && CONFIG_BH1750FVI */ +#endif /* CONFIG_I2C && CONFIG_SENSORS_BH1750FVI */ diff --git a/drivers/sensors/bmg160.c b/drivers/sensors/bmg160.c index 534985d133a..a8d95094ad9 100644 --- a/drivers/sensors/bmg160.c +++ b/drivers/sensors/bmg160.c @@ -53,7 +53,7 @@ #include #include -#if defined(CONFIG_SPI) && defined(CONFIG_BMG160) +#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_BMG160) /**************************************************************************** * Private @@ -597,4 +597,4 @@ int bmg160_register(FAR const char *devpath, FAR struct spi_dev_s *spi, return OK; } -#endif /* CONFIG_SPI && CONFIG_BMG160 */ +#endif /* CONFIG_SPI && CONFIG_SENSORS_BMG160 */ diff --git a/drivers/sensors/bmp180.c b/drivers/sensors/bmp180.c index a0857d8e575..e3301979572 100644 --- a/drivers/sensors/bmp180.c +++ b/drivers/sensors/bmp180.c @@ -55,7 +55,7 @@ #include #include -#if defined(CONFIG_I2C) && defined(CONFIG_BMP180) +#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180) /**************************************************************************** * Pre-processor Definitions @@ -642,4 +642,4 @@ int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c) return ret; } -#endif /* CONFIG_I2C && CONFIG_BMP180 */ +#endif /* CONFIG_I2C && CONFIG_SENSORS_BMP180 */ diff --git a/include/nuttx/sensors/as5048b.h b/include/nuttx/sensors/as5048b.h index f348b88d9b9..79d8244a60f 100644 --- a/include/nuttx/sensors/as5048b.h +++ b/include/nuttx/sensors/as5048b.h @@ -43,7 +43,7 @@ #include #include -#if defined(CONFIG_I2C) && defined(CONFIG_QENCODER) && defined(CONFIG_AS5048B) +#if defined(CONFIG_I2C) && defined(CONFIG_QENCODER) && defined(CONFIG_SENSORS_AS5048B) /**************************************************************************** * Pre-processor Definitions @@ -53,7 +53,7 @@ * * CONFIG_I2C * Enables support for I2C drivers - * CONFIG_AS5048B + * CONFIG_SENSORS_AS5048B * Enables support for the AS5048B driver */ @@ -137,5 +137,5 @@ FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c, } #endif -#endif /* CONFIG_I2C && CONFIG_QENCODER && CONFIG_AS5048B */ +#endif /* CONFIG_I2C && CONFIG_QENCODER && CONFIG_SENSORS_AS5048B */ #endif /* __INCLUDE_NUTTX_SENSORS_AS5048B */ diff --git a/include/nuttx/sensors/bh1750fvi.h b/include/nuttx/sensors/bh1750fvi.h index d7722ea209a..5cfe86d74cc 100644 --- a/include/nuttx/sensors/bh1750fvi.h +++ b/include/nuttx/sensors/bh1750fvi.h @@ -45,7 +45,7 @@ #include #include -#if defined(CONFIG_BH1750FVI) +#if defined(CONFIG_SENSORS_BH1750FVI) /**************************************************************************** * Pre-processor Definitions @@ -110,5 +110,5 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, } #endif -#endif /* CONFIG_BH1750FVI */ +#endif /* CONFIG_SENSORS_BH1750FVI */ #endif /* __INCLUDE_NUTTX_SENSORS_BH1750FVI_H */ diff --git a/include/nuttx/sensors/bmg160.h b/include/nuttx/sensors/bmg160.h index a34c9e3ba0f..09972478a09 100644 --- a/include/nuttx/sensors/bmg160.h +++ b/include/nuttx/sensors/bmg160.h @@ -46,7 +46,7 @@ #include #include -#if defined(CONFIG_SPI) && defined(CONFIG_BMG160) +#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_BMG160) /******************************************************************************************** * Pre-processor Definitions @@ -436,5 +436,5 @@ int bmg160_register(FAR const char *devpath, FAR struct spi_dev_s *spi, } #endif -#endif /* CONFIG_SPI && CONFIG_BMG160 */ +#endif /* CONFIG_SPI && CONFIG_SENSORS_BMG160 */ #endif /* __INCLUDE_NUTTX_SENSORS_BMG160_H */ diff --git a/include/nuttx/sensors/bmp180.h b/include/nuttx/sensors/bmp180.h index 5bdb86fe212..2449219a647 100644 --- a/include/nuttx/sensors/bmp180.h +++ b/include/nuttx/sensors/bmp180.h @@ -38,7 +38,7 @@ #include -#if defined(CONFIG_I2C) && defined(CONFIG_BMP180) +#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180) /******************************************************************************************** * Pre-processor Definitions @@ -49,10 +49,8 @@ /* Configuration ****************************************************************************/ /* Prerequisites: * - * CONFIG_BMP180 + * CONFIG_SENSORS_BMP180 * Enables support for the BMP180 driver - * CONFIG_BMP180_REGDEBUG - * Enable very low register-level debug output. Requires CONFIG_DEBUG_FEATURES. */ /**************************************************************************** @@ -96,5 +94,5 @@ int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c); } #endif -#endif /* CONFIG_I2C && CONFIG_BMP180 */ +#endif /* CONFIG_I2C && CONFIG_SENSORS_BMP180 */ #endif /* __INCLUDE_NUTTX_SENSORS_BMP180_H */