Skip to content

Commit 5d1f489

Browse files
committed
Merge remote-tracking branch 'upstream/offline-mode-add-missing-drivers-2025-04-04' into offline-mode-20250506-with-drivers
2 parents 0addc4f + 922653c commit 5d1f489

File tree

10 files changed

+879
-3
lines changed

10 files changed

+879
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Pre-compiled binaries and UF2 files for supported hardware are provided on the [
2424
|--|--|
2525
|[ESP32-x](https://github.com/espressif/arduino-esp32)| ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 |
2626
|[ESP8266](https://github.com/esp8266/Arduino)| ESP8266 |
27-
|[RP2040](https://github.com/earlephilhower/arduino-pico)| RP2040 MCU w/WiFi (i.e: Pico W) |
27+
|[RP2](https://github.com/earlephilhower/arduino-pico)| RP2040/RP2350 MCU w/WiFi (i.e: Pico W) |
2828
|[ATSAMD](https://github.com/adafruit/ArduinoCore-samd/)| SAMD51 MCU w/separate WiFi Co-Processor (i.e: Adafruit "AirLift")|
2929

3030
## Contributing to Adafruit.io and WipperSnapper

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ paragraph=Arduino application for Adafruit.io WipperSnapper
77
category=Communication
88
url=https://github.com/adafruit/Adafruit_Wippersnapper_Arduino
99
architectures=*
10-
depends=SdFat - Adafruit Fork, Adafruit SPIFlash, Adafruit NeoPixel, ArduinoJson, Adafruit DotStar, Adafruit HDC302x, Adafruit INA219, Adafruit LTR329 and LTR303, Adafruit LTR390 Library, Adafruit MCP3421, Adafruit NAU7802 Library, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit DS248x, Adafruit SCD30, Adafruit SGP30 Sensor, Adafruit SGP40 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, Sensirion I2C SEN66, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MS8607, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit MPL115A2, Adafruit MPRLS Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit VL53L1X, STM32duino VL53L4CD, STM32duino VL53L4CX, Adafruit_VL6180X, Adafruit PM25 AQI Sensor, Adafruit VCNL4020 Library, Adafruit VCNL4040, Adafruit VCNL4200 Library, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit LPS2X, Adafruit LPS28, Adafruit LPS35HW, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit HTU21DF Library, Adafruit HTU31D Library, Adafruit PCT2075, hp_BH1750, ENS160 - Adafruit Fork, Adafruit BusIO, Adafruit Unified Sensor, Sensirion Core, Adafruit GFX Library, RTClib, StreamUtils, Adafruit SHT4x Library
10+
depends=SdFat - Adafruit Fork, Adafruit SPIFlash, Adafruit NeoPixel, ArduinoJson, Adafruit DotStar, Adafruit HDC302x, Adafruit INA219, Adafruit INA260 Library, Adafruit LTR329 and LTR303, Adafruit LTR390 Library, Adafruit MCP3421, Adafruit NAU7802 Library, Adafruit SleepyDog Library, Adafruit TMP117, Adafruit TinyUSB Library, Adafruit AHTX0, Adafruit BME280 Library, Adafruit BMP280 Library, Adafruit BMP3XX Library, Adafruit DPS310, Adafruit DS248x, Adafruit SCD30, Adafruit SGP30 Sensor, Adafruit SGP40 Sensor, Sensirion I2C SCD4x, Sensirion I2C SEN5X, Sensirion I2C SEN66, arduino-sht, Adafruit Si7021 Library, Adafruit MQTT Library, Adafruit MS8607, Adafruit MCP9808 Library, Adafruit MCP9600 Library, Adafruit MPL115A2, Adafruit MPRLS Library, Adafruit TSL2591 Library, Adafruit_VL53L0X, Adafruit VL53L1X, STM32duino VL53L4CD, STM32duino VL53L4CX, Adafruit_VL6180X, Adafruit PM25 AQI Sensor, Adafruit VCNL4020 Library, Adafruit VCNL4040, Adafruit VCNL4200 Library, Adafruit VEML7700 Library, Adafruit LC709203F, Adafruit LPS2X, Adafruit LPS28, Adafruit LPS35HW, Adafruit seesaw Library, Adafruit BME680 Library, Adafruit MAX1704X, Adafruit ADT7410 Library, Adafruit HTS221, Adafruit HTU21DF Library, Adafruit HTU31D Library, Adafruit PCT2075, hp_BH1750, ENS160 - Adafruit Fork, Adafruit BusIO, Adafruit Unified Sensor, Sensirion Core, Adafruit GFX Library, RTClib, StreamUtils, Adafruit SHT4x Library

platformio.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ lib_deps =
3131
adafruit/Adafruit DPS310
3232
adafruit/Adafruit DS248x
3333
adafruit/Adafruit INA219
34+
adafruit/Adafruit INA260 Library
3435
adafruit/Adafruit HTS221
3536
adafruit/Adafruit HTU21DF Library
3637
adafruit/Adafruit HTU31D Library
38+
adafruit/Adafruit HDC302x
3739
adafruit/Adafruit LTR390 Library
3840
adafruit/Adafruit LTR329 and LTR303
3941
adafruit/Adafruit PCT2075
@@ -43,6 +45,7 @@ lib_deps =
4345
adafruit/Adafruit Si7021 Library
4446
adafruit/Adafruit VCNL4020 Library
4547
adafruit/Adafruit VCNL4040
48+
adafruit/Adafruit VCNL4200 Library
4649
adafruit/Adafruit MCP3421
4750
adafruit/Adafruit MCP9808 Library
4851
adafruit/Adafruit MCP9600 Library
@@ -61,6 +64,7 @@ lib_deps =
6164
adafruit/Adafruit VEML7700 Library
6265
adafruit/Adafruit LC709203F
6366
adafruit/Adafruit LPS2X
67+
adafruit/Adafruit LPS28
6468
adafruit/Adafruit LPS35HW
6569
adafruit/Adafruit seesaw Library
6670
adafruit/Adafruit BME680 Library
@@ -76,6 +80,7 @@ lib_deps =
7680
https://github.com/pstolarz/OneWireNg.git
7781
https://github.com/Sensirion/arduino-sht.git
7882
https://github.com/Sensirion/arduino-i2c-sen5x.git
83+
https://github.com/Sensirion/arduino-i2c-sen66.git
7984
https://github.com/adafruit/WiFiNINA.git
8085
https://github.com/Starmbi/hp_BH1750.git
8186
https://github.com/adafruit/RTClib.git
@@ -84,7 +89,7 @@ lib_deps =
8489

8590
; Common build environment for ESP32 platform
8691
[common:esp32]
87-
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip
92+
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip
8893
lib_ignore = WiFiNINA, WiFi101
8994
monitor_filters = esp32_exception_decoder, time
9095
; upload_speed = 921600

src/components/i2c/controller.cpp

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,21 @@ static const std::map<std::string, FnCreateI2CDriver> I2cFactory = {
128128
const char *driver_name) -> drvBase * {
129129
return new drvHtu31d(i2c, addr, mux_channel, driver_name);
130130
}},
131+
{"hdc302x",
132+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
133+
const char *driver_name) -> drvBase * {
134+
return new drvHdc302x(i2c, addr, mux_channel, driver_name);
135+
}},
131136
{"ina219",
132137
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
133138
const char *driver_name) -> drvBase * {
134139
return new drvIna219(i2c, addr, mux_channel, driver_name);
135140
}},
141+
{"ina260",
142+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
143+
const char *driver_name) -> drvBase * {
144+
return new drvIna260(i2c, addr, mux_channel, driver_name);
145+
}},
136146
{"lc709203f",
137147
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
138148
const char *driver_name) -> drvBase * {
@@ -153,6 +163,11 @@ static const std::map<std::string, FnCreateI2CDriver> I2cFactory = {
153163
const char *driver_name) -> drvBase * {
154164
return new drvLps25hb(i2c, addr, mux_channel, driver_name);
155165
}},
166+
{"lps28dfw",
167+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
168+
const char *driver_name) -> drvBase * {
169+
return new drvLps28dfw(i2c, addr, mux_channel, driver_name);
170+
}},
156171
{"ltr329",
157172
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
158173
const char *driver_name) -> drvBase * {
@@ -288,6 +303,36 @@ static const std::map<std::string, FnCreateI2CDriver> I2cFactory = {
288303
const char *driver_name) -> drvBase * {
289304
return new drvSen5x(i2c, addr, mux_channel, driver_name);
290305
}},
306+
{"sen60",
307+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
308+
const char *driver_name) -> drvBase * {
309+
return new drvSen6x(i2c, addr, mux_channel, driver_name);
310+
}},
311+
{"sen63c",
312+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
313+
const char *driver_name) -> drvBase * {
314+
return new drvSen6x(i2c, addr, mux_channel, driver_name);
315+
}},
316+
{"sen65",
317+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
318+
const char *driver_name) -> drvBase * {
319+
return new drvSen6x(i2c, addr, mux_channel, driver_name);
320+
}},
321+
{"sen66",
322+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
323+
const char *driver_name) -> drvBase * {
324+
return new drvSen6x(i2c, addr, mux_channel, driver_name);
325+
}},
326+
{"sen68",
327+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
328+
const char *driver_name) -> drvBase * {
329+
return new drvSen6x(i2c, addr, mux_channel, driver_name);
330+
}},
331+
{"sen6x",
332+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
333+
const char *driver_name) -> drvBase * {
334+
return new drvSen6x(i2c, addr, mux_channel, driver_name);
335+
}},
291336
{"shtc3",
292337
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
293338
const char *driver_name) -> drvBase * {
@@ -328,6 +373,11 @@ static const std::map<std::string, FnCreateI2CDriver> I2cFactory = {
328373
const char *driver_name) -> drvBase * {
329374
return new drvVncl4040(i2c, addr, mux_channel, driver_name);
330375
}},
376+
{"vncl4200",
377+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
378+
const char *driver_name) -> drvBase * {
379+
return new drvVncl4200(i2c, addr, mux_channel, driver_name);
380+
}},
331381
{"vl53l0x",
332382
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
333383
const char *driver_name) -> drvBase * {

src/components/i2c/controller.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@
2929
#include "drivers/drvDps310.h"
3030
#include "drivers/drvDs2484.h"
3131
#include "drivers/drvEns160.h"
32+
#include "drivers/drvHdc302x.h"
3233
#include "drivers/drvHts221.h"
3334
#include "drivers/drvHtu21d.h"
3435
#include "drivers/drvHtu31d.h"
3536
#include "drivers/drvIna219.h"
37+
#include "drivers/drvIna260.h"
3638
#include "drivers/drvLc709203f.h"
3739
#include "drivers/drvLps22hb.h"
3840
#include "drivers/drvLps25hb.h"
41+
#include "drivers/drvLps28dfw.h"
3942
#include "drivers/drvLps3xhw.h"
4043
#include "drivers/drvLtr329_Ltr303.h"
4144
#include "drivers/drvLtr390.h"
@@ -51,6 +54,7 @@
5154
#include "drivers/drvScd30.h"
5255
#include "drivers/drvScd4x.h"
5356
#include "drivers/drvSen5x.h"
57+
#include "drivers/drvSen6x.h"
5458
#include "drivers/drvSgp30.h"
5559
#include "drivers/drvSgp40.h"
5660
#include "drivers/drvSht3x.h"
@@ -68,6 +72,7 @@
6872
#include "drivers/drvVl6180x.h"
6973
#include "drivers/drvVncl4020.h"
7074
#include "drivers/drvVncl4040.h"
75+
#include "drivers/drvVncl4200.h"
7176

7277
#define SCAN_DEVICE \
7378
"UNKNOWN_SCAN" ///< Name for I2C devices found by an i2c scan
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*!
2+
* @file drvHdc302x.h
3+
*
4+
* Device driver for an HDC302X Humidity and Temperature sensor.
5+
*/
6+
7+
#ifndef DRV_HDC302X_H
8+
#define DRV_HDC302X_H
9+
10+
#include "drvBase.h"
11+
#include <Adafruit_HDC302x.h>
12+
13+
/**************************************************************************/
14+
/*!
15+
@brief Class that provides a sensor driver for the HDC302X humidity and
16+
temperature sensor. This implementation uses the 1 Hz data rate.
17+
*/
18+
/**************************************************************************/
19+
class drvHdc302x : public drvBase {
20+
21+
public:
22+
/*******************************************************************************/
23+
/*!
24+
@brief Constructor for an HDC302X sensor.
25+
@param i2c
26+
The I2C interface.
27+
@param sensorAddress
28+
7-bit device address.
29+
@param mux_channel
30+
The I2C multiplexer channel.
31+
@param driver_name
32+
The name of the driver.
33+
*/
34+
/*******************************************************************************/
35+
drvHdc302x(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel,
36+
const char *driver_name)
37+
: drvBase(i2c, sensorAddress, mux_channel, driver_name) {
38+
// Initialization handled by drvBase constructor
39+
}
40+
41+
/*******************************************************************************/
42+
/*!
43+
@brief Destructor for an HDC302X sensor.
44+
*/
45+
/*******************************************************************************/
46+
~drvHdc302x() { delete _hdc302x; }
47+
48+
/*******************************************************************************/
49+
/*!
50+
@brief Initializes the HDC302X sensor and begins I2C.
51+
@returns True if initialized successfully, False otherwise.
52+
53+
*/
54+
/*******************************************************************************/
55+
bool begin() {
56+
// attempt to initialize the HDC302X using the I2C interface
57+
_hdc302x = new Adafruit_HDC302x();
58+
if (!_hdc302x->begin(_address, _i2c))
59+
return false;
60+
61+
// set the HDC302X's data rate to 1 Hz lowest noise
62+
_hdc302x->setAutoMode(EXIT_AUTO_MODE);
63+
// discard first reading (It returned -45c for me once)
64+
_hdc302x->readTemperatureHumidityOnDemand(_temp, _humidity,
65+
TRIGGERMODE_LP0);
66+
return true;
67+
}
68+
69+
/*******************************************************************************/
70+
/*!
71+
@brief Reads the HDC302X's temperature and humidity data.
72+
@returns True if the data was read successfully, False otherwise.
73+
*/
74+
/*******************************************************************************/
75+
bool ReadSensorData() {
76+
uint16_t status = _hdc302x->readStatus();
77+
if (status & 0x0010) {
78+
WS_DEBUG_PRINTLN(F("Device Reset Detected"));
79+
return false;
80+
}
81+
82+
if (status & 0x0001) {
83+
WS_DEBUG_PRINTLN(
84+
F("Checksum Verification Fail (incorrect checksum received)"));
85+
return false;
86+
}
87+
88+
if (!_hdc302x->readTemperatureHumidityOnDemand(_temp, _humidity,
89+
TRIGGERMODE_LP0)) {
90+
WS_DEBUG_PRINTLN(F("Failed to read temperature and humidity."));
91+
return false;
92+
}
93+
return true;
94+
}
95+
96+
/*******************************************************************************/
97+
/*!
98+
@brief Gets the HDC302X's current temperature.
99+
@param tempEvent
100+
Pointer to an Adafruit_Sensor event.
101+
@returns True if the temperature was obtained successfully, False
102+
otherwise.
103+
*/
104+
/*******************************************************************************/
105+
bool getEventAmbientTemp(sensors_event_t *tempEvent) {
106+
if (ReadSensorData() == false)
107+
return false;
108+
tempEvent->temperature = _temp;
109+
return true;
110+
}
111+
112+
/*******************************************************************************/
113+
/*!
114+
@brief Gets the HDC302X's current humidity.
115+
@param humidEvent
116+
Pointer to an Adafruit_Sensor event.
117+
@returns True if the humidity was obtained successfully, False
118+
otherwise.
119+
*/
120+
/*******************************************************************************/
121+
bool getEventRelativeHumidity(sensors_event_t *humidEvent) {
122+
if (ReadSensorData() == false)
123+
return false;
124+
humidEvent->relative_humidity = _humidity;
125+
return true;
126+
}
127+
128+
protected:
129+
Adafruit_HDC302x *_hdc302x; ///< Pointer to an HDC302X object
130+
double _temp = 0.0; ///< Holds data for the HDC302X's temperature sensor
131+
double _humidity = 0.0; ///< Holds data for the HDC302X's humidity sensor
132+
};
133+
#endif // DRV_HDC302X_H

0 commit comments

Comments
 (0)