pub struct SPIMaster4<MISO, MOSI, SCK> { /* private fields */ }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> SPIMaster4<MISO, MOSI, SCK>
 
impl<MISO, MOSI, SCK> SPIMaster4<MISO, MOSI, SCK>
Sourcepub fn new<F, T>(
    clock: &Sercom4CoreClock,
    freq: F,
    mode: Mode,
    sercom: SERCOM4,
    pm: &mut PM,
    padout: T,
) -> SPIMaster4<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: &Sercom4CoreClock, freq: F, mode: Mode, sercom: SERCOM4, pm: &mut PM, padout: T, ) -> SPIMaster4<MISO, MOSI, SCK>
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 padout specifies which pins are bound to the MISO, MOSI, SCK functions.
You can use a tuple of three SercomXPadY instances for which there exists a From implementation for SPIMasterXPadout.
Sourcepub fn set_baud<F>(&mut self, freq: F, clock: &Sercom4CoreClock)
 ๐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: &Sercom4CoreClock)
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<SERCOM4, MISO, MOSI, SCK>, SERCOM4)
 ๐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<SERCOM4, MISO, MOSI, SCK>, SERCOM4)
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 SPIMaster4<MISO, MOSI, SCK>
 
impl<MISO, MOSI, SCK> CommonSpi for SPIMaster4<MISO, MOSI, SCK>
Sourceยงfn spi(&self) -> &SPI
 ๐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) -> &SPI
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) -> &SPI
 ๐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) -> &SPI
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)
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)
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)
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
spi_common module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi trait instead.