[][src]Struct pico_sdk::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<RawMutex, 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(i16, i32, u32, i16, u32, i16, i16, *mut c_void), *mut c_void) -> u32,
    pub set_probe_callback: Option<unsafe extern "system" fn(i16, unsafe extern "system" fn(i16, u32, *mut UserProbeInteractions, 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<RawMutex, 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(i16, i32, u32, i16, u32, i16, i16, *mut c_void), *mut c_void) -> u32set_probe_callback: Option<unsafe extern "system" fn(i16, unsafe extern "system" fn(i16, u32, *mut UserProbeInteractions, u32)) -> u32>

Implementations

impl LoaderCommon[src]

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

Attempts to load a driver

pub fn get_latest_streaming_values_wrap<F>(
    &self,
    handle: i16,
    callback: F
) -> u32 where
    F: FnMut(i16, i32, u32, i16, u32, i16, i16, *mut c_void), 
[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> Pointable for T

type Init = T

The type for initializers.

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.