You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: shared-bindings/_canio/CAN.c
+55-9Lines changed: 55 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -42,30 +42,35 @@
42
42
//| """CAN bus protocol"""
43
43
//|
44
44
//| def __init__(self,
45
-
//| rx: microcontroller.Pin,
45
+
//| rx: Optional[microcontroller.Pin]=None,
46
46
//| tx: Optional[microcontroller.Pin]=None,
47
47
//| *,
48
48
//| baudrate: int = 250000,
49
49
//| loopback: bool = False,
50
50
//| auto_restart: bool = False,
51
51
//| ):
52
52
//| """A common shared-bus protocol. The rx and tx pins are generally
53
-
//| connected to a transceiver which controls the H and L pins on a shared
54
-
//| bus.
53
+
//| connected to a transceiver which controls the H and L pins on a
54
+
//| shared bus.
55
55
//|
56
-
//| :param ~microcontroller.Pin rx: the pin to receive with.
57
-
//| :param ~microcontroller.Pin tx: the pin to transmit with, or None if the peripheral should operate in "silent" mode.
56
+
//| Normally, both ``tx`` and ``rx`` pins will be specified. However,
57
+
//| in silent and loopback modes, the other pin may not be required and
58
+
//| can be used for other purposes.
59
+
//|
60
+
//| :param ~microcontroller.Pin rx: the pin to receive with, or None.
61
+
//| :param ~microcontroller.Pin tx: the pin to transmit with, or None.
58
62
//| :param int baudrate: The bit rate of the bus in Hz. All devices on the bus must agree on this value.
59
-
//| :param bool loopback: True if the peripheral will be operated in loopback mode.
63
+
//| :param bool loopback: True if the peripheral will be operated in loopback mode. In loopback mode, the ``rx`` pin's value is ignored, and the device receives the packets it sends.
64
+
//| :param bool silent: True if the peripheral will be operated in silent mode. In silent mode, the ``tx`` pin is always driven to the high logic level. This mode can be used to "sniff" a CAN bus without interfering.
60
65
//| :param bool auto_restart: If True, will restart communications after entering bus-off state
0 commit comments