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
:param ~busio.SPI spi: The SPI bus used to communicate with the MCP2515
216
-
:param ~digitalio.DigitalInOut cs_pin: SPI bus enable pin
217
-
:param int baudrate: The bit rate of the bus in Hz, using a 16Mhz crystal. All devices on\
218
-
the bus must agree on this value. Defaults to 250000.
219
-
:param bool loopback: Receive only packets sent from this device, and send only to\
220
-
this device. Requires that `silent` is also set to `False`, but only prevents\
221
-
transimssion to other devices. Otherwise the send/receive behavior is normal.
222
-
:param bool silent:When `True` the controller does not transmit and all messages\
223
-
are received, ignoring errors and filters. This mode can be used to “sniff” a CAN\
224
-
bus without interfering. Defaults to `False`.
225
-
:param bool auto_restart: **Not supported by hardware. An `AttributeError`
226
-
will be raised if `auto_restart` is set to `True`** If `True`, will restart\
227
-
communications after entering bus-off state. Defaults to `False`.
228
-
:param bool debug: If `True`, will enable printing debug information. Defaults to `False`.
229
-
"""
212
+
"""A common shared-bus protocol."""
230
213
231
214
def__init__(
232
215
self,
@@ -239,6 +222,18 @@ def __init__(
239
222
auto_restart: bool=False,
240
223
debug: bool=False
241
224
):
225
+
"""A common shared-bus protocol.
226
+
:param ~busio.SPI spi: The SPI bus used to communicate with the MCP2515
227
+
:param ~digitalio.DigitalInOut cs_pin: SPI bus enable pin
228
+
:param int baudrate: The bit rate of the bus in Hz, using a 16Mhz crystal. All devices on the bus must agree on this value. Defaults to 250000.
229
+
:param bool loopback: Receive only packets sent from this device, and send only to this device. Requires that `silent` is also set to `False`, but only prevents transmission to other devices. Otherwise the send/receive behavior is normal.
230
+
:param bool silent: When `True` the controller does not transmit and all messages are received, ignoring errors and filters. This mode can be used to “sniff” a CAN bus without interfering. Defaults to `False`.
231
+
:param bool auto_restart: **Not supported by hardware. An `AttributeError` will be raised if `auto_restart` is set to `True`**
232
+
233
+
If `True`, will restart\ communications after entering bus-off state. Defaults to `False`.
234
+
235
+
:param bool debug: If `True`, will enable printing debug information. Defaults to `False`.
236
+
"""
242
237
243
238
ifloopbackandnotsilent:
244
239
raiseAttributeError("Loopback mode requires silent to be set")
@@ -329,7 +324,7 @@ def initialize(self):
329
324
330
325
self._set_mode(new_mode)
331
326
332
-
defsend(self, message_obj, wait_sent=True):
327
+
defsend(self, message_obj):
333
328
"""Send a message on the bus with the given data and id. If the message could not be sent
334
329
due to a full fifo or a bus error condition, RuntimeError is raised.
0 commit comments