[−][src]Struct isis_imtq_api::Imtq
Structure for interacting with the ISIS iMTQ
Methods
impl Imtq<ImtqRaw>
[src]
[−]
impl Imtq<ImtqRaw>
pub fn imtq(bus: &str, addr: u16, timeout: i32) -> AdcsResult<Self>
[src]
[−]
pub fn imtq(bus: &str, addr: u16, timeout: i32) -> AdcsResult<Self>
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]
[−]
impl<T: ImtqFFI> Imtq<T>
pub fn passthrough(
&self,
command: &[u8],
rx_len: i32,
delay_secs: i32,
delay_nsecs: i64
) -> AdcsResult<Vec<u8>>
[src]
[−]
pub fn passthrough(
&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]
[−]
pub fn reset(&self) -> AdcsResult<()>
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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
[−]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
[−]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
[−]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
[−]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
[−]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
[−]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
[−]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
[−]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
[−]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
[−]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
[−]
fn borrow_mut(&mut self) -> &mut T