pub fn spi_master(
    clocks: &mut GenericClockController,
    baud: impl Into<Hertz>,
    sercom4: pac::SERCOM4,
    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, sercom4, pads, freq)
        .baud(baud)
        .spi_mode(spi::MODE_0)
        .enable()
}
/// Convenience for setting up the 2x3 header block for SPI.
/// This powers up SERCOM4 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.
Convenience for setting up the 2x3 header block for SPI.
This powers up SERCOM4 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.
Convenience for setting up the 2x3 header block for SPI . This powers up SERCOM4 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(
    clocks: &mut GenericClockController,
    baud: impl Into<Hertz>,
    sercom4: pac::SERCOM4,
    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, sercom4, pads, freq)
        .baud(baud)
        .spi_mode(spi::MODE_0)
        .enable()
}
pub fn spi_master ( clocks : & mut GenericClockController , baud : impl Into < Hertz > , sercom4 : pac :: SERCOM4 , 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 , sercom4 , pads , freq ) . baud ( baud ) . spi_mode ( spi :: MODE_0 ) . enable ( ) }
Convenience for setting up the 2x3 header block for SPI.
Convenience for setting up the 2x3 header block for SPI .
clocks
&mut GenericClockController
baud
impl Into<Hertz>
sercom4
pac::SERCOM4
pm
&mut pac::PM
sclk
impl Into<Sclk>
mosi
impl Into<Mosi>
miso
impl Into<Miso>
clocks
&mut GenericClockController
baud
impl Into<Hertz>
sercom4
pac::SERCOM4
pm
&mut pac::PM
sclk
impl Into<Sclk>
mosi
impl Into<Mosi>
miso
impl Into<Miso>