Skip to content

Commit 52dbc33

Browse files
jfischer-nonashif
authored andcommitted
doc: usb: make example code most left-aligned
Make example code most left-aligned. Also use :samp: to format identification strings in the table. Followup on commit 8739efe ("doc: usb: add initial USB device configuraiton howto"). Signed-off-by: Johann Fischer <[email protected]>
1 parent 836c2cc commit 52dbc33

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

doc/connectivity/usb/device_next/usb_device.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ The USB device stack has built-in USB functions. Some can be used directly in
3030
the user application through a special API, such as HID or Audio class devices,
3131
while others use a general Zephyr RTOS driver API, such as MSC and CDC class
3232
implementations. The *Identification string* identifies a class or function
33-
instance (n) and is used as an argument to the :c:func:`usbd_register_class`.
33+
instance (`n`) and is used as an argument to the :c:func:`usbd_register_class`.
3434

3535
+-----------------------------------+-------------------------+-------------------------+
3636
| Class or function | User API (if any) | Identification string |
3737
+===================================+=========================+=========================+
38-
| USB Audio 2 class | :ref:`uac2_device` | uac2_(n) |
38+
| USB Audio 2 class | :ref:`uac2_device` | :samp:`uac2_{n}` |
3939
+-----------------------------------+-------------------------+-------------------------+
40-
| USB CDC ACM class | :ref:`uart_api` | cdc_acm_(n) |
40+
| USB CDC ACM class | :ref:`uart_api` | :samp:`cdc_acm_{n}` |
4141
+-----------------------------------+-------------------------+-------------------------+
42-
| USB CDC ECM class | Ethernet device | cdc_ecm_(n) |
42+
| USB CDC ECM class | Ethernet device | :samp:`cdc_ecm_{n}` |
4343
+-----------------------------------+-------------------------+-------------------------+
44-
| USB Mass Storage Class (MSC) | :ref:`disk_access_api` | msc_(n) |
44+
| USB Mass Storage Class (MSC) | :ref:`disk_access_api` | :samp:`msc_{n}` |
4545
+-----------------------------------+-------------------------+-------------------------+
46-
| USB Human Interface Devices (HID) | :ref:`usbd_hid_device` | hid_(n) |
46+
| USB Human Interface Devices (HID) | :ref:`usbd_hid_device` | :samp:`hid_{n}` |
4747
+-----------------------------------+-------------------------+-------------------------+
48-
| Bluetooth HCI USB transport layer | :ref:`bt_hci_raw` | bt_hci_(n) |
48+
| Bluetooth HCI USB transport layer | :ref:`bt_hci_raw` | :samp:`bt_hci_{n}` |
4949
+-----------------------------------+-------------------------+-------------------------+
5050

5151
Samples
@@ -99,6 +99,7 @@ must not be directly accessed or manipulated by the application.
9999

100100
.. literalinclude:: ../../../../samples/subsys/usb/common/sample_usbd_init.c
101101
:language: c
102+
:dedent:
102103
:start-after: doc device instantiation start
103104
:end-before: doc device instantiation end
104105

@@ -112,6 +113,7 @@ require a single instantiation of the language descriptor using the
112113

113114
.. literalinclude:: ../../../../samples/subsys/usb/common/sample_usbd_init.c
114115
:language: c
116+
:dedent:
115117
:start-after: doc string instantiation start
116118
:end-before: doc string instantiation end
117119

@@ -120,6 +122,7 @@ initializing the USB device with :c:func:`usbd_add_descriptor`.
120122

121123
.. literalinclude:: ../../../../samples/subsys/usb/common/sample_usbd_init.c
122124
:language: c
125+
:dedent:
123126
:start-after: doc add string descriptor start
124127
:end-before: doc add string descriptor end
125128

@@ -129,6 +132,7 @@ a configuration. Later, USB device functions are assigned to a configuration.
129132

130133
.. literalinclude:: ../../../../samples/subsys/usb/common/sample_usbd_init.c
131134
:language: c
135+
:dedent:
132136
:start-after: doc configuration instantiation start
133137
:end-before: doc configuration instantiation end
134138

@@ -140,6 +144,7 @@ configuration will get ``bConfigurationValue`` one, and then further upward.
140144

141145
.. literalinclude:: ../../../../samples/subsys/usb/common/sample_usbd_init.c
142146
:language: c
147+
:dedent:
143148
:start-after: doc configuration register start
144149
:end-before: doc configuration register end
145150

@@ -155,6 +160,7 @@ instances.
155160

156161
.. literalinclude:: ../../../../samples/subsys/usb/common/sample_usbd_init.c
157162
:language: c
163+
:dedent:
158164
:start-after: doc functions register start
159165
:end-before: doc functions register end
160166

@@ -173,6 +179,7 @@ steps, which should be performed prior to initializing the USB device.
173179

174180
.. literalinclude:: ../../../../samples/subsys/usb/common/sample_usbd_init.c
175181
:language: c
182+
:dedent:
176183
:start-after: doc device init start
177184
:end-before: doc device init end
178185

@@ -183,5 +190,6 @@ enumerating the device. The application can disable the USB device using
183190

184191
.. literalinclude:: ../../../../samples/subsys/usb/hid-keyboard/src/main.c
185192
:language: c
193+
:dedent:
186194
:start-after: doc device enable start
187195
:end-before: doc device enable end

0 commit comments

Comments
 (0)