pub fn new<PINS: Pins>(sdio: SDIO, _pins: PINS, clocks: Clocks) -> Self {
        unsafe {
            //NOTE(unsafe) this reference will only be used for atomic writes with no side effects
            let rcc = &*RCC::ptr();
            // Enable and reset the sdio peripheral, it's the same bit position for both registers
            SDIO::enable(rcc);
            SDIO::reset(rcc);
        }

        // Configure clock
        sdio.clkcr.write(|w| {
            w.widbus()
                .bus_width1()
                .clken()
                .enabled()
                .clkdiv()
                .bits(ClockFreq::F400Khz as u8)
                .pwrsav()
                .disabled()
                .bypass()
                .disabled()
                .negedge()
                .rising()
                .hwfc_en()
                .enabled()
        });

        let mut host = Sdio {
            sdio,
            bw: PINS::BUSWIDTH,
            card: None,
            clocks,
        };

        // Make sure card is powered off
        host.power_card(false);
        host
    }
/// Create and enable the Sdio device
Create and enable the Sdio device
Create and enable the Sdio device
pub fn new<PINS: Pins>(sdio: SDIO, _pins: PINS, clocks: Clocks) -> Self {
        unsafe {
            //NOTE(unsafe) this reference will only be used for atomic writes with no side effects
            let rcc = &*RCC::ptr();
            // Enable and reset the sdio peripheral, it's the same bit position for both registers
            SDIO::enable(rcc);
            SDIO::reset(rcc);
        }
        // Configure clock
        sdio.clkcr.write(|w| {
            w.widbus()
                .bus_width1()
                .clken()
                .enabled()
                .clkdiv()
                .bits(ClockFreq::F400Khz as u8)
                .pwrsav()
                .disabled()
                .bypass()
                .disabled()
                .negedge()
                .rising()
                .hwfc_en()
                .enabled()
        });
        let mut host = Sdio {
            sdio,
            bw: PINS::BUSWIDTH,
            card: None,
            clocks,
        };
        // Make sure card is powered off
        host.power_card(false);
        host
    }
pub fn new < PINS : Pins > ( sdio : SDIO , _pins : PINS , clocks : Clocks ) -> Self { unsafe { //NOTE(unsafe) this reference will only be used for atomic writes with no side effects let rcc = & * RCC :: ptr ( ) ; // Enable and reset the sdio peripheral, it's the same bit position for both registers SDIO :: enable ( rcc ) ; SDIO :: reset ( rcc ) ; } // Configure clock sdio . clkcr . write ( | w | { w . widbus ( ) . bus_width1 ( ) . clken ( ) . enabled ( ) . clkdiv ( ) . bits ( ClockFreq :: F400Khz as u8 ) . pwrsav ( ) . disabled ( ) . bypass ( ) . disabled ( ) . negedge ( ) . rising ( ) . hwfc_en ( ) . enabled ( ) } ) ; let mut host = Sdio { sdio , bw : PINS :: BUSWIDTH , card : None , clocks , } ; // Make sure card is powered off host . power_card ( false ) ; host }
Create and enable the Sdio device
Create and enable the Sdio device
sdio
SDIO
_pins
PINS
clocks
Clocks
sdio
SDIO
_pins
PINS
clocks
Clocks