Struct anyleaf::rtd::Rtd[][src]

pub struct Rtd<CS: OutputPin> { /* fields omitted */ }
Expand description

A struct used to describe the RTD. Owns the cs pin.

Implementations

Updates the devices configuration.

Arguments

  • vbias - Set to true to enable V_BIAS voltage, which is required to correctly perform conversion.Clone
  • conversion_mode - true to automatically perform conversion, otherwise normally off.
  • one_shot - Only perform detection once if set to true, otherwise repeats conversion.
  • sensor_type - Define whether a two, three or four wire sensor is used.Clone
  • filter_mode - Specify the mains frequency that should be used to filter out noise, e.g. 50Hz in Europe.

Remarks

This will update the configuration register of the MAX31865 register. If the device doesn’t properly react to this, add a delay after calling new to increase the time that the chip select line is set high.

Note: The correct sensor configuration also requires changes to the PCB! Make sure to read the datasheet concerning this.

Read the raw RTD value.

Remarks

The raw value is the value of the combined MSB and LSB registers. The first 15 bits specify the ohmic value in relation to the reference resistor (i.e. 2^15 - 1 would be the exact same resistance as the reference resistor). See manual for further information. The last bit specifies if the conversion was successful.

Measure RTD resistance, in Ohms.

Measure temperature, in Celsius

Return the configuration register data.

Find the fault status. See Table 7.

todo: Sort this out.

Set the calibration reference resistance. This can be used to calibrate inaccuracies of both the reference resistor and the PT100 element.

Arguments

  • calib - A 32 bit integer specifying the reference resistance in ohms multiplied by 100, e.g. 40000 for 400 Ohms

Remarks

You can perform calibration by putting the sensor in boiling (100 degrees Celcius) water and then measuring the raw value using read_raw. Calculate calib as (13851 << 15) / raw >> 1.

Determine if a new conversion is available

Remarks

When the module is finished converting the temperature it sets the ready pin to low. It is automatically returned to high upon reading the RTD registers.

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

Performs the conversion.

Performs the conversion.

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.