Struct ufire_ec::EcProbe [] [src]

pub struct EcProbe { /* fields omitted */ }

Methods

impl EcProbe
[src]

[src]

Create a new EcProbe object

Pass the i2c port to use, it must be a software overlay device, and I2C address.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();

[src]

Start a temperature measurement

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.measure_temp();

[src]

Calibrates the probe using a single point using a mS value.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.calibrate_single(500.0);

[src]

Calibrates the dual-point values for the low reading, in mS, and saves them in the devices's EEPROM.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.calibrate_probe_low(50.0);

[src]

Calibrates the dual-point values for the high reading, in mS, and saves them in the devices's EEPROM.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.calibrate_probe_high(56.0);

[src]

Starts an EC measurement.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.measure_ec(0.019);

[src]

Starts an EC measurement and returns the salinity in PSU.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.measure_salinity();

[src]

Determines the probes dry reading.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.calibrate_dry();

[src]

Sets all the values, in mS, for dual point calibration and saves them in the devices's EEPROM.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.set_dual_point_calibration(50.0, 58.0, 48.0, 56.0);

[src]

Returns the cell-constant from the device.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.get_k();

[src]

Sets the cell-constant and saves it in the devices's EEPROM.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.set_k(1.0);

[src]

Sets the temperature constant to use for compensation and saves it in the devices's EEPROM.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.set_temp_constant(20);

[src]

Returns the temperature constant from the device.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.get_temp_constant();

[src]

Returns the single-point offset from the device.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.get_calibrate_offset();

[src]

Returns the dry calibration value.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.get_calibrate_dry();

[src]

Returns the dual-point calibration high reference value.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.set_dual_point_calibration(0.0, 500.0, 0.0, 0.0);

[src]

Returns the dual-point calibration high reading value.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.set_dual_point_calibration(0.0, 0.0, 0.0, 553.0);
assert_eq!(553.0, ec.get_calibrate_high_reading().unwrap());

[src]

Returns the dual-point calibration low reference value.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.set_dual_point_calibration(50.0, 0.0, 0.0, 0.0);
assert_eq!(50.0, ec.get_calibrate_low_reference().unwrap());

[src]

Returns the dual-point calibration low reading value.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.set_dual_point_calibration(0.0, 0.0, 34.0, 0.0);
assert_eq!(34.0, ec.get_calibrate_low_reading().unwrap());

[src]

Configures the device to use temperature compensation or not.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.use_temperature_compensation(true);
assert_eq!(1, ec.using_temperature_compensation().unwrap());

[src]

Configures device to use dual-point calibration.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.use_dual_point(true);
assert_eq!(1, ec.using_dual_point().unwrap());

[src]

Returns the firmware version of the device.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
assert_eq!(0x1c, ec.get_version().unwrap());

[src]

Resets all the stored calibration information.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.reset();
assert_eq!(true, ec.get_calibrate_offset().unwrap().is_nan());
assert_eq!(true, ec.get_calibrate_low_reading().unwrap().is_nan());
assert_eq!(true, ec.get_calibrate_high_reading().unwrap().is_nan());
assert_eq!(true, ec.get_calibrate_low_reference().unwrap().is_nan());
assert_eq!(true, ec.get_calibrate_high_reference().unwrap().is_nan());

[src]

Configures the device to use temperature compensation.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.use_temperature_compensation(true);
assert_eq!(1, ec.using_temperature_compensation().unwrap());

[src]

Configures device to use dual-point calibration.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
ec.use_dual_point(true);
assert_eq!(1, ec.using_dual_point().unwrap());

[src]

Sets the I2C address of the device.

Example

let mut ec = ufire_ec::EcProbe::new("/dev/i2c-3", 0x3c).unwrap();
// ec.set_i2c_address(0x4f);

[src]

[src]

[src]

Trait Implementations

Auto Trait Implementations

impl Send for EcProbe

impl Sync for EcProbe