opentitanlib::transport::ultradebug::mpsse

Struct Context

Source
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

Source

pub fn new(device: Device) -> Result<Self>

Create a new MPSSE Context given an FTDI device.

Source

pub fn execute(&mut self, commands: &mut [Command<'_, '_>]) -> Result<()>

Execute a slice of commands on the target FTDI device.

Source

pub fn gpio_get(&mut self) -> Result<u8>

Get the GPIO state on the target FTDI device.

Source

pub fn gpio_set(&mut self, pin: u8, high: bool) -> Result<()>

Set the GPIO state of an individual pin on the FTDI device.

Source

pub fn gpio_set_direction(&mut self, pin: u8, output: bool) -> Result<()>

Set the direction of an individual pin on the FTDI device.

Source

pub fn set_clock_frequency(&mut self, frequency: u32) -> Result<()>

Set the clock frequency for serial opertions on the FTDI device.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V