pub fn spi_master<F: Into<Hertz>>(
    clocks: &mut GenericClockController,
    speed: F,
    sercom4: pac::SERCOM4,
    pm: &mut pac::PM,
    sck: gpio::Pb11<Input<Floating>>,
    mosi: gpio::Pb10<Input<Floating>>,
    miso: gpio::Pa12<Input<Floating>>,
    port: &mut Port,
) -> SPIMaster4<
    hal::sercom::Sercom4Pad0<gpio::Pa12<gpio::PfD>>,
    hal::sercom::Sercom4Pad2<gpio::Pb10<gpio::PfD>>,
    hal::sercom::Sercom4Pad3<gpio::Pb11<gpio::PfD>>,
> {
    let gclk0 = clocks.gclk0();

    SPIMaster4::new(
        &clocks.sercom4_core(&gclk0).unwrap(),
        speed.into(),
        hal::hal::spi::Mode {
            phase: hal::hal::spi::Phase::CaptureOnFirstTransition,
            polarity: hal::hal::spi::Polarity::IdleLow,
        },
        sercom4,
        pm,
        (miso.into_pad(port), mosi.into_pad(port), sck.into_pad(port)),
    )
}
/// Convenience function for setting up the D24/SCK, D23/MOSI, and D22/MISO pins
/// as a SPI Master.
Convenience function for setting up the D24/SCK, D23/MOSI, and D22/MISO pins
as a SPI Master.
Convenience function for setting up the D24 / SCK D23 / MOSI and D22 / MISO pins as a SPI Master .
pub fn spi_master<F: Into<Hertz>>(
    clocks: &mut GenericClockController,
    speed: F,
    sercom4: pac::SERCOM4,
    pm: &mut pac::PM,
    sck: gpio::Pb11<Input<Floating>>,
    mosi: gpio::Pb10<Input<Floating>>,
    miso: gpio::Pa12<Input<Floating>>,
    port: &mut Port,
) -> SPIMaster4<
    hal::sercom::Sercom4Pad0<gpio::Pa12<gpio::PfD>>,
    hal::sercom::Sercom4Pad2<gpio::Pb10<gpio::PfD>>,
    hal::sercom::Sercom4Pad3<gpio::Pb11<gpio::PfD>>,
> {
    let gclk0 = clocks.gclk0();
    SPIMaster4::new(
        &clocks.sercom4_core(&gclk0).unwrap(),
        speed.into(),
        hal::hal::spi::Mode {
            phase: hal::hal::spi::Phase::CaptureOnFirstTransition,
            polarity: hal::hal::spi::Polarity::IdleLow,
        },
        sercom4,
        pm,
        (miso.into_pad(port), mosi.into_pad(port), sck.into_pad(port)),
    )
}
pub fn spi_master < F : Into < Hertz > > ( clocks : & mut GenericClockController , speed : F , sercom4 : pac :: SERCOM4 , pm : & mut pac :: PM , sck : gpio :: Pb11 < Input < Floating > > , mosi : gpio :: Pb10 < Input < Floating > > , miso : gpio :: Pa12 < Input < Floating > > , port : & mut Port , ) -> SPIMaster4 < hal :: sercom :: Sercom4Pad0 < gpio :: Pa12 < gpio :: PfD > > , hal :: sercom :: Sercom4Pad2 < gpio :: Pb10 < gpio :: PfD > > , hal :: sercom :: Sercom4Pad3 < gpio :: Pb11 < gpio :: PfD > > , > { let gclk0 = clocks . gclk0 ( ) ; SPIMaster4 :: new ( & clocks . sercom4_core ( & gclk0 ) . unwrap ( ) , speed . into ( ) , hal :: hal :: spi :: Mode { phase : hal :: hal :: spi :: Phase :: CaptureOnFirstTransition , polarity : hal :: hal :: spi :: Polarity :: IdleLow , } , sercom4 , pm , ( miso . into_pad ( port ) , mosi . into_pad ( port ) , sck . into_pad ( port ) ) , ) }
Convenience function for setting up the D24/SCK, D23/MOSI, and D22/MISO pins
as a SPI Master.
Convenience function for setting up the D24 / SCK D23 / MOSI and D22 / MISO pins as a SPI Master .
clocks
&mut GenericClockController
speed
F
sercom4
pac::SERCOM4
pm
&mut pac::PM
sck
gpio::Pb11<Input<Floating>>
mosi
gpio::Pb10<Input<Floating>>
miso
gpio::Pa12<Input<Floating>>
port
&mut Port
clocks
&mut GenericClockController
speed
F
sercom4
pac::SERCOM4
pm
&mut pac::PM
sck
gpio::Pb11<Input<Floating>>
mosi
gpio::Pb10<Input<Floating>>
miso
gpio::Pa12<Input<Floating>>
port
&mut Port