pub struct Ppk2 { /* private fields */ }
Expand description
PPK2 device representation.
Implementations§
source§impl Ppk2
impl Ppk2
sourcepub fn new<'a>(
path: impl Into<Cow<'a, str>>,
mode: MeasurementMode
) -> Result<Self>
pub fn new<'a>(
path: impl Into<Cow<'a, str>>,
mode: MeasurementMode
) -> Result<Self>
Create a new instance and configure the given MeasurementMode.
sourcepub fn send_command(&mut self, command: Command) -> Result<Vec<u8>>
pub fn send_command(&mut self, command: Command) -> Result<Vec<u8>>
Send a raw command and return the result.
sourcepub fn get_metadata(&mut self) -> Result<Metadata>
pub fn get_metadata(&mut self) -> Result<Metadata>
Get the device metadata.
sourcepub fn set_device_power(&mut self, power: DevicePower) -> Result<()>
pub fn set_device_power(&mut self, power: DevicePower) -> Result<()>
Enable or disable the device power.
sourcepub fn set_source_voltage(&mut self, vdd: SourceVoltage) -> Result<()>
pub fn set_source_voltage(&mut self, vdd: SourceVoltage) -> Result<()>
Set the voltage of the device voltage source.
sourcepub fn start_measurement(
self,
sps: usize
) -> Result<(Receiver<MeasurementMatch>, impl FnOnce() -> Result<Self>)>
pub fn start_measurement(
self,
sps: usize
) -> Result<(Receiver<MeasurementMatch>, impl FnOnce() -> Result<Self>)>
Start measurements. Returns a tuple of:
- Ppk2
, - Receiver of measurement::MeasurementMatch, and
- A closure that can be called to stop the measurement parsing pipeline and return the device.