pub fn spi_master<F: Into<Hertz>>(
    clocks: &mut GenericClockController,
    bus_speed: F,
    sercom0: pac::SERCOM0,
    pm: &mut pac::PM,
    sck: gpio::Pa11<Input<Floating>>,
    mosi: gpio::Pa10<Input<Floating>>,
    miso: gpio::Pa8<Input<Floating>>,
    port: &mut Port,
) -> SPIMaster0<
    hal::sercom::Sercom0Pad0<gpio::Pa8<gpio::PfC>>,
    hal::sercom::Sercom0Pad2<gpio::Pa10<gpio::PfC>>,
    hal::sercom::Sercom0Pad3<gpio::Pa11<gpio::PfC>>,
> {
    let gclk0 = clocks.gclk0();
    SPIMaster0::new(
        &clocks.sercom0_core(&gclk0).unwrap(),
        bus_speed.into(),
        hal::hal::spi::Mode {
            phase: hal::hal::spi::Phase::CaptureOnFirstTransition,
            polarity: hal::hal::spi::Polarity::IdleLow,
        },
        sercom0,
        pm,
        (miso.into_pad(port), mosi.into_pad(port), sck.into_pad(port)),
    )
}
/// Convenience for setting up pins D8-D11 for SPI.
/// This powers up SERCOM0 and configures it for use as an
/// SPI Master in SPI Mode 0.
Convenience for setting up pins D8-D11 for SPI.
This powers up SERCOM0 and configures it for use as an
SPI Master in SPI Mode 0.
Convenience for setting up pins D8 - D11 for SPI . This powers up SERCOM0 and configures it for use as an SPI Master in SPI Mode 0 .
pub fn spi_master<F: Into<Hertz>>(
    clocks: &mut GenericClockController,
    bus_speed: F,
    sercom0: pac::SERCOM0,
    pm: &mut pac::PM,
    sck: gpio::Pa11<Input<Floating>>,
    mosi: gpio::Pa10<Input<Floating>>,
    miso: gpio::Pa8<Input<Floating>>,
    port: &mut Port,
) -> SPIMaster0<
    hal::sercom::Sercom0Pad0<gpio::Pa8<gpio::PfC>>,
    hal::sercom::Sercom0Pad2<gpio::Pa10<gpio::PfC>>,
    hal::sercom::Sercom0Pad3<gpio::Pa11<gpio::PfC>>,
> {
    let gclk0 = clocks.gclk0();
    SPIMaster0::new(
        &clocks.sercom0_core(&gclk0).unwrap(),
        bus_speed.into(),
        hal::hal::spi::Mode {
            phase: hal::hal::spi::Phase::CaptureOnFirstTransition,
            polarity: hal::hal::spi::Polarity::IdleLow,
        },
        sercom0,
        pm,
        (miso.into_pad(port), mosi.into_pad(port), sck.into_pad(port)),
    )
}
pub fn spi_master < F : Into < Hertz > > ( clocks : & mut GenericClockController , bus_speed : F , sercom0 : pac :: SERCOM0 , pm : & mut pac :: PM , sck : gpio :: Pa11 < Input < Floating > > , mosi : gpio :: Pa10 < Input < Floating > > , miso : gpio :: Pa8 < Input < Floating > > , port : & mut Port , ) -> SPIMaster0 < hal :: sercom :: Sercom0Pad0 < gpio :: Pa8 < gpio :: PfC > > , hal :: sercom :: Sercom0Pad2 < gpio :: Pa10 < gpio :: PfC > > , hal :: sercom :: Sercom0Pad3 < gpio :: Pa11 < gpio :: PfC > > , > { let gclk0 = clocks . gclk0 ( ) ; SPIMaster0 :: new ( & clocks . sercom0_core ( & gclk0 ) . unwrap ( ) , bus_speed . into ( ) , hal :: hal :: spi :: Mode { phase : hal :: hal :: spi :: Phase :: CaptureOnFirstTransition , polarity : hal :: hal :: spi :: Polarity :: IdleLow , } , sercom0 , pm , ( miso . into_pad ( port ) , mosi . into_pad ( port ) , sck . into_pad ( port ) ) , ) }
Convenience for setting up pins D8-D11 for SPI.
Convenience for setting up pins D8 - D11 for SPI .
clocks
&mut GenericClockController
bus_speed
F
sercom0
pac::SERCOM0
pm
&mut pac::PM
sck
gpio::Pa11<Input<Floating>>
mosi
gpio::Pa10<Input<Floating>>
miso
gpio::Pa8<Input<Floating>>
port
&mut Port
clocks
&mut GenericClockController
bus_speed
F
sercom0
pac::SERCOM0
pm
&mut pac::PM
sck
gpio::Pa11<Input<Floating>>
mosi
gpio::Pa10<Input<Floating>>
miso
gpio::Pa8<Input<Floating>>
port
&mut Port