opentitanlib::transport::hyperdebug::i2c

Struct HyperdebugI2cBus

Source
pub struct HyperdebugI2cBus { /* private fields */ }

Implementations§

Source§

impl HyperdebugI2cBus

Source

pub fn open( inner: &Rc<Inner>, i2c_interface: &BulkInterface, cmsis_encapsulation: bool, supports_i2c_device: bool, idx: u8, mode: Mode, ) -> Result<Self>

Trait Implementations§

Source§

impl Bus for HyperdebugI2cBus

Source§

fn get_max_speed(&self) -> Result<u32>

Gets the maximum allowed speed of the I2C bus.

Source§

fn set_max_speed(&self, max_speed: u32) -> Result<()>

Sets the maximum allowed speed of the I2C bus, typical values are 100_000, 400_000 or 1_000_000.

Source§

fn set_mode(&self, mode: Mode) -> Result<()>

Source§

fn set_pins( &self, serial_clock: Option<&Rc<dyn GpioPin>>, serial_data: Option<&Rc<dyn GpioPin>>, gsc_ready: Option<&Rc<dyn GpioPin>>, ) -> Result<()>

Sets which pins should be used for I2C communication. None value means use the same pin as previously, or the implementation default if never before specified. This call is not supported by most backend transports, and ones that do support it may still have restrictions on which set of pins can be used in which roles.
Source§

fn set_default_address(&self, addr: u8) -> Result<()>

Sets the “default” device address, used in cases when not overriden by parameter to run_transaction().
Source§

fn run_transaction( &self, addr: Option<u8>, transaction: &mut [Transfer<'_, '_>], ) -> Result<()>

Runs a I2C transaction composed from the slice of Transfer objects. If addr is None, then the last value given to set_default_adress() is used instead.
Source§

fn get_device_status(&self, timeout: Duration) -> Result<DeviceStatus>

Retrieve a log of I2C operations performed by the I2C host since last time, as well as whether the I2C host is currently waiting to read data.
Source§

fn prepare_read_data(&self, data: &[u8], sticky: bool) -> Result<()>

Prepare data to be tranmitted to I2C host on future or currently waiting I2C read transfer. By default, the prepared data will be discarded if the I2C issues a write transfer on the bus (giving the caller a chance to react to the additional data before preparing another response). If the sticky parameter is true, the prepared data will be kept across any number of intervening write transfers, and used for a future read transfer.

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