Skip to content

Commit e653816

Browse files
tmon-nordicnashif
authored andcommitted
doc: usb: include new MSC device API
Add doxygen group with MSC device API and document macro to create mapping between disk access and MSC LUN. Signed-off-by: Tomasz Moń <[email protected]> Signed-off-by: Johann Fischer <[email protected]>
1 parent 52dbc33 commit e653816

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

doc/connectivity/usb/device_next/api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ New USB device support APIs
1010
usbd.rst
1111
usbd_hid_device.rst
1212
uac2_device.rst
13+
usbd_msc_device.rst
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. _usbd_msc_device:
2+
3+
USB Mass Storage Class device API
4+
#################################
5+
6+
USB Mass Storage Class device API defined in
7+
:zephyr_file:`include/zephyr/usb/class/usbd_msc.h`.
8+
9+
API Reference
10+
*************
11+
12+
.. doxygengroup:: usbd_msc_device

doc/connectivity/usb/device_next/usb_device.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ instance (`n`) and is used as an argument to the :c:func:`usbd_register_class`.
4141
+-----------------------------------+-------------------------+-------------------------+
4242
| USB CDC ECM class | Ethernet device | :samp:`cdc_ecm_{n}` |
4343
+-----------------------------------+-------------------------+-------------------------+
44-
| USB Mass Storage Class (MSC) | :ref:`disk_access_api` | :samp:`msc_{n}` |
44+
| USB Mass Storage Class (MSC) | :ref:`usbd_msc_device` | :samp:`msc_{n}` |
4545
+-----------------------------------+-------------------------+-------------------------+
4646
| USB Human Interface Devices (HID) | :ref:`usbd_hid_device` | :samp:`hid_{n}` |
4747
+-----------------------------------+-------------------------+-------------------------+

include/zephyr/usb/class/usbd_msc.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ struct usbd_msc_lun {
2323
const char *revision;
2424
};
2525

26+
/**
27+
* @brief USB Mass Storage Class device API
28+
* @defgroup usbd_msc_device USB Mass Storage Class device API
29+
* @ingroup usb
30+
* @{
31+
*/
32+
33+
/**
34+
* @brief Define USB Mass Storage Class logical unit
35+
*
36+
* Use this macro to create Logical Unit mapping in USB MSC for selected disk.
37+
* Up to `CONFIG_USBD_MSC_LUNS_PER_INSTANCE` disks can be registered on single
38+
* USB MSC instance. Currently only one USB MSC instance is supported.
39+
*
40+
* @param disk_name Disk name as used in @ref disk_access_interface
41+
* @param t10_vendor T10 Vendor Indetification
42+
* @param t10_product T10 Product Identification
43+
* @param t10_revision T10 Product Revision Level
44+
*/
2645
#define USBD_DEFINE_MSC_LUN(disk_name, t10_vendor, t10_product, t10_revision) \
2746
STRUCT_SECTION_ITERABLE(usbd_msc_lun, usbd_msc_lun_##disk_name) = { \
2847
.disk = STRINGIFY(disk_name), \
@@ -31,4 +50,8 @@ struct usbd_msc_lun {
3150
.revision = t10_revision, \
3251
}
3352

53+
/**
54+
* @}
55+
*/
56+
3457
#endif /* ZEPHYR_INCLUDE_USB_CLASS_USBD_MSC_H_ */

0 commit comments

Comments
 (0)