pub struct FairSpiDevice<D> { /* private fields */ }Expand description
A SpiDevice that queues for [SPI2_FAIR] before each transaction.
The display holds the bus for a whole panel transfer, so without this the card’s 1 ms-cadence busy-poll never gets in. With it, both users are served in arrival order and neither can monopolise the bus.
Implementations§
Source§impl<D> FairSpiDevice<D>
impl<D> FairSpiDevice<D>
pub fn new(inner: D) -> Self
Sourcepub fn new_display(inner: D) -> Self
pub fn new_display(inner: D) -> Self
The display’s device: also owns the GPIO35 DC line on CoreS3.
Source§impl<'a, M, BUS, CS> FairSpiDevice<SpiDeviceWithConfig<'a, M, BUS, CS>>where
M: RawMutex,
BUS: SetConfig,
impl<'a, M, BUS, CS> FairSpiDevice<SpiDeviceWithConfig<'a, M, BUS, CS>>where
M: RawMutex,
BUS: SetConfig,
Sourcepub fn set_config(&mut self, config: BUS::Config)
pub fn set_config(&mut self, config: BUS::Config)
Re-configure the underlying device (e.g. raise the SD clock after init). Delegates, so callers keep the wrapper — and with it the fairness — instead of having to unwrap to reach the setter.
Trait Implementations§
Source§impl<D: ErrorType> ErrorType for FairSpiDevice<D>
impl<D: ErrorType> ErrorType for FairSpiDevice<D>
Source§impl<D: SpiDevice> SpiDevice for FairSpiDevice<D>
impl<D: SpiDevice> SpiDevice for FairSpiDevice<D>
Source§async fn transaction(
&mut self,
operations: &mut [Operation<'_, u8>],
) -> Result<(), Self::Error>
async fn transaction( &mut self, operations: &mut [Operation<'_, u8>], ) -> Result<(), Self::Error>
Perform a transaction against the device. Read more
§async fn read(&mut self, buf: &mut [Word]) -> Result<(), Self::Error>
async fn read(&mut self, buf: &mut [Word]) -> Result<(), Self::Error>
Do a read within a transaction. Read more
§async fn write(&mut self, buf: &[Word]) -> Result<(), Self::Error>
async fn write(&mut self, buf: &[Word]) -> Result<(), Self::Error>
Do a write within a transaction. Read more
§async fn transfer(
&mut self,
read: &mut [Word],
write: &[Word],
) -> Result<(), Self::Error>
async fn transfer( &mut self, read: &mut [Word], write: &[Word], ) -> Result<(), Self::Error>
Do a transfer within a transaction. Read more
§async fn transfer_in_place(
&mut self,
buf: &mut [Word],
) -> Result<(), Self::Error>
async fn transfer_in_place( &mut self, buf: &mut [Word], ) -> Result<(), Self::Error>
Do an in-place transfer within a transaction. Read more
Auto Trait Implementations§
impl<D> Freeze for FairSpiDevice<D>where
D: Freeze,
impl<D> PsramSafe for FairSpiDevice<D>where
D: PsramSafe,
impl<D> RefUnwindSafe for FairSpiDevice<D>where
D: RefUnwindSafe,
impl<D> Send for FairSpiDevice<D>where
D: Send,
impl<D> Sync for FairSpiDevice<D>where
D: Sync,
impl<D> Unpin for FairSpiDevice<D>where
D: Unpin,
impl<D> UnsafeUnpin for FairSpiDevice<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for FairSpiDevice<D>where
D: UnwindSafe,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DTwhere
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DTwhere
ST: ?Sized,
DT: ?Sized,
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
§impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.