Expand description
§Phytium MCI Driver
This is a no_std Rust driver for the Phytium Memory Card Interface (MCI) controller.
It provides support for SD/MMC card operations including initialization, data transfer,
and card management.
§Architecture
The driver is organized into several modules:
- mci: Core MCI controller functionality including register access, command handling, and data transfer (DMA/PIO modes)
- mci_host: Host controller abstraction layer providing card detection, command execution, and SD/MMC card operations
- iopad: I/O pad configuration for signal timing and electrical characteristics
- osa: Operating System Abstraction layer providing memory pool management
§Features
- DMA and PIO transfer modes
- SD and eMMC card support
- Configurable bus width (1/4/8 bit)
- Variable clock frequency support
- Card detection and hot-plug support
- Voltage switching (3.3V/1.8V)
§Usage
The driver requires the user to implement the Kernel trait and use the
set_impl! macro to provide sleep functionality.
use phytium_mci::{Kernel, set_impl};
struct MyKernel;
impl Kernel for MyKernel {
fn sleep(duration: core::time::Duration) {
// Implement sleep functionality
}
}
set_impl!(MyKernel);Re-exports§
Modules§
- iopad
- I/O Pad Module
- mci
- MCI (Memory Card Interface) Controller Module
- mci_
host - MCI Host Module
- osa
- Operating System Abstraction Layer (OSA)
Macros§
- Bits
OpsFor U32 - X_REG0
- X_REG1
- genmask
- genmask_
ull - get_
reg32_ bits - set_
impl - Macro to set the kernel implementation for the driver.
- set_
reg32_ bits
Traits§
- Kernel
- Trait that must be implemented by the user to provide kernel functionality.