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)
fn 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.Disable the SPI
sourcefn enable(&mut self)
fn 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.Enable the SPI
sourcefn set_mode(&mut self, mode: Mode)
fn 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.Set the polarity (CPOL) and phase (CPHA) of the SPI
sourcefn freq<F>(&self, src_clock_freq: Hertz) -> Hertzwhere
F: Into<Hertz>,
fn freq<F>(&self, src_clock_freq: Hertz) -> Hertzwhere 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.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) -> u8where
F: Into<Hertz>,
fn calculate_baud<F>(freq: F, src_clock_freq: Hertz) -> u8where 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.Helper for calculating our baudrate register
for synchronous SERCOM peripherals, the calculation for this
register is BAUD = f_ref / (2 * f_baud) - 1
.