[][src]Struct pico_driver::LoaderPS2000

pub struct LoaderPS2000 {
    pub driver: Driver,
    pub apply_fix: unsafe extern "system" fn(_: u32, _: i16) -> u32,
    pub open_unit: Arc<Mutex<unsafe extern "system" fn() -> i16>>,
    pub close_unit: unsafe extern "system" fn(_: i16) -> i16,
    pub ping_unit: unsafe extern "system" fn(_: i16) -> i16,
    pub get_unit_info: unsafe extern "system" fn(_: i16, _: *mut i8, _: i16, _: i16) -> i16,
    pub set_channel: unsafe extern "system" fn(_: i16, _: i16, _: i16, _: i16, _: i16) -> i16,
    pub run_streaming: unsafe extern "system" fn(_: i16, _: u32, _: i32, _: u32, _: i16, _: u32, _: u32) -> i16,
    pub stop_streaming: unsafe extern "system" fn(_: i16) -> i16,
    pub get_latest_streaming_values: unsafe extern "system" fn(_: i16, _: unsafe extern "C" fn(overview_buffers: *const *const i16, overflow: i16, triggered_at: u32, triggered: i16, auto_stop: i16, n_values: u32)) -> i16,
    // some fields omitted
}

Dynamically loads the ps2000 driver

Fields

driver: Driverapply_fix: unsafe extern "system" fn(_: u32, _: i16) -> u32open_unit: Arc<Mutex<unsafe extern "system" fn() -> i16>>

Only a single unit can be opened at any one time

close_unit: unsafe extern "system" fn(_: i16) -> i16ping_unit: unsafe extern "system" fn(_: i16) -> i16get_unit_info: unsafe extern "system" fn(_: i16, _: *mut i8, _: i16, _: i16) -> i16set_channel: unsafe extern "system" fn(_: i16, _: i16, _: i16, _: i16, _: i16) -> i16run_streaming: unsafe extern "system" fn(_: i16, _: u32, _: i32, _: u32, _: i16, _: u32, _: u32) -> i16stop_streaming: unsafe extern "system" fn(_: i16) -> i16get_latest_streaming_values: unsafe extern "system" fn(_: i16, _: unsafe extern "C" fn(overview_buffers: *const *const i16, overflow: i16, triggered_at: u32, triggered: i16, auto_stop: i16, n_values: u32)) -> i16

Implementations

impl LoaderPS2000[src]

pub fn load<P: AsRef<Path>>(path: P) -> Result<LoaderPS2000, DriverLoadError>[src]

Attempts to load ps2000 driver

pub fn get_latest_streaming_values_wrap<F: FnMut(*const *const i16, i16, u32, i16, i16, u32)>(
    &self,
    handle: i16,
    callback: F
) -> i16
[src]

Wraps the c callback with libffi so we can use closures

This is required because the ps2000 driver doesn't pass a context object through to the callback. Without a context object, we cannot know which device the callback refers to. libffi lets us keep the context.

Trait Implementations

impl Clone for LoaderPS2000[src]

impl Debug for LoaderPS2000[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.