Struct tmp1x2::Tmp1x2

source ·
pub struct Tmp1x2<I2C> { /* private fields */ }
Expand description

TMP1X2 device driver.

Implementations

Enable the sensor.

Disable the sensor (shutdown).

Enable the extended measurement mode.

This allows measurement of temperatures above 128°C.

Disable the extended measurement mode.

This puts the device in normal measurement mode. It will not measure temperatures above 128°C.

Trigger a one-shot measurement when in shutdown mode (disabled).

This allows triggering a single temperature measurement when in shutdown mode. The device returns to the shutdown state at the completion of the temperature conversion. This reduces power consumption when continuous temperature monitoring is not required.

See also: is_one_shot_measurement_result_ready()

Set the conversion rate when in continuous conversion mode.

Set the high temperature threshold.

The value provided will be capped to be in the interval [-128.0, 127.9375] in normal mode and [-256.0, 255.875] in extended mode.

Set the low temperature threshold.

The value provided will be capped to be in the interval [-128.0, 127.9375] in normal mode and [-256.0, 255.875] in extended mode.

Set the fault queue.

Set the number of consecutive faults that will trigger an alert.

Set the alert polarity.

Set the thermostat mode.

Reset the internal state of this driver to the default values.

Note: This does not alter the state or configuration of the device.

This resets the cached configuration register value in this driver to the power-up (reset) configuration of the device.

This needs to be called after performing a reset on the device, for example through an I2C general-call Reset command, which was not done through this driver to ensure that the configurations in the device and in the driver match.

Read the temperature from the sensor.

Read whether the one-shot measurement result is ready.

See also: trigger_one_shot_measurement()

Read whether an alert is active as defined by the comparator mode.

NOTE: This ignores the thermostat mode setting and always corresponds to the activation status as defined by the comparator mode.

This method takes into account the alert polarity selected.

See also: ThermostatMode, AlertPolarity.

Create new instance of the TMP102 or TMP112x device.

Destroy driver instance, return I²C bus instance.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.