[−][src]Trait pico_sdk::prelude::PicoDriver
Common trait implemented for every driver
Required methods
fn get_driver(&self) -> Driver
Gets the underlying driver type
fn get_version(&self) -> Result<String, PicoError>
Gets the driver version string
fn get_path(&self) -> Result<Option<String>, PicoError>
Gets the path to the loaded driver
fn enumerate_units(&self) -> Result<Vec<String>, PicoError>
Returns a list of discovered serial numbers
fn open_unit(&self, serial: Option<&'a str>) -> Result<i16, PicoError>
Opens a device, optionally with a specific serial number
fn ping_unit(&self, handle: i16) -> Result<(), PicoError>
Ping a unit to see if it's still connected
fn maximum_value(&self, handle: i16) -> Result<i16, PicoError>
Get the maximum expected ADC value. This is required to scale to volts
fn close_unit(&self, handle: i16) -> Result<(), PicoError>
Close the specified unit
fn get_unit_info(
&self,
handle: i16,
info_type: PicoInfo
) -> Result<String, PicoError>
&self,
handle: i16,
info_type: PicoInfo
) -> Result<String, PicoError>
Get one of the unit info strings
fn get_channel_ranges(
&self,
handle: i16,
channel: PicoChannel
) -> Result<Vec<PicoRange>, PicoError>
&self,
handle: i16,
channel: PicoChannel
) -> Result<Vec<PicoRange>, PicoError>
Get valid ranges for the specified channel
fn set_channel(
&self,
handle: i16,
channel: PicoChannel,
config: &ChannelConfig
) -> Result<(), PicoError>
&self,
handle: i16,
channel: PicoChannel,
config: &ChannelConfig
) -> Result<(), PicoError>
Set up a channel with the supplied config
fn set_data_buffer(
&self,
handle: i16,
channel: PicoChannel,
buffer: Arc<RwLock<RawRwLock, Pin<Vec<i16>>>>,
buffer_len: usize
) -> Result<(), PicoError>
&self,
handle: i16,
channel: PicoChannel,
buffer: Arc<RwLock<RawRwLock, Pin<Vec<i16>>>>,
buffer_len: usize
) -> Result<(), PicoError>
Give the driver a buffer to write data into
fn start_streaming(
&self,
handle: i16,
sample_config: &SampleConfig
) -> Result<SampleConfig, PicoError>
&self,
handle: i16,
sample_config: &SampleConfig
) -> Result<SampleConfig, PicoError>
Starts the device streaming
fn get_latest_streaming_values(
&self,
handle: i16,
callback: Box<dyn FnMut(usize, usize) + 'a, Global>
) -> Result<(), PicoError>
&self,
handle: i16,
callback: Box<dyn FnMut(usize, usize) + 'a, Global>
) -> Result<(), PicoError>
Gets the latest streaming values. The ps2000 has a different callback to the rest of the drivers.
fn stop_streaming(&self, handle: i16) -> Result<(), PicoError>
Stops the device streaming
Provided methods
fn check_version(&self) -> Result<(), DriverLoadError>
Check that the driver meets the minimum version tested with this wrapper
Implementors
impl PicoDriver for DriverCommon[src]
pub fn get_driver(&self) -> Driver[src]
pub fn get_version(&self) -> Result<String, PicoError>[src]
pub fn get_path(&self) -> Result<Option<String>, PicoError>[src]
pub fn enumerate_units(&self) -> Result<Vec<String>, PicoError>[src]
pub fn open_unit(&self, serial: Option<&str>) -> Result<i16, PicoError>[src]
pub fn ping_unit(&self, handle: i16) -> Result<(), PicoError>[src]
pub fn maximum_value(&self, handle: i16) -> Result<i16, PicoError>[src]
pub fn close_unit(&self, handle: i16) -> Result<(), PicoError>[src]
pub fn get_unit_info(
&self,
handle: i16,
info_type: PicoInfo
) -> Result<String, PicoError>[src]
&self,
handle: i16,
info_type: PicoInfo
) -> Result<String, PicoError>
pub fn get_channel_ranges(
&self,
handle: i16,
channel: PicoChannel
) -> Result<Vec<PicoRange>, PicoError>[src]
&self,
handle: i16,
channel: PicoChannel
) -> Result<Vec<PicoRange>, PicoError>
pub fn set_channel(
&self,
handle: i16,
channel: PicoChannel,
config: &ChannelConfig
) -> Result<(), PicoError>[src]
&self,
handle: i16,
channel: PicoChannel,
config: &ChannelConfig
) -> Result<(), PicoError>
pub fn set_data_buffer(
&self,
handle: i16,
channel: PicoChannel,
buffer: Arc<RwLock<RawRwLock, Pin<Vec<i16>>>>,
buffer_len: usize
) -> Result<(), PicoError>[src]
&self,
handle: i16,
channel: PicoChannel,
buffer: Arc<RwLock<RawRwLock, Pin<Vec<i16>>>>,
buffer_len: usize
) -> Result<(), PicoError>
pub fn start_streaming(
&self,
handle: i16,
sample_config: &SampleConfig
) -> Result<SampleConfig, PicoError>[src]
&self,
handle: i16,
sample_config: &SampleConfig
) -> Result<SampleConfig, PicoError>
pub fn get_latest_streaming_values(
&self,
handle: i16,
callback: Box<dyn FnMut(usize, usize) + 'a, Global>
) -> Result<(), PicoError>[src]
&self,
handle: i16,
callback: Box<dyn FnMut(usize, usize) + 'a, Global>
) -> Result<(), PicoError>
pub fn stop_streaming(&self, handle: i16) -> Result<(), PicoError>[src]
impl PicoDriver for DriverPS2000[src]
pub fn get_driver(&self) -> Driver[src]
pub fn get_version(&self) -> Result<String, PicoError>[src]
pub fn get_path(&self) -> Result<Option<String>, PicoError>[src]
pub fn enumerate_units(&self) -> Result<Vec<String>, PicoError>[src]
pub fn open_unit(&self, serial: Option<&str>) -> Result<i16, PicoError>[src]
pub fn ping_unit(&self, handle: i16) -> Result<(), PicoError>[src]
pub fn maximum_value(&self, i16) -> Result<i16, PicoError>[src]
pub fn close_unit(&self, handle: i16) -> Result<(), PicoError>[src]
pub fn get_unit_info(
&self,
handle: i16,
info_type: PicoInfo
) -> Result<String, PicoError>[src]
&self,
handle: i16,
info_type: PicoInfo
) -> Result<String, PicoError>
pub fn get_channel_ranges(
&self,
handle: i16,
channel: PicoChannel
) -> Result<Vec<PicoRange>, PicoError>[src]
&self,
handle: i16,
channel: PicoChannel
) -> Result<Vec<PicoRange>, PicoError>
pub fn set_channel(
&self,
handle: i16,
channel: PicoChannel,
config: &ChannelConfig
) -> Result<(), PicoError>[src]
&self,
handle: i16,
channel: PicoChannel,
config: &ChannelConfig
) -> Result<(), PicoError>
pub fn set_data_buffer(
&self,
handle: i16,
channel: PicoChannel,
buffer: Arc<RwLock<RawRwLock, Pin<Vec<i16>>>>,
_buffer_len: usize
) -> Result<(), PicoError>[src]
&self,
handle: i16,
channel: PicoChannel,
buffer: Arc<RwLock<RawRwLock, Pin<Vec<i16>>>>,
_buffer_len: usize
) -> Result<(), PicoError>
pub fn start_streaming(
&self,
handle: i16,
sample_config: &SampleConfig
) -> Result<SampleConfig, PicoError>[src]
&self,
handle: i16,
sample_config: &SampleConfig
) -> Result<SampleConfig, PicoError>
pub fn get_latest_streaming_values(
&self,
handle: i16,
callback: Box<dyn FnMut(usize, usize) + 'a, Global>
) -> Result<(), PicoError>[src]
&self,
handle: i16,
callback: Box<dyn FnMut(usize, usize) + 'a, Global>
) -> Result<(), PicoError>