pub struct Context {
pub device: Device,
pub max_clock_frequency: u32,
pub clock_frequency: u32,
pub gpio_direction: GpioDirection,
pub gpio_value: u8,
pub receive_timeout: Duration,
}
Expand description
An MPSSE Context
is the high-level interface to an MPSSE FTDI interface.
Fields§
§device: Device
§max_clock_frequency: u32
§clock_frequency: u32
§gpio_direction: GpioDirection
§gpio_value: u8
§receive_timeout: Duration
Implementations§
Source§impl Context
impl Context
Sourcepub fn execute(&mut self, commands: &mut [Command<'_, '_>]) -> Result<()>
pub fn execute(&mut self, commands: &mut [Command<'_, '_>]) -> Result<()>
Execute a slice of commands
on the target FTDI device.
Sourcepub fn gpio_set(&mut self, pin: u8, high: bool) -> Result<()>
pub fn gpio_set(&mut self, pin: u8, high: bool) -> Result<()>
Set the GPIO state of an individual pin on the FTDI device.
Sourcepub fn gpio_set_direction(&mut self, pin: u8, output: bool) -> Result<()>
pub fn gpio_set_direction(&mut self, pin: u8, output: bool) -> Result<()>
Set the direction of an individual pin on the FTDI device.
Sourcepub fn set_clock_frequency(&mut self, frequency: u32) -> Result<()>
pub fn set_clock_frequency(&mut self, frequency: u32) -> Result<()>
Set the clock frequency for serial opertions on the FTDI device.
Sourcepub fn invalid_command(&mut self) -> Result<()>
pub fn invalid_command(&mut self) -> Result<()>
Send an invalid command to the FTDI device (this is typically used in a debugging context to ensure synchronization with the FTDI device).
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more