pub fn spi_master(
    clocks: &mut GenericClockController,
    baud: impl Into<Hertz>,
    sercom: SpiSercom,
    pm: &mut pac::PM,
    sclk: impl Into<Sclk>,
    mosi: impl Into<Mosi>,
    miso: impl Into<Miso>,
) -> Spi {
    let gclk0 = clocks.gclk0();
    let clock = clocks.sercom4_core(&gclk0).unwrap();
    let freq = clock.freq();
    let (miso, mosi, sclk) = (miso.into(), mosi.into(), sclk.into());
    let pads = spi::Pads::default().data_in(miso).data_out(mosi).sclk(sclk);
    spi::Config::new(pm, sercom, pads, freq)
        .baud(baud)
        .spi_mode(spi::MODE_0)
        .enable()
}
/// Convenience for setting up the labelled SPI peripheral.
/// This powers up the SPI SERCOM and configures it for use as an
/// SPI Master in SPI Mode 0.
Convenience for setting up the labelled SPI peripheral.
This powers up the SPI SERCOM and configures it for use as an
SPI Master in SPI Mode 0.
Convenience for setting up the labelled SPI peripheral . This powers up the SPI SERCOM and configures it for use as an SPI Master in SPI Mode 0 .
pub fn spi_master(
    clocks: &mut GenericClockController,
    baud: impl Into<Hertz>,
    sercom: SpiSercom,
    pm: &mut pac::PM,
    sclk: impl Into<Sclk>,
    mosi: impl Into<Mosi>,
    miso: impl Into<Miso>,
) -> Spi {
    let gclk0 = clocks.gclk0();
    let clock = clocks.sercom4_core(&gclk0).unwrap();
    let freq = clock.freq();
    let (miso, mosi, sclk) = (miso.into(), mosi.into(), sclk.into());
    let pads = spi::Pads::default().data_in(miso).data_out(mosi).sclk(sclk);
    spi::Config::new(pm, sercom, pads, freq)
        .baud(baud)
        .spi_mode(spi::MODE_0)
        .enable()
}
pub fn spi_master ( clocks : & mut GenericClockController , baud : impl Into < Hertz > , sercom : SpiSercom , pm : & mut pac :: PM , sclk : impl Into < Sclk > , mosi : impl Into < Mosi > , miso : impl Into < Miso > , ) -> Spi { let gclk0 = clocks . gclk0 ( ) ; let clock = clocks . sercom4_core ( & gclk0 ) . unwrap ( ) ; let freq = clock . freq ( ) ; let ( miso , mosi , sclk ) = ( miso . into ( ) , mosi . into ( ) , sclk . into ( ) ) ; let pads = spi :: Pads :: default ( ) . data_in ( miso ) . data_out ( mosi ) . sclk ( sclk ) ; spi :: Config :: new ( pm , sercom , pads , freq ) . baud ( baud ) . spi_mode ( spi :: MODE_0 ) . enable ( ) }
Convenience for setting up the labelled SPI peripheral.
Convenience for setting up the labelled SPI peripheral .
clocks
&mut GenericClockController
baud
impl Into<Hertz>
sercom
SpiSercom
pm
&mut pac::PM
sclk
impl Into<Sclk>
mosi
impl Into<Mosi>
miso
impl Into<Miso>
clocks
&mut GenericClockController
baud
impl Into<Hertz>
sercom
SpiSercom
pm
&mut pac::PM
sclk
impl Into<Sclk>
mosi
impl Into<Mosi>
miso
impl Into<Miso>