Move address, bus and port to TelemetrySensor
This commit is contained in:
@@ -34,10 +34,7 @@ class PMSA003ISensor : public TelemetrySensor
|
|||||||
uint32_t pmMeasureStarted = 0;
|
uint32_t pmMeasureStarted = 0;
|
||||||
|
|
||||||
uint8_t buffer[PMSA003I_FRAME_LENGTH]{};
|
uint8_t buffer[PMSA003I_FRAME_LENGTH]{};
|
||||||
TwoWire *_bus{};
|
|
||||||
uint8_t _address{};
|
|
||||||
#ifdef PMSA003I_I2C_CLOCK_SPEED
|
#ifdef PMSA003I_I2C_CLOCK_SPEED
|
||||||
ScanI2C::I2CPort _port = ScanI2C::I2CPort::NO_I2C;
|
|
||||||
ReClockI2C reClockI2C;
|
ReClockI2C reClockI2C;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,10 +13,7 @@ class SCD30Sensor : public TelemetrySensor
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SensirionI2cScd30 scd30;
|
SensirionI2cScd30 scd30;
|
||||||
TwoWire *_bus{};
|
|
||||||
uint8_t _address{};
|
|
||||||
#ifdef SCD30_I2C_CLOCK_SPEED
|
#ifdef SCD30_I2C_CLOCK_SPEED
|
||||||
ScanI2C::I2CPort _port = ScanI2C::I2CPort::NO_I2C;
|
|
||||||
ReClockI2C reClockI2C;
|
ReClockI2C reClockI2C;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,7 @@ class SCD4XSensor : public TelemetrySensor
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SensirionI2cScd4x scd4x;
|
SensirionI2cScd4x scd4x;
|
||||||
TwoWire *_bus{};
|
|
||||||
uint8_t _address{};
|
|
||||||
#ifdef SCD4X_I2C_CLOCK_SPEED
|
#ifdef SCD4X_I2C_CLOCK_SPEED
|
||||||
ScanI2C::I2CPort _port = ScanI2C::I2CPort::NO_I2C;
|
|
||||||
ReClockI2C reClockI2C;
|
ReClockI2C reClockI2C;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -61,10 +61,7 @@ struct _SEN5XMeasurements {
|
|||||||
class SEN5XSensor : public TelemetrySensor
|
class SEN5XSensor : public TelemetrySensor
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
TwoWire *_bus{};
|
|
||||||
uint8_t _address{};
|
|
||||||
#ifdef SEN5X_I2C_CLOCK_SPEED
|
#ifdef SEN5X_I2C_CLOCK_SPEED
|
||||||
ScanI2C::I2CPort _port = ScanI2C::I2CPort::NO_I2C;
|
|
||||||
ReClockI2C reClockI2C;
|
ReClockI2C reClockI2C;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ class SFA30Sensor : public TelemetrySensor
|
|||||||
uint32_t measureStarted = 0;
|
uint32_t measureStarted = 0;
|
||||||
|
|
||||||
SensirionI2cSfa3x sfa30;
|
SensirionI2cSfa3x sfa30;
|
||||||
TwoWire *_bus{};
|
|
||||||
uint8_t _address{};
|
|
||||||
#ifdef SFA30_I2C_CLOCK_SPEED
|
#ifdef SFA30_I2C_CLOCK_SPEED
|
||||||
ScanI2C::I2CPort _port = ScanI2C::I2CPort::NO_I2C;
|
|
||||||
ReClockI2C reClockI2C;
|
ReClockI2C reClockI2C;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ class TelemetrySensor
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *sensorName;
|
const char *sensorName;
|
||||||
|
// TODO: Rename?
|
||||||
|
uint8_t _address = 0;
|
||||||
|
TwoWire *_bus{};
|
||||||
|
ScanI2C::I2CPort _port = ScanI2C::I2CPort::NO_I2C;
|
||||||
|
|
||||||
// TODO: delete after migration
|
// TODO: delete after migration
|
||||||
bool hasSensor() { return nodeTelemetrySensorsMap[sensorType].first > 0; }
|
bool hasSensor() { return nodeTelemetrySensorsMap[sensorType].first > 0; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user