Is there a Library connect MicroSDHC via SPI

Hi,

i want/need to connect & access a microSD Card (32GB) on an breakout board via SPI (technical reasons) and want to use the suggested PINS (28-31) as in the intermediate lesson 5 exercise 1.

Is there a separate library (except the described spi, gios, devicetree) available/required, like an SD.h?

Thanks for hints/suggestions

Parents Reply Children
  • // nrf52dk_nrf52832.overlay:

    &spi0 { status = "disabled";};
    &i2c1 { status = "disabled";};

    &spi1 {
    /* What about this property?? */
    //compatible = "nordic,nrf-spi";//using SPI as per ERRATA 58
    status = "okay";
    pinctrl-0 = <&spi1_default>;
    pinctrl-1 = <&spi1_sleep>;
    pinctrl-names="default", "sleep";
    cs-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
    sdhc0: sdhc@0 {
    compatible = "zephyr,sdhc-spi-slot";
    status = "okay";
    reg = <0>;
    mmc {
    compatible = "zephyr,sdmmc-disk";
    status = "okay";
    disk-name = "MMC SD";
    };
    spi-max-frequency = <24000000>; //max frequency up to 25MHZ
    };
    };

    /* Change the pin configuration */
    &pinctrl{
    spi1_default: spi1_default{
    group1{
    psels=<NRF_PSEL(SPIM_SCK, 0, 28)>,
    <NRF_PSEL(SPIM_MOSI, 0, 29)>,
    <NRF_PSEL(SPIM_MISO, 0, 30)>;
    };
    };
    spi1_sleep: spi1_sleep{
    group1{
    psels=<NRF_PSEL(SPIM_SCK, 0, 28)>,
    <NRF_PSEL(SPIM_MOSI, 0, 29)>,
    <NRF_PSEL(SPIM_MISO, 0, 30)>;
    low-power-enable;
    };
    };

    };
Related