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]
impl<E, SPI, NCS, RDY> Max31865<SPI, NCS, RDY> where
SPI: Write<u8, Error = E> + Transfer<u8, Error = E>,
NCS: OutputPin,
RDY: InputPin,
pub fn new(spi: SPI, ncs: NCS, rdy: RDY) -> Result<Max31865<SPI, NCS, RDY>, E>
[src]
pub fn new(spi: SPI, ncs: NCS, rdy: RDY) -> Result<Max31865<SPI, NCS, RDY>, E>
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.
pub fn configure(
&mut self,
vbias: bool,
conversion_mode: bool,
one_shot: bool,
sensor_type: SensorType,
filter_mode: FilterMode
) -> Result<(), E>
[src]
pub fn configure(
&mut self,
vbias: bool,
conversion_mode: bool,
one_shot: bool,
sensor_type: SensorType,
filter_mode: FilterMode
) -> Result<(), E>
Updates the devices configuration.
Arguments
vbias
- Set totrue
to enable V_BIAS voltage, which is required to correctly perform conversion.Cloneconversion_mode
-true
to automatically perform conversion, otherwise normally off.one_shot
- Only perform detection once if set totrue
, otherwise repeats conversion.sensor_type
- Define whether a two, three or four wire sensor is used.Clonefilter_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.
pub fn set_calibration(&mut self, calib: u32) -> Result<(), E>
[src]
pub fn set_calibration(&mut self, calib: u32) -> Result<(), E>
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
.
pub fn read_default_conversion(&mut self) -> Result<u32, E>
[src]
pub fn read_default_conversion(&mut self) -> Result<u32, E>
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.
pub fn read_raw(&mut self) -> Result<u16, E>
[src]
pub fn read_raw(&mut self) -> Result<u16, E>
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.
pub fn is_ready(&self) -> Result<bool, E>
[src]
pub fn is_ready(&self) -> Result<bool, E>
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.