Skip to content

Commit 8dc3d51

Browse files
danieldegrassedleach02
authored andcommitted
doc: peripherals: add documentation for SDHC peripheral
add documentation for SDHC peripheral driver. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 102f4c2 commit 8dc3d51

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

doc/hardware/peripherals/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Peripherals
3535
regulators.rst
3636
reset.rst
3737
rtc.rst
38+
sdhc.rst
3839
sensor.rst
3940
spi.rst
4041
tcpc.rst

doc/hardware/peripherals/sdhc.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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

Comments
 (0)