Skip to main content

Crate sdmmc

Crate sdmmc 

Source
Expand description

§SD/MMC/eMMC Driver Library

This library provides a no_std driver for SD, MMC, and eMMC storage devices on ARM64 platforms, specifically optimized for Rockchip RK3568/RK3588 platforms.

§Features

  • no_std compatible: Works without the standard library
  • eMMC 4.x/5.x support: Full support for eMMC standards including HS200/HS400 modes
  • SD/SDIO support: Support for SD 1.0/2.0 and SDIO devices
  • PIO and DMA modes: Choose between programmed I/O or DMA for data transfers
  • Rockchip optimization: Specifically optimized for Rockchip platforms with DWCMSHC controller
  • Type-safe register access: Safe hardware register operations

§Platform Support

Currently optimized for:

  • Rockchip RK3568
  • Rockchip RK3588
  • Other platforms using DWCMSHC SDHCI controller

§Usage Example

use sdmmc::emmc::EMmcHost;

// Create EMMC controller instance at hardware base address
let mut emmc = EMmcHost::new(0xfe2e0000);

// Initialize the controller and card
match emmc.init() {
    Ok(_) => {
        println!("EMMC initialized successfully");
    }
    Err(e) => {
        println!("EMMC initialization failed: {:?}", e);
    }
}

§Features

  • pio (default): Use PIO (Programmed I/O) for data transfers
  • dma: Use DMA (Direct Memory Access) for data transfers

§Modules

  • emmc: Main EMMC controller implementation
  • err: Error types and handling

Modules§

emmc
err

Macros§

set_impl
Register a Kernel implementation for delay functions

Constants§

BLOCK_SIZE

Traits§

Kernel
Kernel trait for platform-specific delay implementation

Functions§

dump_memory_region
Dump memory region for debugging purposes