[−][src]Struct isis_imtq_api::Imtq
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 iMTQaddr
- I2C address of iMTQtimeout
- 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]
&self,
command: &[u8],
rx_len: i32,
delay_secs: i32,
delay_nsecs: i64
) -> AdcsResult<Vec<u8>>
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 sentrx_len
- Expected length of command responsedelay_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
Auto Trait Implementations
impl<T> Unpin for Imtq<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for Imtq<T> where
T: Sync,
T: Sync,
impl<T> Send for Imtq<T> where
T: Send,
T: Send,
impl<T> UnwindSafe for Imtq<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Imtq<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,