diff --git a/boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c b/boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c index ff632b4754..400a6960ac 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c @@ -31,6 +31,7 @@ #include #include +#include #include #include "cxd56_i2c.h" diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_bmp280.h b/boards/arm/cxd56xx/spresense/include/cxd56_bmp280.h index 79ba9ce287..2e2d04d17a 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_bmp280.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_bmp280.h @@ -26,6 +26,7 @@ ****************************************************************************/ #include +#include /**************************************************************************** * Public Types @@ -62,6 +63,69 @@ extern "C" int board_bmp280_initialize(int bus); #endif +#ifdef CONFIG_SENSORS_BMP280_SCU +/**************************************************************************** + * Name: bmp280_init + * + * Description: + * Initialize BMP280 pressure device + * + * Input Parameters: + * i2c - An instance of the I2C interface to use to communicate with + * BMP280 + * port - I2C port number + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int bmp280_init(struct i2c_master_s *i2c, int port); + +/**************************************************************************** + * Name: bmp280press_register + * + * Description: + * Register the BMP280 pressure sensor character device as 'devpath' + * + * Input Parameters: + * devpath - The base path to the driver to register. E.g., "/dev/press0" + * minor - The number of sequencer + * i2c - An instance of the I2C interface to use to communicate with + * BMP280 + * port - I2C port number + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int bmp280press_register(const char *devpath, int minor, + struct i2c_master_s *i2c, int port); + +/**************************************************************************** + * Name: bmp280temp_register + * + * Description: + * Register the BMP280 temperature sensor character device as 'devpath' + * + * Input Parameters: + * devpath - The base path to the driver to register. E.g., "/dev/temp" + * minor - The number of sequencer + * i2c - An instance of the I2C interface to use to communicate with + * BMP280 + * port - I2C port number + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int bmp280temp_register(const char *devpath, int minor, + struct i2c_master_s *i2c, int port); + +#endif + #undef EXTERN #if defined(__cplusplus) } diff --git a/include/nuttx/sensors/bmp280.h b/include/nuttx/sensors/bmp280.h index ce88e13bad..f91127480d 100644 --- a/include/nuttx/sensors/bmp280.h +++ b/include/nuttx/sensors/bmp280.h @@ -135,25 +135,6 @@ struct bmp280_meas_s uint8_t xlsb; /* meas value XLSB */ }; -#ifdef CONFIG_SENSORS_BMP280_SCU -/**************************************************************************** - * Name: bmp280_init - * - * Description: - * Initialize BMP280 pressure device - * - * Input Parameters: - * i2c - An instance of the I2C interface to use to communicate with - * BMP280 - * - * Returned Value: - * Zero (OK) on success; a negated errno value on failure. - * - ****************************************************************************/ - -int bmp280_init(FAR struct i2c_master_s *i2c, int port); -#endif - /**************************************************************************** * Name: bmp280_register * @@ -170,14 +151,7 @@ int bmp280_init(FAR struct i2c_master_s *i2c, int port); * ****************************************************************************/ -#ifdef CONFIG_SENSORS_BMP280_SCU -int bmp280press_register(FAR const char *devpath, int minor, - FAR struct i2c_master_s *i2c, int port); -int bmp280temp_register(FAR const char *devpath, int minor, - FAR struct i2c_master_s *i2c, int port); -#else int bmp280_register(int devno, FAR struct i2c_master_s *i2c); -#endif #undef EXTERN #ifdef __cplusplus