Struct grand_central_m4::sercom::SPIMaster5 [−][src]
pub struct SPIMaster5<MISO, MOSI, SCK> { /* fields omitted */ }
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
pub fn new<F, T>(
clock: &Sercom5CoreClock,
freq: F,
mode: Mode,
sercom: SERCOM5,
mclk: &mut MCLK,
padout: T
) -> SPIMaster5<MISO, MOSI, SCK> where
F: Into<Hertz>,
T: Into<Padout<SERCOM5, MISO, MOSI, SCK>>,
Padout<SERCOM5, 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: &Sercom5CoreClock,
freq: F,
mode: Mode,
sercom: SERCOM5,
mclk: &mut MCLK,
padout: T
) -> SPIMaster5<MISO, MOSI, SCK> where
F: Into<Hertz>,
T: Into<Padout<SERCOM5, MISO, MOSI, SCK>>,
Padout<SERCOM5, MISO, MOSI, SCK>: DipoDopo,
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.
👎 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.
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
👎 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.
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
👎 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.
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
👎 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.
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
The spi_common
module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi
trait instead.
Disable the SPI
The spi_common
module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi
trait instead.
Enable the SPI
The spi_common
module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi
trait instead.
Set the polarity (CPOL) and phase (CPHA) of the SPI
The spi_common
module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi
trait instead.
Method for calculating the output frequency given our baud settings. Read more
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 calculating our baudrate register Read more
Auto Trait Implementations
impl<MISO, MOSI, SCK> RefUnwindSafe for SPIMaster5<MISO, MOSI, SCK> where
MISO: RefUnwindSafe,
MOSI: RefUnwindSafe,
SCK: RefUnwindSafe,
impl<MISO, MOSI, SCK> Send for SPIMaster5<MISO, MOSI, SCK> where
MISO: Send,
MOSI: Send,
SCK: Send,
impl<MISO, MOSI, SCK> !Sync for SPIMaster5<MISO, MOSI, SCK>
impl<MISO, MOSI, SCK> Unpin for SPIMaster5<MISO, MOSI, SCK> where
MISO: Unpin,
MOSI: Unpin,
SCK: Unpin,
impl<MISO, MOSI, SCK> UnwindSafe for SPIMaster5<MISO, MOSI, SCK> where
MISO: UnwindSafe,
MOSI: UnwindSafe,
SCK: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
type Error = <S as FullDuplex<W>>::Error
type Error = <S as FullDuplex<W>>::Error
Error type
pub fn transfer(
&mut self,
words: &'w mut [W]
) -> Result<&'w [W], <S as FullDuplex<W>>::Error>
pub fn transfer(
&mut self,
words: &'w mut [W]
) -> Result<&'w [W], <S as FullDuplex<W>>::Error>
Sends words
to the slave. Returns the words
received from the slave
type Error = <S as FullDuplex<W>>::Error
type Error = <S as FullDuplex<W>>::Error
Error type
type Error = <S as FullDuplex<W>>::Error
type Error = <S as FullDuplex<W>>::Error
Error type
pub fn write_iter<WI>(
&mut self,
words: WI
) -> Result<(), <S as FullDuplex<W>>::Error> where
WI: IntoIterator<Item = W>,
pub fn write_iter<WI>(
&mut self,
words: WI
) -> Result<(), <S as FullDuplex<W>>::Error> where
WI: IntoIterator<Item = W>,
Sends words
to the slave, ignoring all the incoming words