Skip to content

Commit b8fb24f

Browse files
committed
sht4x: allow to specify I2C transfer speed
1 parent 2689ad0 commit b8fb24f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

components/ocs_sensor/sht4x/sensor_pipeline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SensorPipeline::SensorPipeline(io::i2c::IStore& store,
2323
configASSERT(storage_);
2424

2525
transceiver_ = store.add(transceiver_id_.c_str(), io::i2c::AddressLength::Bit_7,
26-
params.i2c_addr, io::i2c::TransferSpeed::Fast);
26+
params.i2c_addr, params.i2c_speed);
2727
configASSERT(transceiver_);
2828

2929
sensor_.reset(new (std::nothrow) Sensor(*transceiver_, *storage_, id, params.sensor));

components/ocs_sensor/sht4x/sensor_pipeline.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class SensorPipeline : private core::NonCopyable<> {
2626
//! Sensor I2C address.
2727
io::i2c::Address i2c_addr { 0x44 };
2828

29+
//! Transfer speed for I2C communication.
30+
io::i2c::TransferSpeed i2c_speed { io::i2c::TransferSpeed::Fast };
31+
2932
//! How often to read data from the sensor.
3033
system::Time read_interval { 0 };
3134

0 commit comments

Comments
 (0)