|
| 1 | +.. _sdhc_api: |
| 2 | + |
| 3 | + |
| 4 | +SDHC |
| 5 | +#### |
| 6 | + |
| 7 | +The SDHC api offers a generic interface for interacting with an SD host |
| 8 | +controller device. It is used by the SD subsystem, and is not intended to be |
| 9 | +directly used by the application |
| 10 | + |
| 11 | +Basic Operation |
| 12 | +*************** |
| 13 | + |
| 14 | +SD Host Controller |
| 15 | +================== |
| 16 | + |
| 17 | +An SD host controller is a device capable of sending SD commands to an attached |
| 18 | +SD card. These commands can be sent using the native SD protocol, or over SPI. |
| 19 | +the SDHC api is designed to provide a generic way to send commands to and |
| 20 | +interact with attached SD devices. |
| 21 | + |
| 22 | +Requests |
| 23 | +======== |
| 24 | + |
| 25 | +The core of the SDHC api is the :c:func:`sdhc_request` api. Requests contain a |
| 26 | +:c:struct:`sdhc_command` command structure, and an optional |
| 27 | +:c:struct:`sdhc_data` data structure. The caller may check the return code, |
| 28 | +or the ``response`` field of the SD command structure to determine if the |
| 29 | +SDHC request succeeded. The data structure allows the caller to specify a |
| 30 | +number of blocks to transfer, and a buffer location to read or write them from. |
| 31 | +Whether the provided buffer is used for sending or reading data depends on the |
| 32 | +command opcode provided. |
| 33 | + |
| 34 | +Host Controller I/O |
| 35 | +=================== |
| 36 | + |
| 37 | +The :c:func:`sdhc_set_io` api allows the user to change I/O settings of the SD |
| 38 | +host controller, such as clock frequency, I/O voltage, and card power. Not all |
| 39 | +controllers will support applying all I/O settings. For example, SPI mode |
| 40 | +controllers typically cannot toggle power to the SD card. |
| 41 | + |
| 42 | +Related configuration options: |
| 43 | + |
| 44 | +* :kconfig:option:`CONFIG_SDHC` |
| 45 | + |
| 46 | +API Reference |
| 47 | +************* |
| 48 | + |
| 49 | +.. doxygengroup:: sdhc_interface |
0 commit comments