pub fn init<TS: TimeSource>(
        self,
        clocks: &mut GenericClockController,
        sercom6: SERCOM6,
        mclk: &mut MCLK,
        ts: TS,
    ) -> Result<(SDCardController<TS>, SdDet), ()> {
        let gclk0 = clocks.gclk0();
        let sercom6_clk = clocks.sercom6_core(&gclk0).ok_or(())?;
        let pads = spi::Pads::default()
            .data_out(self.mosi)
            .data_in(self.miso)
            .sclk(self.sck);
        let spi = spi::Config::new(mclk, sercom6, pads, sercom6_clk.freq())
            .spi_mode(spi::MODE_0)
            .baud(400.khz())
            .enable();

        let cs = self.cs.into_push_pull_output();

        Ok((
            SDCardController {
                cont: embedded_sdmmc::Controller::new(SdMmcSpi::new(spi, cs), ts),
                sercom6_clk,
            },
            self.det.into(),
        ))
    }
/// Initialize the controller and its corresponding SPI bus peripheral.
Initialize the controller and its corresponding SPI bus peripheral.
Initialize the controller and its corresponding SPI bus peripheral .
pub fn init<TS: TimeSource>(
        self,
        clocks: &mut GenericClockController,
        sercom6: SERCOM6,
        mclk: &mut MCLK,
        ts: TS,
    ) -> Result<(SDCardController<TS>, SdDet), ()> {
        let gclk0 = clocks.gclk0();
        let sercom6_clk = clocks.sercom6_core(&gclk0).ok_or(())?;
        let pads = spi::Pads::default()
            .data_out(self.mosi)
            .data_in(self.miso)
            .sclk(self.sck);
        let spi = spi::Config::new(mclk, sercom6, pads, sercom6_clk.freq())
            .spi_mode(spi::MODE_0)
            .baud(400.khz())
            .enable();
        let cs = self.cs.into_push_pull_output();
        Ok((
            SDCardController {
                cont: embedded_sdmmc::Controller::new(SdMmcSpi::new(spi, cs), ts),
                sercom6_clk,
            },
            self.det.into(),
        ))
    }
pub fn init < TS : TimeSource > ( self , clocks : & mut GenericClockController , sercom6 : SERCOM6 , mclk : & mut MCLK , ts : TS , ) -> Result < ( SDCardController < TS > , SdDet ) , ( ) > { let gclk0 = clocks . gclk0 ( ) ; let sercom6_clk = clocks . sercom6_core ( & gclk0 ) . ok_or ( ( ) ) ? ; let pads = spi :: Pads :: default ( ) . data_out ( self . mosi ) . data_in ( self . miso ) . sclk ( self . sck ) ; let spi = spi :: Config :: new ( mclk , sercom6 , pads , sercom6_clk . freq ( ) ) . spi_mode ( spi :: MODE_0 ) . baud ( 400 . khz ( ) ) . enable ( ) ; let cs = self . cs . into_push_pull_output ( ) ; Ok ( ( SDCardController { cont : embedded_sdmmc :: Controller :: new ( SdMmcSpi :: new ( spi , cs ) , ts ) , sercom6_clk , } , self . det . into ( ) , ) ) }
Initialize the controller and its corresponding SPI bus peripheral.
Initialize the controller and its corresponding SPI bus peripheral .
self
clocks
&mut GenericClockController
sercom6
SERCOM6
mclk
&mut MCLK
ts
TS
self
clocks
&mut GenericClockController
sercom6
SERCOM6
mclk
&mut MCLK
ts
TS