[][src]Struct pico_driver::LoaderCommon

pub struct LoaderCommon {
    pub driver: Driver,
    pub apply_fix: unsafe extern "system" fn(_: u32, _: i16) -> u32,
    pub enumerate_units: unsafe extern "system" fn(_: *mut i16, _: *mut i8, _: *mut i16) -> u32,
    pub open_unit: Arc<Mutex<OpenUnitFn>>,
    pub close_unit: unsafe extern "system" fn(_: i16) -> u32,
    pub ping_unit: unsafe extern "system" fn(_: i16) -> u32,
    pub change_power_source: Option<unsafe extern "system" fn(_: i16, _: u32) -> u32>,
    pub get_unit_info: unsafe extern "system" fn(_: i16, _: *mut i8, _: i16, _: *mut i16, _: u32) -> u32,
    pub get_channel_info: Option<unsafe extern "system" fn(_: i16, _: i32, _: i32, _: *mut i32, _: *mut i32, _: i32) -> u32>,
    pub get_maximum_value: Option<unsafe extern "system" fn(_: i16, _: *mut i16) -> u32>,
    pub set_channel: SetChannelFn,
    pub run_streaming: RunStreamingFn,
    pub stop_streaming: unsafe extern "system" fn(_: i16) -> u32,
    pub set_data_buffer: SetBufferFn,
    pub get_latest_streaming_values: unsafe extern "system" fn(_: i16, _: unsafe extern "C" fn(handle: i16, no_df_samples: i32, start_index: u32, overflow: i16, trigger_at: u32, triggered: i16, auto_stop: i16, context: *mut c_void), _: *mut c_void) -> u32,
    pub set_probe_callback: Option<unsafe extern "system" fn(_: i16, _: unsafe extern "system" fn(handle: i16, status: u32, probes: *mut UserProbeInteractions, n_probes: u32)) -> u32>,
    // some fields omitted
}

Dynamically loads various Pico drivers

Fields

driver: Driverapply_fix: unsafe extern "system" fn(_: u32, _: i16) -> u32enumerate_units: unsafe extern "system" fn(_: *mut i16, _: *mut i8, _: *mut i16) -> u32open_unit: Arc<Mutex<OpenUnitFn>>close_unit: unsafe extern "system" fn(_: i16) -> u32ping_unit: unsafe extern "system" fn(_: i16) -> u32change_power_source: Option<unsafe extern "system" fn(_: i16, _: u32) -> u32>get_unit_info: unsafe extern "system" fn(_: i16, _: *mut i8, _: i16, _: *mut i16, _: u32) -> u32get_channel_info: Option<unsafe extern "system" fn(_: i16, _: i32, _: i32, _: *mut i32, _: *mut i32, _: i32) -> u32>get_maximum_value: Option<unsafe extern "system" fn(_: i16, _: *mut i16) -> u32>set_channel: SetChannelFnrun_streaming: RunStreamingFnstop_streaming: unsafe extern "system" fn(_: i16) -> u32set_data_buffer: SetBufferFnget_latest_streaming_values: unsafe extern "system" fn(_: i16, _: unsafe extern "C" fn(handle: i16, no_df_samples: i32, start_index: u32, overflow: i16, trigger_at: u32, triggered: i16, auto_stop: i16, context: *mut c_void), _: *mut c_void) -> u32set_probe_callback: Option<unsafe extern "system" fn(_: i16, _: unsafe extern "system" fn(handle: i16, status: u32, probes: *mut UserProbeInteractions, n_probes: u32)) -> u32>

Implementations

impl LoaderCommon[src]

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

Attempts to load a driver

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

Wraps the c callback with libffi so we can use closures

libffi isn't the only way to do this because we have c_void context. However, we already need libffi for the ps2000 driver and this is easy.

Trait Implementations

impl Clone for LoaderCommon[src]

impl Debug for LoaderCommon[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.