pub fn spi_master(
    clocks: &mut GenericClockController,
    baud: impl Into<Hertz>,
    sercom1: pac::SERCOM1,

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