Struct pico_sdk::prelude::PicoDevice [−][src]
pub struct PicoDevice { pub handle: Arc<Mutex<RawMutex, Option<i16>>>, pub driver: Arc<dyn PicoDriver + 'static>, pub variant: String, pub serial: String, pub usb_version: String, pub max_adc_value: i16, pub channel_ranges: HashMap<PicoChannel, Vec<PicoRange, Global>, RandomState>, }
Expand description
Base Pico device
Fields
handle: Arc<Mutex<RawMutex, Option<i16>>>
driver: Arc<dyn PicoDriver + 'static>
variant: String
serial: String
usb_version: String
max_adc_value: i16
channel_ranges: HashMap<PicoChannel, Vec<PicoRange, Global>, RandomState>
Implementations
impl PicoDevice
[src]
impl PicoDevice
[src]pub fn try_open(
driver: &Arc<dyn PicoDriver + 'static>,
serial: Option<&str>
) -> Result<PicoDevice, PicoError>
[src]
pub fn try_open(
driver: &Arc<dyn PicoDriver + 'static>,
serial: Option<&str>
) -> Result<PicoDevice, PicoError>
[src]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, Global>
[src]
Trait Implementations
impl Clone for PicoDevice
[src]
impl Clone for PicoDevice
[src]pub fn clone(&self) -> PicoDevice
[src]
pub fn clone(&self) -> PicoDevice
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for PicoDevice
[src]
impl Debug for PicoDevice
[src]impl Display for PicoDevice
[src]
impl Display for PicoDevice
[src]impl Drop for PicoDevice
[src]
impl Drop for PicoDevice
[src]impl From<PicoDevice> for PicoStreamingDevice
[src]
impl From<PicoDevice> for PicoStreamingDevice
[src]pub fn from(d: PicoDevice) -> PicoStreamingDevice
[src]
pub fn from(d: PicoDevice) -> PicoStreamingDevice
[src]Performs the conversion.
impl ToStreamDevice for PicoDevice
[src]
impl ToStreamDevice for PicoDevice
[src]pub fn into_streaming_device(self) -> PicoStreamingDevice
[src]
Auto Trait Implementations
impl !RefUnwindSafe for PicoDevice
impl Send for PicoDevice
impl Sync for PicoDevice
impl Unpin for PicoDevice
impl !UnwindSafe for PicoDevice
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Pointable for T
impl<T> Pointable for T
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more