Skip to content

Commit dfa39df

Browse files
committed
fix more formatting
1 parent 9358acb commit dfa39df

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

docs/tildagon-apps/reference/badge-hardware.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,6 @@ The PD module allows sending and receiving PD messages on the USB in and out por
604604

605605
### Example
606606

607-
608607
```python
609608
import settings
610609
from app import App
@@ -629,7 +628,9 @@ class LedSyncApp(App):
629628
)
630629
eventbus.on(events.VendorMsgDevRxEvent, self._handle_dev_msg, self)
631630
eventbus.on(events.VendorMsgHostRxEvent, self._handle_host_msg, self)
632-
eventbus.on(events.BadgeAsHostAttachEvent, self._handle_host_detect, self)
631+
eventbus.on(
632+
events.BadgeAsHostAttachEvent, self._handle_host_detect, self
633+
)
633634
self.state = main_menu_items[0]
634635

635636
def _handle_dev_msg(self, event: VendorMsgDevRxEvent):
@@ -680,23 +681,25 @@ __app_export__ = LedSyncApp
680681
### Usage
681682

682683
To use either of the USB ports for PD communications, import the Host or Device classes. To assist with the creation of a message import the helper.
684+
683685
```python
684686
from pd import Host, Device
685687
```
686688

687-
Then create the objects,
689+
Then create the objects,
690+
688691
```python
689692
usb_in = Device()
690693
usb_out = Host()
691694
```
692695

693696
Check the connection state and send a message
697+
694698
```python
695699
if usb_out.pd_enabled():
696700
usb_out.send_vendor_msg(data, length)
697701
```
698702

699-
700703
### Methods
701704

702705
Both the Host and Device ports support the following methods.
@@ -748,6 +751,7 @@ pdh.device_send_badge_id()
748751
```
749752

750753
### Usage
754+
751755
The helper can be used as follows to create the headers required for a discover identity command.
752756

753757
```python
@@ -768,13 +772,13 @@ usb_out.send_prime_msg(
768772

769773
<!-- prettier-ignore -->
770774
| Method | Description | Arguments | Returns |
771-
| ------ | ----------- | --------- | ------- |
775+
| ------ | ----------- | --------- | ------- |
772776
| device_send_badge_id | Sends the id used to detect another badge on the USB in port | None | None |
773777
| host_disc_id_dbl_prime | Sends the discover identity command to a cables plug | None | None |
774-
| host_disc_id_prime | None | None |
778+
| host_disc_id_prime | Sends the discover identity command to a cables plug | None | None |
775779
| host_send_badge_id | Sends the id used to detect another badge on the USB out port | None | None |
776780
| pd_header | Create a message header with space for the badge to fill in physical layer info | `message_type`(`int`): see dataType and cmdType below, `no_objects`(`int`): number of 4 byte objects, optional, default 0 | `header`(`int`): 16 bit header |
777-
| vdm_structured_header | Creates a structured vendor header | `command`(`int`): see vdmCmd below, `SVID`(`int`): Standard or Vendor ID, optional, default 0xFF00, `obj_pos`(`int`):For the Enter Mode, Exit Mode and Attention Commands, optional, default 0, `version`(`int`): Structured VDM Version, optional, default 0, | `vendor_header`(`int`): 32 bit vendor header |
781+
| vdm_structured_header | Creates a structured vendor header | `command`(`int`): see vdmCmd below, `SVID`(`int`): Standard or Vendor ID, optional, default 0xFF00, `obj_pos`(`int`):For the Enter Mode, Exit Mode and Attention Commands, optional, default 0, `version`(`int`): Structured VDM Version, optional, default 0, | `vendor_header`(`int`): 32 bit vendor header |
778782
| vdm_unstructured_header | Creates an unstructured vendor header | `SVID`(`int`): optional, default 0xFF00, `data`(`int`): 15 bits of vendor defined data | `vendor_header`(`int`): 32 bit vendor header |
779783
| vdm_header_extract | extract the fields of a vendor header | `vendor_header`(`int`): 32 bit vendor header | `vendor_header`(`dict`): dictionary containing each field of the header |
780784

@@ -783,8 +787,8 @@ usb_out.send_prime_msg(
783787
The following constants are available for use in the two headers.
784788

785789
<!-- prettier-ignore -->
786-
| Class | Constant |
787-
| ------ | ----------- |
790+
| Class | Constant |
791+
| ------ | ----------- |
788792
| vdmCmd | DISCOVER_IDENTITY |
789793
| vdmCmd | DISCOVER_SVIDS |
790794
| vdmCmd | DISCOVER_MODES |

0 commit comments

Comments
 (0)