Struct max31865::Max31865[][src]

pub struct Max31865<SPI, NCS, RDY> { /* fields omitted */ }

Methods

impl<E, SPI, NCS, RDY> Max31865<SPI, NCS, RDY> where
    SPI: Write<u8, Error = E> + Transfer<u8, Error = E>,
    NCS: OutputPin,
    RDY: InputPin
[src]

Create a new MAX31865 module.

Arguments

  • spi - The SPI module to communicate on.
  • ncs - The chip select pin which should be set to a push pull output pin.
  • rdy - The ready pin which is set low by the MAX31865 controller whenever it has finished converting the output.

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.

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.

Read the raw resistance value and then perform conversion to degrees Celcius.

Remarks

The output value is the value in degrees Celcius multiplied by 100.

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.

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

impl<SPI, NCS, RDY> Send for Max31865<SPI, NCS, RDY> where
    NCS: Send,
    RDY: Send,
    SPI: Send

impl<SPI, NCS, RDY> Sync for Max31865<SPI, NCS, RDY> where
    NCS: Sync,
    RDY: Sync,
    SPI: Sync