# SD/MMC Driver Overview

This is a driver for interfacing SD and MMC cards. It provides an asynchronous interface against the application level.

The following diagram is a high-level overview of the SD/MMC driver. The "SD/MMC block device" implements the standard block_device interface. The "SD/MMC request interface" is the external interface, and it's conforming to the asynchronous interface design (see Asynchronous Request Architecture). The "SD/MMC probe engine" is a task running in a workqueue probing for presense of cards.

## SD/MMC init

The SD/MMC driver needs to be initialized before use and this is done with the following function. This function will return a sdmmc_host structure.

- sdmmc_host_init():

## SD/MMC card probing

sdmmc_host contains one or two sdmmc_slot depending on the configuration. And the following funtion starts a probe task for the specified slot. This function takes slot, workqueue to use and callback for events as arguments.

- sdmmc_slot_probe_init():

## SD/MMC request management

For general introduction to asynchronous request management see Async-architecture.

A sdmmc_request contains parts of the typical data for a communication sequence against a SD or MMC card. One of the field is required and that is the command (sdmmc_request::cmd). Other optional fields are: