16 #ifndef WipperSnapper_Component_I2C_H 17 #define WipperSnapper_Component_I2C_H 25 #include "drivers/WipperSnapper_I2C_Driver_BH1750.h" 59 #include "drivers/WipperSnapper_I2C_Driver_SGP30.h" 78 #define I2C_TIMEOUT_MS 50 91 wippersnapper_i2c_v1_I2CBusInitRequest *msgInitRequest);
98 initI2CDevice(wippersnapper_i2c_v1_I2CDeviceInitRequest *msgDeviceInitReq);
101 wippersnapper_i2c_v1_I2CDeviceUpdateRequest *msgDeviceUpdateReq);
103 wippersnapper_i2c_v1_I2CDeviceDeinitRequest *msgDeviceDeinitReq);
108 std::vector<WipperSnapper_I2C_Driver *>::iterator &iter,
109 unsigned long curTime,
110 wippersnapper_signal_v1_I2CResponse *msgi2cResponse,
115 wippersnapper_i2c_v1_SensorType sensorType,
const char *sensorName,
116 const char *unit, sensors_event_t event,
117 float sensors_event_t::*valueMember,
bool &sensorsReturningFalse,
122 wippersnapper_i2c_v1_SensorType sensorType);
126 uint32_t sensorAddress);
129 wippersnapper_signal_v1_I2CResponse *msgi2cResponse,
130 uint32_t sensorAddress);
133 bool _isInit =
false;
135 TwoWire *_i2c =
nullptr;
136 wippersnapper_i2c_v1_BusResponse _busStatusResponse;
137 std::vector<WipperSnapper_I2C_Driver *> drivers;
196 #endif // WipperSnapper_Component_I2C_H Class that provides an interface with the I2C bus.
Definition: WipperSnapper_I2C.h:88
Class that provides a driver interface for the SCD30 sensor.
Definition: WipperSnapper_I2C_Driver_SCD30.h:27
Class that provides a sensor driver for the MS8607 PHT sensor.
Definition: WipperSnapper_I2C_Driver_MS8607.h:27
bool isInitialized()
Returns if i2c port is initialized.
Definition: WipperSnapper_I2C.cpp:124
Class that provides a sensor driver for the LPS28DFW temperature and pressure sensor.
Definition: WipperSnapper_I2C_Driver_LPS28DFW.h:28
Class that provides a driver interface for a VCNL4040 sensor.
Definition: WipperSnapper_I2C_Driver_VCNL4040.h:26
Class that provides a driver interface for the SCD40 sensor.
Definition: WipperSnapper_I2C_Driver_SCD4X.h:29
wippersnapper_i2c_v1_I2CBusScanResponse scanAddresses()
Scans all I2C addresses on the bus between 0x08 and 0x7F inclusive and returns an array of the device...
Definition: WipperSnapper_I2C.cpp:144
Class that provides a driver interface for a PCT2075 sensor.
Definition: WipperSnapper_I2C_Driver_PCT2075.h:26
Class that provides a driver interface for a ADT7410 sensor.
Definition: WipperSnapper_I2C_Driver_ADT7410.h:26
Class that provides a driver interface for a VL53L4CD sensor.
Definition: WipperSnapper_I2C_Driver_VL53L4CD.h:26
void fillEventMessage(wippersnapper_signal_v1_I2CResponse *msgi2cResponse, float value, wippersnapper_i2c_v1_SensorType sensorType)
Fills a sensor_event message with the sensor's value and type.
Definition: WipperSnapper_I2C.cpp:961
Class that provides a driver interface for a VL6180X sensor.
Definition: WipperSnapper_I2C_Driver_VL6180X.h:27
Class that provides a driver interface for a BH1750 Light sensor.
Definition: WipperSnapper_I2C_Driver_BH1750.h:20
bool initI2CDevice(wippersnapper_i2c_v1_I2CDeviceInitRequest *msgDeviceInitReq)
Initializes I2C device driver.
Definition: WipperSnapper_I2C.cpp:219
void displayDeviceEventMessage(wippersnapper_signal_v1_I2CResponse *msgi2cResponse, uint32_t sensorAddress)
Displays a sensor event message on the TFT.
Definition: WipperSnapper_I2C.cpp:986
Class that provides a sensor driver for the HTU31D humidity and temperature sensor.
Definition: WipperSnapper_I2C_Driver_HTU31D.h:19
Class that provides a driver interface for the PM25 sensor.
Definition: WipperSnapper_I2C_Driver_PM25.h:28
Class that provides a sensor driver for the HTU21D humidity and temperature sensor.
Definition: WipperSnapper_I2C_Driver_HTU21D.h:19
Class that provides a sensor driver for the DS2484 I2C OneWire converter hosting a DS18b20 temperatur...
Definition: WipperSnapper_I2C_Driver_DS2484.h:33
Class that provides a driver interface for a TSL2591 sensor.
Definition: WipperSnapper_I2C_Driver_TSL2591.h:26
Class that provides a driver interface for a MCP9808 sensor.
Definition: WipperSnapper_I2C_Driver_MCP9808.h:26
Class that provides a driver interface for a LTR329/303 sensor.
Definition: WipperSnapper_I2C_Driver_LTR329_LTR303.h:26
Class that provides a sensor driver for the HTS221 humidity and temperature sensor. This implementation uses the 1 Hz data rate.
Definition: WipperSnapper_I2C_Driver_HTS221.h:19
Class that provides a driver interface for a LC709203F sensor.
Definition: WipperSnapper_I2C_Driver_LC709203F.h:27
Class that provides a sensor driver for the BMP280 temperature and pressure sensor.
Definition: WipperSnapper_I2C_Driver_BMP280.h:30
void sensorEventRead(std::vector< WipperSnapper_I2C_Driver *>::iterator &iter, unsigned long curTime, wippersnapper_signal_v1_I2CResponse *msgi2cResponse, bool(WipperSnapper_I2C_Driver::*getEventFunc)(sensors_event_t *), long(WipperSnapper_I2C_Driver::*getPeriodFunc)(), long(WipperSnapper_I2C_Driver::*getPeriodPrvFunc)(), void(WipperSnapper_I2C_Driver::*setPeriodPrvFunc)(long), wippersnapper_i2c_v1_SensorType sensorType, const char *sensorName, const char *unit, sensors_event_t event, float sensors_event_t::*valueMember, bool &sensorsReturningFalse, int &retries)
Reads a sensor event from an I2C device driver.
Definition: WipperSnapper_I2C.cpp:1382
bool encodePublishI2CDeviceEventMsg(wippersnapper_signal_v1_I2CResponse *msgi2cResponse, uint32_t sensorAddress)
Encodes an I2C sensor device's signal message.
Definition: WipperSnapper_I2C.cpp:921
Base class for I2C Drivers.
Definition: WipperSnapper_I2C_Driver.h:30
Class that provides a driver interface for a SGP30 sensor.
Definition: WipperSnapper_I2C_Driver_SGP30.h:12
Class that provides storage and functions for the Adafruit IO Wippersnapper interface.
Definition: Wippersnapper.h:283
Class that provides a driver interface for the SEN5X sensor.
Definition: WipperSnapper_I2C_Driver_SEN5X.h:28
Class that provides a driver interface for the SEN6X sensor.
Definition: WipperSnapper_I2C_Driver_SEN6X.h:30
Class that provides a sensor driver for the HDC302X humidity and temperature sensor. This implementation uses the 1 Hz data rate.
Definition: WipperSnapper_I2C_Driver_HDC302X.h:19
WipperSnapper_Component_I2C(wippersnapper_i2c_v1_I2CBusInitRequest *msgInitRequest)
Creates a new WipperSnapper I2C component.
Definition: WipperSnapper_I2C.cpp:31
Class that provides a driver interface for the SHT4X sensor.
Definition: WipperSnapper_I2C_Driver_SHT4X.h:30
void deinitI2CDevice(wippersnapper_i2c_v1_I2CDeviceDeinitRequest *msgDeviceDeinitReq)
Deinitializes and deletes an I2C device driver object.
Definition: WipperSnapper_I2C.cpp:886
Class that provides a driver interface for the SHT3X sensor.
Definition: WipperSnapper_I2C_Driver_SHT3X.h:30
Class that provides a driver interface for a LTR390 sensor.
Definition: WipperSnapper_I2C_Driver_LTR390.h:26
Class that provides a driver interface for a INA260 sensor.
Definition: WipperSnapper_I2C_Driver_INA260.h:26
Class that provides a driver interface for a TMP117 sensor.
Definition: WipperSnapper_I2C_Driver_TMP117.h:26
Class that provides a sensor driver for the MPL115A2 temperature and pressure sensor.
Definition: WipperSnapper_I2C_Driver_MPL115A2.h:28
Class that provides a sensor driver for the ENS160 temperature and humidity sensor.
Definition: WipperSnapper_I2C_Driver_ENS160.h:30
Class that provides a sensor driver for the LPS22HB temperature and pressure sensor.
Definition: WipperSnapper_I2C_Driver_LPS22HB.h:28
Class that provides a sensor driver for the LPS25HB temperature and pressure sensor.
Definition: WipperSnapper_I2C_Driver_LPS25HB.h:28
Class that provides a driver interface for a MCP3421 sensor.
Definition: WipperSnapper_I2C_Driver_MCP3421.h:27
Class that provides a driver interface for the SI7021 sensor.
Definition: WipperSnapper_I2C_Driver_SI7021.h:29
Class that provides a driver interface for the STEMMA soil sensor.
Definition: WipperSnapper_I2C_Driver_STEMMA_Soil_Sensor.h:27
Class that provides a driver interface for a VL53L0X sensor.
Definition: WipperSnapper_I2C_Driver_VL53L0X.h:27
Class that provides a driver interface for a VL53L1X sensor.
Definition: WipperSnapper_I2C_Driver_VL53L1X.h:27
void updateI2CDeviceProperties(wippersnapper_i2c_v1_I2CDeviceUpdateRequest *msgDeviceUpdateReq)
Updates the properties of an I2C device driver.
Definition: WipperSnapper_I2C.cpp:858
Wippersnapper WS
Definition: Wippersnapper.cpp:36
Class that provides a sensor driver for the MPRLS sensor.
Definition: WipperSnapper_I2C_Driver_MPRLS.h:27
Class that provides a driver interface for a VL53L4CX sensor.
Definition: WipperSnapper_I2C_Driver_VL53L4CX.h:31
wippersnapper_i2c_v1_BusResponse getBusStatus()
Returns the state of the I2C bus.
Definition: WipperSnapper_I2C.cpp:132
Class that provides a sensor driver for the BME680 temperature and humidity sensor.
Definition: WipperSnapper_I2C_Driver_BME680.h:30
Class that provides a sensor driver for the BME280 temperature and humidity sensor.
Definition: WipperSnapper_I2C_Driver_BME280.h:30
Class that provides a sensor driver for the BMP3XX temperature and pressure sensor.
Definition: WipperSnapper_I2C_Driver_BMP3XX.h:30
Class that provides a driver interface for a VEML7700 sensor.
Definition: WipperSnapper_I2C_Driver_VEML7700.h:26
Class that provides a sensor driver for the AHTX0 temperature and humidity sensor.
Definition: WipperSnapper_I2C_Driver_AHTX0.h:28
Class that provides a driver interface for the SGP40 sensor.
Definition: WipperSnapper_I2C_Driver_SGP40.h:28
Class that provides a driver interface for a INA219 sensor.
Definition: WipperSnapper_I2C_Driver_INA219.h:26
Class that provides a driver interface for a VCNL4200 sensor.
Definition: WipperSnapper_I2C_Driver_VCNL4200.h:26
Class that provides a driver interface for a MAX17048 sensor.
Definition: WipperSnapper_I2C_Driver_MAX17048.h:27
Class that provides a driver interface for the NAU7802.
Definition: WipperSnapper_I2C_Driver_NAU7802.h:29
Class that provides a sensor driver for the DPS310 barometric pressure sensor.
Definition: WipperSnapper_I2C_Driver_DPS310.h:28
Class that provides a sensor driver for the LPS3XHW temperature and pressure sensor.
Definition: WipperSnapper_I2C_Driver_LPS3XHW.h:28
~WipperSnapper_Component_I2C()
Destructor for a WipperSnapper I2C component.
Definition: WipperSnapper_I2C.cpp:113
Class that provides a driver interface for the SHTC3 sensor.
Definition: WipperSnapper_I2C_Driver_SHTC3.h:30
Class that provides a driver interface for a VCNL4020 sensor.
Definition: WipperSnapper_I2C_Driver_VCNL4020.h:26
void update()
Queries all I2C device drivers for new values. Fills and sends an I2CSensorEvent with the sensor even...
Definition: WipperSnapper_I2C.cpp:1082