pub struct PicoDevice {
pub handle: HandleMutex,
pub driver: ArcDriver,
pub variant: String,
pub serial: String,
pub usb_version: String,
pub max_adc_value: i16,
pub channel_ranges: HashMap<PicoChannel, Vec<PicoRange>>,
}
Expand description
Base Pico device
Fields§
§handle: HandleMutex
§driver: ArcDriver
§variant: String
§serial: String
§usb_version: String
§max_adc_value: i16
§channel_ranges: HashMap<PicoChannel, Vec<PicoRange>>
Implementations§
Source§impl PicoDevice
impl PicoDevice
Sourcepub fn try_open(
driver: &Arc<dyn PicoDriver>,
serial: Option<&str>,
) -> PicoResult<PicoDevice>
pub fn try_open( driver: &Arc<dyn PicoDriver>, serial: Option<&str>, ) -> PicoResult<PicoDevice>
Creates a PicoDevice with the supplied PicoDriver
and serial string.
If None
is passed for the serial, the first discovered device will be
opened.
use pico_common::Driver;
use pico_driver::LoadDriverExt;
use pico_device::PicoDevice;
// Load the required driver with a specific resolution
let driver = Driver::PS2000.try_load().unwrap();
let device1 = PicoDevice::try_open(&driver, Some("ABC/123")).unwrap();
let device2 = PicoDevice::try_open(&driver, Some("ABC/987")).unwrap();
assert_eq!(device1.variant, "2204A");
assert_eq!(device2.variant, "2205A");
pub fn get_channels(&self) -> Vec<PicoChannel>
Trait Implementations§
Source§impl Clone for PicoDevice
impl Clone for PicoDevice
Source§fn clone(&self) -> PicoDevice
fn clone(&self) -> PicoDevice
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PicoDevice
impl Debug for PicoDevice
Source§impl Display for PicoDevice
impl Display for PicoDevice
Auto Trait Implementations§
impl Freeze for PicoDevice
impl !RefUnwindSafe for PicoDevice
impl Send for PicoDevice
impl Sync for PicoDevice
impl Unpin for PicoDevice
impl !UnwindSafe for PicoDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more