pub struct HyperdebugI2cBus { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl Bus for HyperdebugI2cBus
impl Bus for HyperdebugI2cBus
Source§fn get_max_speed(&self) -> Result<u32>
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<()>
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.
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<()>
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<()>
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<()>
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>
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<()>
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§
impl !Freeze for HyperdebugI2cBus
impl !RefUnwindSafe for HyperdebugI2cBus
impl !Send for HyperdebugI2cBus
impl !Sync for HyperdebugI2cBus
impl Unpin for HyperdebugI2cBus
impl !UnwindSafe for HyperdebugI2cBus
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