pub struct SPIMaster5<MISO, MOSI, SCK> { /* private fields */ }The sercom::v1::spi module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi module instead.
Expand description
SPIMasterX represents the corresponding SERCOMX instance
configured to act in the role of an SPI Master.
Objects of this type implement the HAL FullDuplex and blocking
SPI traits.
This type is generic over any valid pad mapping where there is a defined โdata in pin out data out pin outโ implementation.
Implementationsยง
Sourceยงimpl<MISO, MOSI, SCK> SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> SPIMaster5<MISO, MOSI, SCK>
Sourcepub fn new<F, T>(
clock: &Sercom5CoreClock,
freq: F,
mode: Mode,
sercom: SERCOM5,
mclk: &mut MCLK,
padout: T,
) -> SPIMaster5<MISO, MOSI, SCK>
๐Deprecated since 0.13.0: The sercom::v1::spi module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi module instead.
pub fn new<F, T>( clock: &Sercom5CoreClock, freq: F, mode: Mode, sercom: SERCOM5, mclk: &mut MCLK, padout: T, ) -> SPIMaster5<MISO, MOSI, SCK>
The sercom::v1::spi module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi module instead.
Power on and configure SERCOMX to work as an SPI Master operating with the specified frequency and SPI Mode. The pinout specifies which pins are bound to the MISO, MOSI, SCK functions.
Sourcepub fn set_baud<F>(&mut self, freq: F, clock: &Sercom5CoreClock)
๐Deprecated since 0.13.0: The sercom::v1::spi module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi module instead.
pub fn set_baud<F>(&mut self, freq: F, clock: &Sercom5CoreClock)
The sercom::v1::spi module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi module instead.
Set the baud rate
Sourcepub fn free(self) -> (Padout<SERCOM5, MISO, MOSI, SCK>, SERCOM5)
๐Deprecated since 0.13.0: The sercom::v1::spi module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi module instead.
pub fn free(self) -> (Padout<SERCOM5, MISO, MOSI, SCK>, SERCOM5)
The sercom::v1::spi module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi module instead.
Tear down the SPI instance and yield the constituent pins and SERCOM instance. No explicit de-initialization is performed.
Trait Implementationsยง
Sourceยงimpl<MISO, MOSI, SCK> CommonSpi for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> CommonSpi for SPIMaster5<MISO, MOSI, SCK>
Sourceยงfn spi(&self) -> &SPIM
๐Deprecated since 0.13.0: The spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.
fn spi(&self) -> &SPIM
The spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.
Helper for accessing the spi member of the sercom instance
Sourceยงfn spi_mut(&mut self) -> &SPIM
๐Deprecated since 0.13.0: The spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.
fn spi_mut(&mut self) -> &SPIM
The spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.
Helper for accessing the spi member of the sercom instance
Sourceยงfn disable(&mut self)
fn disable(&mut self)
The spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.
Sourceยงfn enable(&mut self)
fn enable(&mut self)
The spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.
Sourceยงfn set_mode(&mut self, mode: Mode)
fn set_mode(&mut self, mode: Mode)
The spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.
Sourceยงfn freq<F>(&self, src_clock_freq: Hertz) -> Hertz
fn freq<F>(&self, src_clock_freq: Hertz) -> Hertz
The spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.
impl<MISO, MOSI, SCK> Default<u8> for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> Default<u8> for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> Default<u8> for SPIMaster5<MISO, MOSI, SCK>
unproven only.Sourceยงimpl<MISO, MOSI, SCK> FullDuplex<u8> for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> FullDuplex<u8> for SPIMaster5<MISO, MOSI, SCK>
Auto Trait Implementationsยง
impl<MISO, MOSI, SCK> !Sync for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> Freeze for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> RefUnwindSafe for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> Send for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> Unpin for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> UnsafeUnpin for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> UnwindSafe for SPIMaster5<MISO, MOSI, SCK>
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
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>,
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>
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>,
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)
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>,
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
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>,
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
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>,
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
Sourceยงimpl<W, S> WriteIter<W> for S
impl<W, S> WriteIter<W> for S
Sourceยงtype Error = <S as FullDuplex<W>>::Error
type Error = <S as FullDuplex<W>>::Error
Sourceยงfn write_iter<WI>(
&mut self,
words: WI,
) -> Result<(), <S as FullDuplex<W>>::Error>where
WI: IntoIterator<Item = W>,
fn write_iter<WI>(
&mut self,
words: WI,
) -> Result<(), <S as FullDuplex<W>>::Error>where
WI: IntoIterator<Item = W>,
words to the slave, ignoring all the incoming words