From 553d2b8af9c5d40cf824959189421ee729bdcdc3 Mon Sep 17 00:00:00 2001 From: tyeth Date: Mon, 7 Aug 2023 14:43:15 +0100 Subject: [PATCH 1/6] Add BMP388 / BMP3xx --- library.properties | 2 +- platformio.ini | 1 + src/components/i2c/WipperSnapper_I2C.cpp | 11 ++ src/components/i2c/WipperSnapper_I2C.h | 2 + .../drivers/WipperSnapper_I2C_Driver_BMP388.h | 131 ++++++++++++++++++ 5 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h diff --git a/library.properties b/library.properties index 6efc52705..d83baee52 100644 --- a/library.properties +++ b/library.properties @@ -7,4 +7,4 @@ paragraph=Arduino client for Adafruit.io WipperSnapper category=Communication url=https://github.com/adafruit/Adafruit_IO_Arduino architectures=* -depends=Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit DPS310, Adafruit SCD30, Adafruit SGP30 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit PM25 AQI Sensor, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit PCT2075, hp_BH1750 +depends=Adafruit NeoPixel, Adafruit SPIFlash, ArduinoJson, Adafruit DotStar, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit SCD30, Adafruit SGP30 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit PM25 AQI Sensor, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit PCT2075, hp_BH1750 diff --git a/platformio.ini b/platformio.ini index 1289ec702..b566a0776 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,6 +25,7 @@ lib_deps = adafruit/Adafruit AHTX0 adafruit/Adafruit BME280 Library adafruit/Adafruit BMP280 Library + adafruit/Adafruit BMP3XX Library adafruit/Adafruit DPS310 adafruit/Adafruit HTS221 adafruit/Adafruit PCT2075 diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index a5564a652..44954dc45 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -258,6 +258,17 @@ bool WipperSnapper_Component_I2C::initI2CDevice( _bmp280->configureDriver(msgDeviceInitReq); drivers.push_back(_bmp280); WS_DEBUG_PRINTLN("BMP280 Initialized Successfully!"); + } else if (strcmp("bmp388", msgDeviceInitReq->i2c_device_name) == 0) { + _bmp388 = new WipperSnapper_I2C_Driver_BMP388(this->_i2c, i2cAddress); + if (!_bmp388->begin()) { + WS_DEBUG_PRINTLN("ERROR: Failed to initialize BMP388!"); + _busStatusResponse = + wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL; + return false; + } + _bmp388->configureDriver(msgDeviceInitReq); + drivers.push_back(_bmp388); + WS_DEBUG_PRINTLN("BMP388 Initialized Successfully!"); } else if (strcmp("bme680", msgDeviceInitReq->i2c_device_name) == 0) { _bme680 = new WipperSnapper_I2C_Driver_BME680(this->_i2c, i2cAddress); if (!_bme680->begin()) { diff --git a/src/components/i2c/WipperSnapper_I2C.h b/src/components/i2c/WipperSnapper_I2C.h index de0a93dbd..42e1f12fa 100644 --- a/src/components/i2c/WipperSnapper_I2C.h +++ b/src/components/i2c/WipperSnapper_I2C.h @@ -26,6 +26,7 @@ #include "drivers/WipperSnapper_I2C_Driver_BME280.h" #include "drivers/WipperSnapper_I2C_Driver_BME680.h" #include "drivers/WipperSnapper_I2C_Driver_BMP280.h" +#include "drivers/WipperSnapper_I2C_Driver_BMP388.h" #include "drivers/WipperSnapper_I2C_Driver_DPS310.h" #include "drivers/WipperSnapper_I2C_Driver_HTS221.h" #include "drivers/WipperSnapper_I2C_Driver_LC709203F.h" @@ -100,6 +101,7 @@ class WipperSnapper_Component_I2C { WipperSnapper_I2C_Driver_BH1750 *_bh1750 = nullptr; WipperSnapper_I2C_Driver_BME280 *_bme280 = nullptr; WipperSnapper_I2C_Driver_BMP280 *_bmp280 = nullptr; + WipperSnapper_I2C_Driver_BMP388 *_bmp388 = nullptr; WipperSnapper_I2C_Driver_BME680 *_bme680 = nullptr; WipperSnapper_I2C_Driver_HTS221 *_hts221 = nullptr; WipperSnapper_I2C_Driver_MCP9808 *_mcp9808 = nullptr; diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h new file mode 100644 index 000000000..c592bca90 --- /dev/null +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h @@ -0,0 +1,131 @@ +/*! + * @file WipperSnapper_I2C_Driver_BMP388.h + * + * Device driver for an AHT Humidity and Temperature sensor. + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Copyright (c) Tyeth Gundry 2023 for Adafruit Industries. + * + * MIT license, all text here must be included in any redistribution. + * + */ + +#ifndef WipperSnapper_I2C_Driver_BMP388_H +#define WipperSnapper_I2C_Driver_BMP388_H + +#include "WipperSnapper_I2C_Driver.h" +#include + +#define SEALEVELPRESSURE_HPA (1013.25) ///< Default sea level pressure, in hPa + +/**************************************************************************/ +/*! + @brief Class that provides a sensor driver for the BMP388 temperature + and pressure sensor. +*/ +/**************************************************************************/ +class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { + +public: + /*******************************************************************************/ + /*! + @brief Constructor for an BMP388 sensor. + @param i2c + The I2C interface. + @param sensorAddress + 7-bit device address. + */ + /*******************************************************************************/ + WipperSnapper_I2C_Driver_BMP388(TwoWire *i2c, uint16_t sensorAddress) + : WipperSnapper_I2C_Driver(i2c, sensorAddress) { + _i2c = i2c; + _sensorAddress = sensorAddress; + } + + /*******************************************************************************/ + /*! + @brief Destructor for an BMP388 sensor. + */ + /*******************************************************************************/ + ~WipperSnapper_I2C_Driver_BMP388() { delete _bmp; } + + /*******************************************************************************/ + /*! + @brief Initializes the BMP388 sensor and begins I2C. + @returns True if initialized successfully, False otherwise. + */ + /*******************************************************************************/ + bool begin() { + _bmp = new Adafruit_BMP3XX(); + // attempt to initialize BMP388 + if (!_bmp->begin_I2C(_sensorAddress, _i2c)) + return false; + + // Set up oversampling and filter initialization + _bmp->setTemperatureOversampling(BMP3_OVERSAMPLING_8X); + _bmp->setPressureOversampling(BMP3_OVERSAMPLING_4X); + _bmp->setIIRFilterCoeff(BMP3_IIR_FILTER_COEFF_3); + _bmp->setOutputDataRate(BMP3_ODR_50_HZ); + + return true; + } + + /*******************************************************************************/ + /*! + @brief Gets the BMP388's current temperature. + @param tempEvent + Pointer to an Adafruit_Sensor event. + @returns True if the temperature was obtained successfully, False + otherwise. + */ + /*******************************************************************************/ + bool getEventAmbientTemp(sensors_event_t *tempEvent) { + if(!_bmp->performReading()) + return false; + tempEvent->temperature = _bmp->temperature; + return true; + } + + /*******************************************************************************/ + /*! + @brief Reads a pressure sensor and converts + the reading into the expected SI unit. + @param pressureEvent + Pointer to an Adafruit_Sensor event. + @returns True if the sensor event was obtained successfully, False + otherwise. + */ + /*******************************************************************************/ + bool getEventPressure(sensors_event_t *pressureEvent) { + if(!_bmp->performReading()) + return false; + pressureEvent->pressure = _bmp->pressure / 100.0F; + return true; + } + + /*******************************************************************************/ + /*! + @brief Reads a the BMP388's altitude sensor into an event. + @param altitudeEvent + Pointer to an adafruit sensor event. + @returns True if the sensor event was obtained successfully, False + otherwise. + */ + /*******************************************************************************/ + bool getEventAltitude(sensors_event_t *altitudeEvent) { + if(!_bmp->performReading()) + return false; + // TODO: update once we add an altitude sensor type + // see https://github.com/adafruit/Adafruit_Sensor/issues/52 + altitudeEvent->data[0] = _bmp->readAltitude(SEALEVELPRESSURE_HPA); + return true; + } + +protected: + Adafruit_BMP3XX *_bmp; ///< BMP388 object +}; + +#endif // WipperSnapper_I2C_Driver_BMP388 \ No newline at end of file From 6ab38f24d7d7627dd524d49a564fc32ffbe6084f Mon Sep 17 00:00:00 2001 From: tyeth Date: Mon, 7 Aug 2023 15:47:40 +0100 Subject: [PATCH 2/6] CLang formatting --- .../i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h index c592bca90..f1238601d 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h @@ -83,7 +83,7 @@ class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { */ /*******************************************************************************/ bool getEventAmbientTemp(sensors_event_t *tempEvent) { - if(!_bmp->performReading()) + if (!_bmp->performReading()) return false; tempEvent->temperature = _bmp->temperature; return true; @@ -100,7 +100,7 @@ class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { */ /*******************************************************************************/ bool getEventPressure(sensors_event_t *pressureEvent) { - if(!_bmp->performReading()) + if (!_bmp->performReading()) return false; pressureEvent->pressure = _bmp->pressure / 100.0F; return true; @@ -116,7 +116,7 @@ class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { */ /*******************************************************************************/ bool getEventAltitude(sensors_event_t *altitudeEvent) { - if(!_bmp->performReading()) + if (!_bmp->performReading()) return false; // TODO: update once we add an altitude sensor type // see https://github.com/adafruit/Adafruit_Sensor/issues/52 From 8b78bd3990bd118e0f5908d3d83ca5fbde7b46f4 Mon Sep 17 00:00:00 2001 From: tyeth Date: Mon, 7 Aug 2023 17:29:28 +0100 Subject: [PATCH 3/6] Rename file --- ...pper_I2C_Driver_BMP388.h => WipperSnapper_I2C_Driver_BMP3XX.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/components/i2c/drivers/{WipperSnapper_I2C_Driver_BMP388.h => WipperSnapper_I2C_Driver_BMP3XX.h} (100%) diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h similarity index 100% rename from src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP388.h rename to src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h From 365d1d2189b3076146211242eaa6c7f7fa9062f0 Mon Sep 17 00:00:00 2001 From: tyeth Date: Mon, 7 Aug 2023 17:34:25 +0100 Subject: [PATCH 4/6] Refactor BMP380 to BMP3xx to match base driver --- src/components/i2c/WipperSnapper_I2C.cpp | 2 +- src/components/i2c/WipperSnapper_I2C.h | 4 +- .../drivers/WipperSnapper_I2C_Driver_BMP3XX.h | 54 +++++++++---------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 44954dc45..953a9205c 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -259,7 +259,7 @@ bool WipperSnapper_Component_I2C::initI2CDevice( drivers.push_back(_bmp280); WS_DEBUG_PRINTLN("BMP280 Initialized Successfully!"); } else if (strcmp("bmp388", msgDeviceInitReq->i2c_device_name) == 0) { - _bmp388 = new WipperSnapper_I2C_Driver_BMP388(this->_i2c, i2cAddress); + _bmp388 = new WipperSnapper_I2C_Driver_BMP3XX(this->_i2c, i2cAddress); if (!_bmp388->begin()) { WS_DEBUG_PRINTLN("ERROR: Failed to initialize BMP388!"); _busStatusResponse = diff --git a/src/components/i2c/WipperSnapper_I2C.h b/src/components/i2c/WipperSnapper_I2C.h index 42e1f12fa..c845e46f4 100644 --- a/src/components/i2c/WipperSnapper_I2C.h +++ b/src/components/i2c/WipperSnapper_I2C.h @@ -26,7 +26,7 @@ #include "drivers/WipperSnapper_I2C_Driver_BME280.h" #include "drivers/WipperSnapper_I2C_Driver_BME680.h" #include "drivers/WipperSnapper_I2C_Driver_BMP280.h" -#include "drivers/WipperSnapper_I2C_Driver_BMP388.h" +#include "drivers/WipperSnapper_I2C_Driver_BMP3XX.h" #include "drivers/WipperSnapper_I2C_Driver_DPS310.h" #include "drivers/WipperSnapper_I2C_Driver_HTS221.h" #include "drivers/WipperSnapper_I2C_Driver_LC709203F.h" @@ -101,7 +101,7 @@ class WipperSnapper_Component_I2C { WipperSnapper_I2C_Driver_BH1750 *_bh1750 = nullptr; WipperSnapper_I2C_Driver_BME280 *_bme280 = nullptr; WipperSnapper_I2C_Driver_BMP280 *_bmp280 = nullptr; - WipperSnapper_I2C_Driver_BMP388 *_bmp388 = nullptr; + WipperSnapper_I2C_Driver_BMP3XX *_bmp388 = nullptr; WipperSnapper_I2C_Driver_BME680 *_bme680 = nullptr; WipperSnapper_I2C_Driver_HTS221 *_hts221 = nullptr; WipperSnapper_I2C_Driver_MCP9808 *_mcp9808 = nullptr; diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h index f1238601d..a7a3ca909 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h @@ -1,5 +1,5 @@ /*! - * @file WipperSnapper_I2C_Driver_BMP388.h + * @file WipperSnapper_I2C_Driver_BMP3XX.h * * Device driver for an AHT Humidity and Temperature sensor. * @@ -13,8 +13,8 @@ * */ -#ifndef WipperSnapper_I2C_Driver_BMP388_H -#define WipperSnapper_I2C_Driver_BMP388_H +#ifndef WipperSnapper_I2C_Driver_BMP3XX_H +#define WipperSnapper_I2C_Driver_BMP3XX_H #include "WipperSnapper_I2C_Driver.h" #include @@ -23,23 +23,23 @@ /**************************************************************************/ /*! - @brief Class that provides a sensor driver for the BMP388 temperature + @brief Class that provides a sensor driver for the BMP3XX temperature and pressure sensor. */ /**************************************************************************/ -class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { +class WipperSnapper_I2C_Driver_BMP3XX : public WipperSnapper_I2C_Driver { public: /*******************************************************************************/ /*! - @brief Constructor for an BMP388 sensor. + @brief Constructor for an BMP3XX sensor. @param i2c The I2C interface. @param sensorAddress 7-bit device address. */ /*******************************************************************************/ - WipperSnapper_I2C_Driver_BMP388(TwoWire *i2c, uint16_t sensorAddress) + WipperSnapper_I2C_Driver_BMP3XX(TwoWire *i2c, uint16_t sensorAddress) : WipperSnapper_I2C_Driver(i2c, sensorAddress) { _i2c = i2c; _sensorAddress = sensorAddress; @@ -47,35 +47,35 @@ class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { /*******************************************************************************/ /*! - @brief Destructor for an BMP388 sensor. + @brief Destructor for an BMP3XX sensor. */ /*******************************************************************************/ - ~WipperSnapper_I2C_Driver_BMP388() { delete _bmp; } + ~WipperSnapper_I2C_Driver_BMP3XX() { delete _bmp3xx; } /*******************************************************************************/ /*! - @brief Initializes the BMP388 sensor and begins I2C. + @brief Initializes the BMP3XX sensor and begins I2C. @returns True if initialized successfully, False otherwise. */ /*******************************************************************************/ bool begin() { - _bmp = new Adafruit_BMP3XX(); - // attempt to initialize BMP388 - if (!_bmp->begin_I2C(_sensorAddress, _i2c)) + _bmp3xx = new Adafruit_BMP3XX(); + // attempt to initialize BMP3XX + if (!_bmp3xx->begin_I2C(_sensorAddress, _i2c)) return false; // Set up oversampling and filter initialization - _bmp->setTemperatureOversampling(BMP3_OVERSAMPLING_8X); - _bmp->setPressureOversampling(BMP3_OVERSAMPLING_4X); - _bmp->setIIRFilterCoeff(BMP3_IIR_FILTER_COEFF_3); - _bmp->setOutputDataRate(BMP3_ODR_50_HZ); + _bmp3xx->setTemperatureOversampling(BMP3_OVERSAMPLING_8X); + _bmp3xx->setPressureOversampling(BMP3_OVERSAMPLING_4X); + _bmp3xx->setIIRFilterCoeff(BMP3_IIR_FILTER_COEFF_3); + _bmp3xx->setOutputDataRate(BMP3_ODR_50_HZ); return true; } /*******************************************************************************/ /*! - @brief Gets the BMP388's current temperature. + @brief Gets the BMP3XX's current temperature. @param tempEvent Pointer to an Adafruit_Sensor event. @returns True if the temperature was obtained successfully, False @@ -83,9 +83,9 @@ class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { */ /*******************************************************************************/ bool getEventAmbientTemp(sensors_event_t *tempEvent) { - if (!_bmp->performReading()) + if (!_bmp3xx->performReading()) return false; - tempEvent->temperature = _bmp->temperature; + tempEvent->temperature = _bmp3xx->temperature; return true; } @@ -100,15 +100,15 @@ class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { */ /*******************************************************************************/ bool getEventPressure(sensors_event_t *pressureEvent) { - if (!_bmp->performReading()) + if (!_bmp3xx->performReading()) return false; - pressureEvent->pressure = _bmp->pressure / 100.0F; + pressureEvent->pressure = _bmp3xx->pressure / 100.0F; return true; } /*******************************************************************************/ /*! - @brief Reads a the BMP388's altitude sensor into an event. + @brief Reads a the BMP3XX's altitude sensor into an event. @param altitudeEvent Pointer to an adafruit sensor event. @returns True if the sensor event was obtained successfully, False @@ -116,16 +116,16 @@ class WipperSnapper_I2C_Driver_BMP388 : public WipperSnapper_I2C_Driver { */ /*******************************************************************************/ bool getEventAltitude(sensors_event_t *altitudeEvent) { - if (!_bmp->performReading()) + if (!_bmp3xx->performReading()) return false; // TODO: update once we add an altitude sensor type // see https://github.com/adafruit/Adafruit_Sensor/issues/52 - altitudeEvent->data[0] = _bmp->readAltitude(SEALEVELPRESSURE_HPA); + altitudeEvent->data[0] = _bmp3xx->readAltitude(SEALEVELPRESSURE_HPA); return true; } protected: - Adafruit_BMP3XX *_bmp; ///< BMP388 object + Adafruit_BMP3XX *_bmp3xx; ///< BMP3XX object }; -#endif // WipperSnapper_I2C_Driver_BMP388 \ No newline at end of file +#endif // WipperSnapper_I2C_Driver_BMP3XX \ No newline at end of file From d06ca00417fbe81b5d21a00fcc88fa6606dd764a Mon Sep 17 00:00:00 2001 From: tyeth Date: Mon, 7 Aug 2023 17:44:55 +0100 Subject: [PATCH 5/6] Rename symbol to match generic driver name --- src/components/i2c/WipperSnapper_I2C.cpp | 8 ++++---- src/components/i2c/WipperSnapper_I2C.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/i2c/WipperSnapper_I2C.cpp b/src/components/i2c/WipperSnapper_I2C.cpp index 953a9205c..55c82d094 100644 --- a/src/components/i2c/WipperSnapper_I2C.cpp +++ b/src/components/i2c/WipperSnapper_I2C.cpp @@ -259,15 +259,15 @@ bool WipperSnapper_Component_I2C::initI2CDevice( drivers.push_back(_bmp280); WS_DEBUG_PRINTLN("BMP280 Initialized Successfully!"); } else if (strcmp("bmp388", msgDeviceInitReq->i2c_device_name) == 0) { - _bmp388 = new WipperSnapper_I2C_Driver_BMP3XX(this->_i2c, i2cAddress); - if (!_bmp388->begin()) { + _bmp3xx = new WipperSnapper_I2C_Driver_BMP3XX(this->_i2c, i2cAddress); + if (!_bmp3xx->begin()) { WS_DEBUG_PRINTLN("ERROR: Failed to initialize BMP388!"); _busStatusResponse = wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL; return false; } - _bmp388->configureDriver(msgDeviceInitReq); - drivers.push_back(_bmp388); + _bmp3xx->configureDriver(msgDeviceInitReq); + drivers.push_back(_bmp3xx); WS_DEBUG_PRINTLN("BMP388 Initialized Successfully!"); } else if (strcmp("bme680", msgDeviceInitReq->i2c_device_name) == 0) { _bme680 = new WipperSnapper_I2C_Driver_BME680(this->_i2c, i2cAddress); diff --git a/src/components/i2c/WipperSnapper_I2C.h b/src/components/i2c/WipperSnapper_I2C.h index c845e46f4..6bbde4d0a 100644 --- a/src/components/i2c/WipperSnapper_I2C.h +++ b/src/components/i2c/WipperSnapper_I2C.h @@ -101,7 +101,7 @@ class WipperSnapper_Component_I2C { WipperSnapper_I2C_Driver_BH1750 *_bh1750 = nullptr; WipperSnapper_I2C_Driver_BME280 *_bme280 = nullptr; WipperSnapper_I2C_Driver_BMP280 *_bmp280 = nullptr; - WipperSnapper_I2C_Driver_BMP3XX *_bmp388 = nullptr; + WipperSnapper_I2C_Driver_BMP3XX *_bmp3xx = nullptr; WipperSnapper_I2C_Driver_BME680 *_bme680 = nullptr; WipperSnapper_I2C_Driver_HTS221 *_hts221 = nullptr; WipperSnapper_I2C_Driver_MCP9808 *_mcp9808 = nullptr; From a69b1e843907ff62cade72181bcba6733d70a3ed Mon Sep 17 00:00:00 2001 From: tyeth Date: Mon, 7 Aug 2023 18:19:50 +0100 Subject: [PATCH 6/6] Update description in file header --- src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h index a7a3ca909..32944cf6a 100644 --- a/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h +++ b/src/components/i2c/drivers/WipperSnapper_I2C_Driver_BMP3XX.h @@ -1,7 +1,7 @@ /*! * @file WipperSnapper_I2C_Driver_BMP3XX.h * - * Device driver for an AHT Humidity and Temperature sensor. + * Device driver for a BMP3XX precision pressure sensor breakout. * * Adafruit invests time and resources providing this open source code, * please support Adafruit and open-source hardware by purchasing