Skip to main content

SpiBusResources

Struct SpiBusResources 

Source
pub struct SpiBusResources<'d> {
    pub spi: SPI2<'d>,
    pub dma: DMA_CH2<'d>,
    pub sck: GPIO40<'d>,
    pub mosi: GPIO14<'d>,
    pub miso: GPIO39<'d>,
    pub sd_cs: GPIO12<'d>,
    pub ext_cs: GPIO5<'d>,
}
Expand description

The shared SPI bus and both of its chip selects. sd is in crate::sd.

Fields§

§spi: SPI2<'d>§dma: DMA_CH2<'d>§sck: GPIO40<'d>§mosi: GPIO14<'d>§miso: GPIO39<'d>§sd_cs: GPIO12<'d>§ext_cs: GPIO5<'d>

Implementations§

Source§

impl<'d> SpiBusResources<'d>

Source

pub fn reborrow(&mut self) -> SpiBusResources<'_>

A copy of this group that lives only as long as the borrow, to lend the hardware to a function without giving it up.

Source§

impl<'d> SpiBusResources<'d>

Source

pub fn sd(&mut self) -> Result<Sd<'_>, Error>

Initialises the microSD card, giving it the shared bus exclusively, read-only. Fails if no card is inserted or it doesn’t respond.

The returned Sd borrows the bus; drop it and the bus is free for the EXT header or another sd call.

Auto Trait Implementations§

§

impl<'d> Freeze for SpiBusResources<'d>

§

impl<'d> RefUnwindSafe for SpiBusResources<'d>

§

impl<'d> Send for SpiBusResources<'d>

§

impl<'d> Sync for SpiBusResources<'d>

§

impl<'d> Unpin for SpiBusResources<'d>

§

impl<'d> UnsafeUnpin for SpiBusResources<'d>

§

impl<'d> !UnwindSafe for SpiBusResources<'d>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,