Trait serpente::spi_common::CommonSpi [−][src]
pub trait CommonSpi {
fn spi(&self) -> &SPI;
fn spi_mut(&mut self) -> &SPI;
fn disable(&mut self) { ... }
fn enable(&mut self) { ... }
fn set_mode(&mut self, mode: Mode) { ... }
fn freq<F>(&self, src_clock_freq: Hertz) -> Hertz
where
F: Into<Hertz>,
{ ... }
fn calculate_baud<F>(freq: F, src_clock_freq: Hertz) -> u8
where
F: Into<Hertz>,
{ ... }
}
The spi_common
module is deprecated, and will be removed in a subsequent release.
Please use the sercom::v2::spi::AnySpi
trait instead.
Expand description
Consolidated common logic for dealing with ATSAMD SPI peripherals.
Required methods
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
Provided methods
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.
for synchronous SERCOM peripherals, the calculation for the final
frequency is f_baud = f_ref / (2 * (BAUD + 1))
.
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
for synchronous SERCOM peripherals, the calculation for this
register is BAUD = f_ref / (2 * f_baud) - 1
.