Struct serpente::sercom::SPIMaster2
source · pub struct SPIMaster2<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> SPIMaster2<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> SPIMaster2<MISO, MOSI, SCK>
sourcepub fn new<F, T>(
clock: &Sercom2CoreClock,
freq: F,
mode: Mode,
sercom: SERCOM2,
pm: &mut PM,
padout: T
) -> SPIMaster2<MISO, MOSI, SCK>where
F: Into<Hertz>,
T: Into<Padout<SERCOM2, MISO, MOSI, SCK>>,
Padout<SERCOM2, MISO, MOSI, SCK>: DipoDopo,
👎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: &Sercom2CoreClock, freq: F, mode: Mode, sercom: SERCOM2, pm: &mut PM, padout: T ) -> SPIMaster2<MISO, MOSI, SCK>where F: Into<Hertz>, T: Into<Padout<SERCOM2, MISO, MOSI, SCK>>, Padout<SERCOM2, MISO, MOSI, SCK>: DipoDopo,
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: &Sercom2CoreClock)where
F: Into<Hertz>,
👎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: &Sercom2CoreClock)where F: Into<Hertz>,
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<SERCOM2, MISO, MOSI, SCK>, SERCOM2)
👎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<SERCOM2, MISO, MOSI, SCK>, SERCOM2)
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 SPIMaster2<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> CommonSpi for SPIMaster2<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) -> Hertzwhere
F: Into<Hertz>,
fn freq<F>(&self, src_clock_freq: Hertz) -> Hertzwhere F: Into<Hertz>,
spi_common
module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi
trait instead.source§fn calculate_baud<F>(freq: F, src_clock_freq: Hertz) -> u8where
F: Into<Hertz>,
fn calculate_baud<F>(freq: F, src_clock_freq: Hertz) -> u8where F: Into<Hertz>,
spi_common
module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi
trait instead.