[][src]Struct isis_imtq_api::Imtq

pub struct Imtq<T: ImtqFFI> { /* fields omitted */ }

Structure for interacting with the ISIS iMTQ

Methods

impl Imtq<ImtqRaw>[src]

pub fn imtq(bus: &str, addr: u16, timeout: i32) -> AdcsResult<Self>[src]

Constructor - Returns an AdcsResult<Imtq>

Opens a connection to the underlying Imtq device.

Arguments

  • bus - I2C bus device of iMTQ
  • addr - I2C address of iMTQ
  • timeout - Timeout for watchdog kicking (in seconds)

Example

extern crate adcs_api;
extern crate isis_imtq_api;
use adcs_api::*;
use isis_imtq_api::*;


let imtq = Imtq::imtq("/dev/i2c-0", 0x40, 60)?;

impl<T: ImtqFFI> Imtq<T>[src]

pub fn passthrough(
    &self,
    command: &[u8],
    rx_len: i32,
    delay_secs: i32,
    delay_nsecs: i64
) -> AdcsResult<Vec<u8>>
[src]

Passes a command directly to the Imtq device and returns back the response Useful for executing commands which have not been implemented in the API

Arguments

  • command - A string slice containing the command to be sent
  • rx_len - Expected length of command response
  • delay_secs - Delay between sending command and requesting response (seconds)
  • delay_nsecs - Delay between sending command and requesting response (nano seconds)

Example

extern crate adcs_api;
extern crate isis_imtq_api;
use adcs_api::*;
use isis_imtq_api::*;


let imtq = Imtq::imtq("/dev/i2c-0", 0x40, 60)?;
let cmd = vec![10, 10, 10, 10];
let result = imtq.passthrough(&cmd, 10, 0, 0)?;

pub fn reset(&self) -> AdcsResult<()>[src]

Reboots the iMTQ. Performing a reset will revert all configuration options to their default values.

Example

extern crate adcs_api;
extern crate isis_imtq_api;
use adcs_api::*;
use isis_imtq_api::*;


let imtq = Imtq::imtq("/dev/i2c-0", 0x40, 60)?;
imtq.reset()?;

Trait Implementations

impl<T: ImtqFFI> Drop for Imtq<T>[src]

Auto Trait Implementations

impl<T> Send for Imtq<T> where
    T: Send

impl<T> Unpin for Imtq<T> where
    T: Unpin

impl<T> Sync for Imtq<T> where
    T: Sync

impl<T> UnwindSafe for Imtq<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Imtq<T> where
    T: RefUnwindSafe

Blanket Implementations

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

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

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.

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

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

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