pub fn flash_spi_master(
    clocks: &mut GenericClockController,
    sercom3: pac::SERCOM3,
    pm: &mut pac::PM,
    sck: impl Into<FlashSck>,
    mosi: impl Into<FlashMosi>,
    miso: impl Into<FlashMiso>,
    cs: impl Into<FlashCs>,
) -> (FlashSpi, FlashCs) {
    let gclk0 = clocks.gclk0();
    let clock = clocks.sercom3_core(&gclk0).unwrap();
    let freq = clock.freq();
    let (sck, mosi, miso, mut cs) = (sck.into(), mosi.into(), miso.into(), cs.into());
    let pads = spi::Pads::default().data_in(miso).data_out(mosi).sclk(sck);
    let spi = spi::Config::new(pm, sercom3, pads, freq)
        .baud(MegaHertz(48))
        .spi_mode(spi::MODE_0)
        .enable();

    cs.set_high().unwrap();

    (spi, cs)
}
/// Convenience for accessing the on-board SPI Flash device.
/// This powers up SERCOM3 and configures it for use as an
/// SPI Master.
Convenience for accessing the on-board SPI Flash device.
This powers up SERCOM3 and configures it for use as an
SPI Master.
Convenience for accessing the on - board SPI Flash device . This powers up SERCOM3 and configures it for use as an SPI Master .
pub fn flash_spi_master(
    clocks: &mut GenericClockController,
    sercom3: pac::SERCOM3,
    pm: &mut pac::PM,
    sck: impl Into<FlashSck>,
    mosi: impl Into<FlashMosi>,
    miso: impl Into<FlashMiso>,
    cs: impl Into<FlashCs>,
) -> (FlashSpi, FlashCs) {
    let gclk0 = clocks.gclk0();
    let clock = clocks.sercom3_core(&gclk0).unwrap();
    let freq = clock.freq();
    let (sck, mosi, miso, mut cs) = (sck.into(), mosi.into(), miso.into(), cs.into());
    let pads = spi::Pads::default().data_in(miso).data_out(mosi).sclk(sck);
    let spi = spi::Config::new(pm, sercom3, pads, freq)
        .baud(MegaHertz(48))
        .spi_mode(spi::MODE_0)
        .enable();
    cs.set_high().unwrap();
    (spi, cs)
}
pub fn flash_spi_master ( clocks : & mut GenericClockController , sercom3 : pac :: SERCOM3 , pm : & mut pac :: PM , sck : impl Into < FlashSck > , mosi : impl Into < FlashMosi > , miso : impl Into < FlashMiso > , cs : impl Into < FlashCs > , ) -> ( FlashSpi , FlashCs ) { let gclk0 = clocks . gclk0 ( ) ; let clock = clocks . sercom3_core ( & gclk0 ) . unwrap ( ) ; let freq = clock . freq ( ) ; let ( sck , mosi , miso , mut cs ) = ( sck . into ( ) , mosi . into ( ) , miso . into ( ) , cs . into ( ) ) ; let pads = spi :: Pads :: default ( ) . data_in ( miso ) . data_out ( mosi ) . sclk ( sck ) ; let spi = spi :: Config :: new ( pm , sercom3 , pads , freq ) . baud ( MegaHertz ( 48 ) ) . spi_mode ( spi :: MODE_0 ) . enable ( ) ; cs . set_high ( ) . unwrap ( ) ; ( spi , cs ) }
Convenience for accessing the on-board SPI Flash device.
Convenience for accessing the on - board SPI Flash device .
clocks
&mut GenericClockController
sercom3
pac::SERCOM3
pm
&mut pac::PM
sck
impl Into<FlashSck>
mosi
impl Into<FlashMosi>
miso
impl Into<FlashMiso>
cs
impl Into<FlashCs>
clocks
&mut GenericClockController
sercom3
pac::SERCOM3
pm
&mut pac::PM
sck
impl Into<FlashSck>
mosi
impl Into<FlashMosi>
miso
impl Into<FlashMiso>
cs
impl Into<FlashCs>