[][src]Trait sodaq_one::prelude::_atsamd_hal_spi_common_CommonSpi

pub trait _atsamd_hal_spi_common_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>
, { ... } }

Required methods

fn spi(&self) -> &SPI

Helper for accessing the spi member of the sercom instance

fn spi_mut(&mut self) -> &SPI

Helper for accessing the spi member of the sercom instance

Loading content...

Provided methods

fn disable(&mut self)

Disable the SPI

fn enable(&mut self)

Enable the SPI

fn set_mode(&mut self, mode: Mode)

Set the polarity (CPOL) and phase (CPHA) of the SPI

fn freq<F>(&self, src_clock_freq: Hertz) -> Hertz where
    F: Into<Hertz>, 

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)).

fn calculate_baud<F>(freq: F, src_clock_freq: Hertz) -> u8 where
    F: Into<Hertz>, 

Helper for calculating our baudrate register

for synchronous SERCOM peripherals, the calculation for this register is BAUD = f_ref / (2 * f_baud) - 1.

Loading content...

Implementors

impl<MISO, MOSI, SCK> CommonSpi for SPIMaster0<MISO, MOSI, SCK>[src]

pub fn spi(&self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

pub fn spi_mut(&mut self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

impl<MISO, MOSI, SCK> CommonSpi for SPIMaster1<MISO, MOSI, SCK>[src]

pub fn spi(&self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

pub fn spi_mut(&mut self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

impl<MISO, MOSI, SCK> CommonSpi for SPIMaster2<MISO, MOSI, SCK>[src]

pub fn spi(&self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

pub fn spi_mut(&mut self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

impl<MISO, MOSI, SCK> CommonSpi for SPIMaster3<MISO, MOSI, SCK>[src]

pub fn spi(&self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

pub fn spi_mut(&mut self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

impl<MISO, MOSI, SCK> CommonSpi for SPIMaster4<MISO, MOSI, SCK>[src]

pub fn spi(&self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

pub fn spi_mut(&mut self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

impl<MISO, MOSI, SCK> CommonSpi for SPIMaster5<MISO, MOSI, SCK>[src]

pub fn spi(&self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

pub fn spi_mut(&mut self) -> &SPI[src]

Helper for accessing the spi member of the sercom instance

Loading content...