mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
drivrs/sensors: Make a few other configuration settings consistent with the (undocumented) standard.
This commit is contained in:
@@ -60,11 +60,11 @@ ifeq ($(CONFIG_STM32_OTGFS),y)
|
|||||||
CSRCS += stm32_usb.c
|
CSRCS += stm32_usb.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_BH1750FVI),y)
|
ifeq ($(CONFIG_SENSORS_BH1750FVI),y)
|
||||||
CSRCS += stm32_bh1750fvi.c
|
CSRCS += stm32_bh1750fvi.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_BMP180),y)
|
ifeq ($(CONFIG_SENSORS_BMP180),y)
|
||||||
CSRCS += stm32_bmp180.c
|
CSRCS += stm32_bmp180.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
int board_app_initialize(uintptr_t arg)
|
int board_app_initialize(uintptr_t arg)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_BMP180
|
#ifdef CONFIG_SENSORS_BMP180
|
||||||
stm32_bmp180initialize("/dev/press0");
|
stm32_bmp180initialize("/dev/press0");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
#include "stm32_i2c.h"
|
#include "stm32_i2c.h"
|
||||||
#include "stm32f4discovery.h"
|
#include "stm32f4discovery.h"
|
||||||
|
|
||||||
#if defined(CONFIG_I2C) && defined(CONFIG_BH1750FVI)
|
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BH1750FVI)
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -102,4 +102,4 @@ int stm32_bh1750initialize(FAR const char *devpath)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_I2C && CONFIG_BH1750FVI && CONFIG_STM32_I2C1 */
|
#endif /* CONFIG_I2C && CONFIG_SENSORS_BH1750FVI && CONFIG_STM32_I2C1 */
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
#include "stm32_i2c.h"
|
#include "stm32_i2c.h"
|
||||||
#include "stm32f4discovery.h"
|
#include "stm32f4discovery.h"
|
||||||
|
|
||||||
#if defined(CONFIG_I2C) && defined(CONFIG_BMP180)
|
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180)
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ int stm32_bringup(void)
|
|||||||
#endif
|
#endif
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
#ifdef CONFIG_BH1750FVI
|
#ifdef CONFIG_SENSORS_BH1750FVI
|
||||||
stm32_bh1750initialize("/dev/light0");
|
stm32_bh1750initialize("/dev/light0");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
int stm32_bh1750initialize(FAR const char *devpath);
|
||||||
#endif
|
#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);
|
int stm32_bmp180initialize(FAR const char *devpath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||||
#
|
#
|
||||||
|
|
||||||
config AS5048B
|
config SENSORS_AS5048B
|
||||||
bool "AMS AS5048B Magnetic Rotary Encoder support"
|
bool "AMS AS5048B Magnetic Rotary Encoder support"
|
||||||
default n
|
default n
|
||||||
select I2C
|
select I2C
|
||||||
@@ -11,21 +11,26 @@ config AS5048B
|
|||||||
---help---
|
---help---
|
||||||
Enable driver support for the AMS AS5048B magnetic rotary encoder.
|
Enable driver support for the AMS AS5048B magnetic rotary encoder.
|
||||||
|
|
||||||
config BH1750FVI
|
config SENSORS_BH1750FVI
|
||||||
bool "Rohm BH1750FVI Ambient Light Sensor support"
|
bool "Rohm BH1750FVI Ambient Light Sensor support"
|
||||||
default n
|
default n
|
||||||
select I2C
|
select I2C
|
||||||
---help---
|
---help---
|
||||||
Enable driver support for the Rohm BH1750FVI light sensor.
|
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"
|
bool "Bosch BMG160 Gyroscope Sensor support"
|
||||||
default n
|
default n
|
||||||
select SPI
|
select SPI
|
||||||
---help---
|
---help---
|
||||||
Enable driver support for the Bosch BMG160 gyroscope sensor.
|
Enable driver support for the Bosch BMG160 gyroscope sensor.
|
||||||
|
|
||||||
config BMP180
|
config SENSORS_BMP180
|
||||||
bool "Bosch BMP180 Barometer Sensor support"
|
bool "Bosch BMP180 Barometer Sensor support"
|
||||||
default n
|
default n
|
||||||
select I2C
|
select I2C
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ endif
|
|||||||
|
|
||||||
ifeq ($(CONFIG_I2C),y)
|
ifeq ($(CONFIG_I2C),y)
|
||||||
|
|
||||||
ifeq ($(CONFIG_AS5048B),y)
|
ifeq ($(CONFIG_SENSORS_AS5048B),y)
|
||||||
CSRCS += as5048b.c
|
CSRCS += as5048b.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -77,15 +77,15 @@ ifeq ($(CONFIG_ADXL345_I2C),y)
|
|||||||
CSRCS += adxl345_i2c.c
|
CSRCS += adxl345_i2c.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_BH1750FVI),y)
|
ifeq ($(CONFIG_SENSORS_BH1750FVI),y)
|
||||||
CSRCS += bh1750fvi.c
|
CSRCS += bh1750fvi.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_BMG160),y)
|
ifeq ($(CONFIG_SENSORS_BMG160),y)
|
||||||
CSRCS += bmg160.c
|
CSRCS += bmg160.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_BMP180),y)
|
ifeq ($(CONFIG_SENSORS_BMP180),y)
|
||||||
CSRCS += bmp180.c
|
CSRCS += bmp180.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
#include <nuttx/i2c/i2c_master.h>
|
#include <nuttx/i2c/i2c_master.h>
|
||||||
#include <nuttx/sensors/as5048b.h>
|
#include <nuttx/sensors/as5048b.h>
|
||||||
|
|
||||||
#if defined(CONFIG_I2C) && defined(CONFIG_QENCODER) && defined(CONFIG_AS5048B)
|
#if defined(CONFIG_I2C) && defined(CONFIG_QENCODER) && defined(CONFIG_SENSORS_AS5048B)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
@@ -619,4 +619,4 @@ FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c,
|
|||||||
return &priv->lower;
|
return &priv->lower;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_I2C && CONFIG_QENCODER && CONFIG_AS5048B */
|
#endif /* CONFIG_I2C && CONFIG_QENCODER && CONFIG_SENSORS_AS5048B */
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#include <nuttx/sensors/bh1750fvi.h>
|
#include <nuttx/sensors/bh1750fvi.h>
|
||||||
#include <nuttx/random.h>
|
#include <nuttx/random.h>
|
||||||
|
|
||||||
#if defined(CONFIG_I2C) && defined(CONFIG_BH1750FVI)
|
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BH1750FVI)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-process Definitions
|
* Pre-process Definitions
|
||||||
@@ -459,4 +459,4 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_I2C && CONFIG_BH1750FVI */
|
#endif /* CONFIG_I2C && CONFIG_SENSORS_BH1750FVI */
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#include <nuttx/sensors/bmg160.h>
|
#include <nuttx/sensors/bmg160.h>
|
||||||
#include <nuttx/random.h>
|
#include <nuttx/random.h>
|
||||||
|
|
||||||
#if defined(CONFIG_SPI) && defined(CONFIG_BMG160)
|
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_BMG160)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private
|
* Private
|
||||||
@@ -597,4 +597,4 @@ int bmg160_register(FAR const char *devpath, FAR struct spi_dev_s *spi,
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_SPI && CONFIG_BMG160 */
|
#endif /* CONFIG_SPI && CONFIG_SENSORS_BMG160 */
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
#include <nuttx/sensors/bmp180.h>
|
#include <nuttx/sensors/bmp180.h>
|
||||||
#include <nuttx/random.h>
|
#include <nuttx/random.h>
|
||||||
|
|
||||||
#if defined(CONFIG_I2C) && defined(CONFIG_BMP180)
|
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -642,4 +642,4 @@ int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_I2C && CONFIG_BMP180 */
|
#endif /* CONFIG_I2C && CONFIG_SENSORS_BMP180 */
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <nuttx/sensors/qencoder.h>
|
#include <nuttx/sensors/qencoder.h>
|
||||||
|
|
||||||
#if defined(CONFIG_I2C) && defined(CONFIG_QENCODER) && defined(CONFIG_AS5048B)
|
#if defined(CONFIG_I2C) && defined(CONFIG_QENCODER) && defined(CONFIG_SENSORS_AS5048B)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
*
|
*
|
||||||
* CONFIG_I2C
|
* CONFIG_I2C
|
||||||
* Enables support for I2C drivers
|
* Enables support for I2C drivers
|
||||||
* CONFIG_AS5048B
|
* CONFIG_SENSORS_AS5048B
|
||||||
* Enables support for the AS5048B driver
|
* 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
|
||||||
|
|
||||||
#endif /* CONFIG_I2C && CONFIG_QENCODER && CONFIG_AS5048B */
|
#endif /* CONFIG_I2C && CONFIG_QENCODER && CONFIG_SENSORS_AS5048B */
|
||||||
#endif /* __INCLUDE_NUTTX_SENSORS_AS5048B */
|
#endif /* __INCLUDE_NUTTX_SENSORS_AS5048B */
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
#include <nuttx/irq.h>
|
#include <nuttx/irq.h>
|
||||||
#include <nuttx/sensors/ioctl.h>
|
#include <nuttx/sensors/ioctl.h>
|
||||||
|
|
||||||
#if defined(CONFIG_BH1750FVI)
|
#if defined(CONFIG_SENSORS_BH1750FVI)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -110,5 +110,5 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_BH1750FVI */
|
#endif /* CONFIG_SENSORS_BH1750FVI */
|
||||||
#endif /* __INCLUDE_NUTTX_SENSORS_BH1750FVI_H */
|
#endif /* __INCLUDE_NUTTX_SENSORS_BH1750FVI_H */
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
#include <nuttx/fs/ioctl.h>
|
#include <nuttx/fs/ioctl.h>
|
||||||
#include <nuttx/spi/spi.h>
|
#include <nuttx/spi/spi.h>
|
||||||
|
|
||||||
#if defined(CONFIG_SPI) && defined(CONFIG_BMG160)
|
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_BMG160)
|
||||||
|
|
||||||
/********************************************************************************************
|
/********************************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -436,5 +436,5 @@ int bmg160_register(FAR const char *devpath, FAR struct spi_dev_s *spi,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_SPI && CONFIG_BMG160 */
|
#endif /* CONFIG_SPI && CONFIG_SENSORS_BMG160 */
|
||||||
#endif /* __INCLUDE_NUTTX_SENSORS_BMG160_H */
|
#endif /* __INCLUDE_NUTTX_SENSORS_BMG160_H */
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#if defined(CONFIG_I2C) && defined(CONFIG_BMP180)
|
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180)
|
||||||
|
|
||||||
/********************************************************************************************
|
/********************************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -49,10 +49,8 @@
|
|||||||
/* Configuration ****************************************************************************/
|
/* Configuration ****************************************************************************/
|
||||||
/* Prerequisites:
|
/* Prerequisites:
|
||||||
*
|
*
|
||||||
* CONFIG_BMP180
|
* CONFIG_SENSORS_BMP180
|
||||||
* Enables support for the BMP180 driver
|
* 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
|
||||||
|
|
||||||
#endif /* CONFIG_I2C && CONFIG_BMP180 */
|
#endif /* CONFIG_I2C && CONFIG_SENSORS_BMP180 */
|
||||||
#endif /* __INCLUDE_NUTTX_SENSORS_BMP180_H */
|
#endif /* __INCLUDE_NUTTX_SENSORS_BMP180_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user