pub enum SoftwareTimeout {
None,
Transaction(Duration),
PerByte(Duration),
}
unstable
only.Expand description
Software timeout for I2C operations.
This timeout is used to limit the duration of I2C operations in software.
Note that using this in conjunction with async
operations will cause the
task to be woken up continuously until the operation completes or the
timeout is reached. You should prefer using an asynchronous
timeout mechanism (like embassy_time::with_timeout
) for better
efficiency.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Variants§
None
No software timeout is set.
Transaction(Duration)
Define a fixed timeout for I2C operations.
PerByte(Duration)
Define a data length dependent timeout for I2C operations.
The applied timeout is calculated as data_length * duration_per_byte
.
In I2c::transaction
and I2c::transaction_async
, the timeout is
applied separately for each operation.
Trait Implementations§
Source§impl Clone for SoftwareTimeout
impl Clone for SoftwareTimeout
Source§fn clone(&self) -> SoftwareTimeout
fn clone(&self) -> SoftwareTimeout
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SoftwareTimeout
impl Debug for SoftwareTimeout
Source§impl Hash for SoftwareTimeout
impl Hash for SoftwareTimeout
Source§impl PartialEq for SoftwareTimeout
impl PartialEq for SoftwareTimeout
impl Copy for SoftwareTimeout
impl Eq for SoftwareTimeout
impl StructuralPartialEq for SoftwareTimeout
Auto Trait Implementations§
impl Freeze for SoftwareTimeout
impl RefUnwindSafe for SoftwareTimeout
impl Send for SoftwareTimeout
impl Sync for SoftwareTimeout
impl Unpin for SoftwareTimeout
impl UnwindSafe for SoftwareTimeout
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit
)