[−][src]Struct ufire_iso_ise::IseProbe
Methods
impl IseProbe
[src]
pub fn new(
filename: &'static str,
address: u16
) -> Result<Self, Box<LinuxI2CError>>
[src]
filename: &'static str,
address: u16
) -> Result<Self, Box<LinuxI2CError>>
Create a new IseProbe object
Pass the i2c port to use, it must be a software overlay device, and I2C address.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap();
pub fn measure_mv(&mut self) -> Result<f32, Box<LinuxI2CError>>
[src]
Start a probe measurement
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.measure_mv();
pub fn measure_ph(&mut self, temp_c: f32) -> Result<f32, Box<LinuxI2CError>>
[src]
Start a pH measurement
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.measure_ph();
pub fn ph_to_mv(&mut self, ph: f32) -> Result<f32, Box<LinuxI2CError>>
[src]
Converts a pH measurement into mV for use with calibration.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); assert_eq!(0.0, mv.ph_to_mv(7.0).unwrap());
pub fn measure_temp(&mut self) -> Result<f32, Box<LinuxI2CError>>
[src]
Start a temperature measurement
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.measure_temp();
pub fn set_temp(&mut self, temp_c: f32) -> Result<(), Box<LinuxI2CError>>
[src]
Sets the temperature used by the device.
Example
let mut ec = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3c).unwrap(); ec.set_temp(20.2);
pub fn calibrate_single(
&mut self,
solution_mv: f32
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
solution_mv: f32
) -> Result<(), Box<LinuxI2CError>>
Calibrates the probe using a single point using a mV value.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.calibrate_single(500.0);
pub fn calibrate_probe_low(
&mut self,
solution_mv: f32
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
solution_mv: f32
) -> Result<(), Box<LinuxI2CError>>
Calibrates the dual-point values for the low reading, in mV, and saves them in the devices's EEPROM.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.calibrate_probe_low(50.0);
pub fn calibrate_probe_high(
&mut self,
solution_mv: f32
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
solution_mv: f32
) -> Result<(), Box<LinuxI2CError>>
Calibrates the dual-point values for the high reading, in mV, and saves them in the devices's EEPROM.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.calibrate_probe_low(500.0);
pub fn set_dual_point_calibration(
&mut self,
ref_low: f32,
ref_high: f32,
read_low: f32,
read_high: f32
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
ref_low: f32,
ref_high: f32,
read_low: f32,
read_high: f32
) -> Result<(), Box<LinuxI2CError>>
Sets all the values, in mV, for dual point calibration and saves them in the devices's EEPROM.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.set_dual_point_calibration(50.0, 500.0, 34.0, 553.0);
pub fn get_calibrate_offset(&mut self) -> Result<f32, Box<LinuxI2CError>>
[src]
Returns the single-point offset from the device.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.get_calibrate_offset();
pub fn get_calibrate_high_reference(
&mut self
) -> Result<f32, Box<LinuxI2CError>>
[src]
&mut self
) -> Result<f32, Box<LinuxI2CError>>
Returns the dual-point calibration high reference value.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.set_dual_point_calibration(0.0, 500.0, 0.0, 0.0);
pub fn get_calibrate_high_reading(&mut self) -> Result<f32, Box<LinuxI2CError>>
[src]
Returns the dual-point calibration high reading value.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.set_dual_point_calibration(0.0, 0.0, 0.0, 553.0); assert_eq!(553.0, mv.get_calibrate_high_reading().unwrap());
pub fn get_calibrate_low_reference(&mut self) -> Result<f32, Box<LinuxI2CError>>
[src]
Returns the dual-point calibration low reference value.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.set_dual_point_calibration(50.0, 0.0, 0.0, 0.0); assert_eq!(50.0, mv.get_calibrate_low_reference().unwrap());
pub fn get_calibrate_low_reading(&mut self) -> Result<f32, Box<LinuxI2CError>>
[src]
Returns the dual-point calibration low reading value.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.set_dual_point_calibration(0.0, 0.0, 34.0, 0.0); assert_eq!(34.0, mv.get_calibrate_low_reading().unwrap());
pub fn get_version(&mut self) -> Result<u8, Box<LinuxI2CError>>
[src]
Returns the firmware version of the device.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); assert_eq!(0x1, mv.get_version().unwrap());
pub fn get_firmware(&mut self) -> Result<u8, Box<LinuxI2CError>>
[src]
Returns the firmware version of the device.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3c).unwrap(); assert_eq!(0x1, mv.get_version().unwrap());
pub fn reset(&mut self) -> Result<(), Box<LinuxI2CError>>
[src]
Resets all the stored calibration information.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.reset(); assert_eq!(true, mv.get_calibrate_offset().unwrap().is_nan()); assert_eq!(true, mv.get_calibrate_low_reading().unwrap().is_nan()); assert_eq!(true, mv.get_calibrate_high_reading().unwrap().is_nan()); assert_eq!(true, mv.get_calibrate_low_reference().unwrap().is_nan()); assert_eq!(true, mv.get_calibrate_high_reference().unwrap().is_nan());
pub fn set_i2c_address(
&mut self,
i2c_address: u16
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
i2c_address: u16
) -> Result<(), Box<LinuxI2CError>>
Sets the I2C address of the device.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); // mv.set_i2c_address(0x4f);
pub fn read_eeprom(&mut self, address: u8) -> Result<f32, Box<LinuxI2CError>>
[src]
Sets all the values, in mV, for dual point calibration and saves them in the devices's EEPROM.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.write_eeprom(100, 295.0); assert_eq!(295.0, mv.read_eeprom(100).unwrap());
pub fn write_eeprom(
&mut self,
address: u8,
value: f32
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
address: u8,
value: f32
) -> Result<(), Box<LinuxI2CError>>
Sets all the values, in mV, for dual point calibration and saves them in the devices's EEPROM.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.write_eeprom(100, 295.0); assert_eq!(295.0, mv.read_eeprom(100).unwrap());
pub fn get_probe_potential(&mut self) -> Result<f32, Box<LinuxI2CError>>
[src]
Returns the saved probe potential from EEPROM.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.set_probe_potential(245.0).unwrap(); assert_eq!(245.0, mv.get_probe_potential().unwrap());
pub fn set_probe_potential(
&mut self,
potential: f32
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
potential: f32
) -> Result<(), Box<LinuxI2CError>>
Saves probe potential in EEPROM.
Example
let mut mv = ufire_ise::IseProbe::new("/dev/i2c-3", 0x3f).unwrap(); mv.set_probe_potential(245.0).unwrap(); assert_eq!(245.0, mv.get_probe_potential().unwrap());
pub fn _write_register(
&mut self,
register: u8,
f_val: f32
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
register: u8,
f_val: f32
) -> Result<(), Box<LinuxI2CError>>
pub fn _read_register(
&mut self,
register: u8
) -> Result<f32, Box<LinuxI2CError>>
[src]
&mut self,
register: u8
) -> Result<f32, Box<LinuxI2CError>>
pub fn _change_register(
&mut self,
register: u8
) -> Result<(), Box<LinuxI2CError>>
[src]
&mut self,
register: u8
) -> Result<(), Box<LinuxI2CError>>
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,