pub fn spi_master<F: Into<Hertz>>(
    clocks: &mut GenericClockController,
    bus_speed: F,
    sercom2: pac::SERCOM2,
    mclk: &mut pac::MCLK,
    sck: gpio::Pa13<Input<Floating>>,
    mosi: gpio::Pa12<Input<Floating>>,
    miso: gpio::Pa14<Input<Floating>>,
    port: &mut Port,
) -> SPIMaster2<
    hal::sercom::Sercom2Pad2<gpio::Pa14<gpio::PfC>>,
    hal::sercom::Sercom2Pad0<gpio::Pa12<gpio::PfC>>,
    hal::sercom::Sercom2Pad1<gpio::Pa13<gpio::PfC>>,
> {
    let gclk0 = clocks.gclk0();
    SPIMaster2::new(
        &clocks.sercom2_core(&gclk0).unwrap(),
        bus_speed.into(),
        hal::hal::spi::Mode {
            phase: hal::hal::spi::Phase::CaptureOnFirstTransition,
            polarity: hal::hal::spi::Polarity::IdleLow,
        },
        sercom2,
        mclk,
        (miso.into_pad(port), mosi.into_pad(port), sck.into_pad(port)),
    )
}
/// This powers up SERCOM2 and configures it for use as an
/// SPI Master in SPI Mode 0.
/// Unlike the `flash_spi_master` function, this
/// one does not accept a CS pin; configuring a pin for CS
/// is the responsibility of the caller, because it could be
/// any OutputPin, or even a pulled up line on the slave.
This powers up SERCOM2 and configures it for use as an
SPI Master in SPI Mode 0.
Unlike the `flash_spi_master` function, this
one does not accept a CS pin; configuring a pin for CS
is the responsibility of the caller, because it could be
any OutputPin, or even a pulled up line on the slave.
This powers up SERCOM2 and configures it for use as an SPI Master in SPI Mode 0 . Unlike the ` flash_spi_master ` function this one does not accept a CS pin ; configuring a pin for CS is the responsibility of the caller because it could be any OutputPin or even a pulled up line on the slave .
pub fn spi_master<F: Into<Hertz>>(
    clocks: &mut GenericClockController,
    bus_speed: F,
    sercom2: pac::SERCOM2,
    mclk: &mut pac::MCLK,
    sck: gpio::Pa13<Input<Floating>>,
    mosi: gpio::Pa12<Input<Floating>>,
    miso: gpio::Pa14<Input<Floating>>,
    port: &mut Port,
) -> SPIMaster2<
    hal::sercom::Sercom2Pad2<gpio::Pa14<gpio::PfC>>,
    hal::sercom::Sercom2Pad0<gpio::Pa12<gpio::PfC>>,
    hal::sercom::Sercom2Pad1<gpio::Pa13<gpio::PfC>>,
> {
    let gclk0 = clocks.gclk0();
    SPIMaster2::new(
        &clocks.sercom2_core(&gclk0).unwrap(),
        bus_speed.into(),
        hal::hal::spi::Mode {
            phase: hal::hal::spi::Phase::CaptureOnFirstTransition,
            polarity: hal::hal::spi::Polarity::IdleLow,
        },
        sercom2,
        mclk,
        (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 , sercom2 : pac :: SERCOM2 , mclk : & mut pac :: MCLK , sck : gpio :: Pa13 < Input < Floating > > , mosi : gpio :: Pa12 < Input < Floating > > , miso : gpio :: Pa14 < Input < Floating > > , port : & mut Port , ) -> SPIMaster2 < hal :: sercom :: Sercom2Pad2 < gpio :: Pa14 < gpio :: PfC > > , hal :: sercom :: Sercom2Pad0 < gpio :: Pa12 < gpio :: PfC > > , hal :: sercom :: Sercom2Pad1 < gpio :: Pa13 < gpio :: PfC > > , > { let gclk0 = clocks . gclk0 ( ) ; SPIMaster2 :: new ( & clocks . sercom2_core ( & gclk0 ) . unwrap ( ) , bus_speed . into ( ) , hal :: hal :: spi :: Mode { phase : hal :: hal :: spi :: Phase :: CaptureOnFirstTransition , polarity : hal :: hal :: spi :: Polarity :: IdleLow , } , sercom2 , mclk , ( miso . into_pad ( port ) , mosi . into_pad ( port ) , sck . into_pad ( port ) ) , ) }
This powers up SERCOM2 and configures it for use as an
SPI Master in SPI Mode 0.
This powers up SERCOM2 and configures it for use as an SPI Master in SPI Mode 0 .
clocks
&mut GenericClockController
bus_speed
F
sercom2
pac::SERCOM2
mclk
&mut pac::MCLK
sck
gpio::Pa13<Input<Floating>>
mosi
gpio::Pa12<Input<Floating>>
miso
gpio::Pa14<Input<Floating>>
port
&mut Port
clocks
&mut GenericClockController
bus_speed
F
sercom2
pac::SERCOM2
mclk
&mut pac::MCLK
sck
gpio::Pa13<Input<Floating>>
mosi
gpio::Pa12<Input<Floating>>
miso
gpio::Pa14<Input<Floating>>
port
&mut Port