pub trait _atsamd_hal_spi_common_CommonSpi {
// Required methods
fn spi(&self) -> &SPI;
fn spi_mut(&mut self) -> &SPI;
// Provided methods
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> { ... }
}
๐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.Expand description
Consolidated common logic for dealing with ATSAMD SPI peripherals.
Required Methodsยง
Provided Methodsยง
sourcefn disable(&mut self)
๐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 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.Disable the SPI
sourcefn enable(&mut self)
๐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 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.Enable the SPI
sourcefn set_mode(&mut self, mode: Mode)
๐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 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.Set the polarity (CPOL) and phase (CPHA) of the SPI
sourcefn freq<F>(&self, src_clock_freq: Hertz) -> Hertz
๐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 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.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))
.
sourcefn calculate_baud<F>(freq: F, src_clock_freq: Hertz) -> u8
๐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 calculate_baud<F>(freq: F, src_clock_freq: Hertz) -> u8
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
.
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.