pub struct Imtq<T: ImtqFFI> { /* fields omitted */ }
Structure for interacting with the ISIS iMTQ
Constructor - Returns an AdcsResult<Imtq>
Opens a connection to the underlying Imtq device.
bus
- I2C bus device of iMTQ
addr
- I2C address of iMTQ
timeout
- Timeout for watchdog kicking (in seconds)
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)?;
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
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)
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)?;
Reboots the iMTQ.
Performing a reset will revert all configuration options
to their default values.
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()?;
Executes the destructor for this type. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more