diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/library/pyb.CAN.rst | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/docs/library/pyb.CAN.rst b/docs/library/pyb.CAN.rst index 46e6d08cf1..e5d2b9acb1 100644 --- a/docs/library/pyb.CAN.rst +++ b/docs/library/pyb.CAN.rst @@ -82,7 +82,7 @@ Methods Turn off the CAN bus. -.. method:: can.setfilter(bank, mode, fifo, params) +.. method:: can.setfilter(bank, mode, fifo, params, \*, rtr) Configure a filter bank: @@ -107,6 +107,23 @@ Methods |CAN.MASK32 |As with CAN.MASK16 but with only one 32 bit id/mask pair.| +-----------+---------------------------------------------------------+ + - ``rtr`` is an array of booleans that states if a filter should accept a + remote transmission request message. If this argument is not given + then it defaults to False for all entries. The length of the array + depends on the ``mode`` argument. + + +-----------+----------------------+ + |``mode`` |length of rtr array | + +===========+======================+ + |CAN.LIST16 |4 | + +-----------+----------------------+ + |CAN.LIST32 |2 | + +-----------+----------------------+ + |CAN.MASK16 |2 | + +-----------+----------------------+ + |CAN.MASK32 |1 | + +-----------+----------------------+ + .. method:: can.clearfilter(bank) Clear and disables a filter bank: @@ -124,15 +141,24 @@ Methods - ``fifo`` is an integer, which is the FIFO to receive on - ``timeout`` is the timeout in milliseconds to wait for the receive. - Return value: buffer of data bytes. + Return value: A tuple containing four values. + + - The id of the message. + - A boolean that indicates if the message is an RTR message. + - The FMI (Filter Match Index) value. + - An array containing the data. -.. method:: can.send(send, addr, \*, timeout=0) +.. method:: can.send(data, id, \*, timeout=0, rtr=False) Send a message on the bus: - - ``send`` is the data to send (an integer to send, or a buffer object). - - ``addr`` is the address to send to + - ``data`` is the data to send (an integer to send, or a buffer object). + - ``id`` is the id of the message to be sent. - ``timeout`` is the timeout in milliseconds to wait for the send. + - ``rtr`` is a boolean that specifies if the message shall be sent as + a remote transmission request. If ``rtr`` is True then only the length + of ``data`` is used to fill in the DLC slot of the frame; the actual + bytes in ``data`` are unused. If timeout is 0 the message is placed in a buffer in one of three hardware buffers and the method returns immediately. If all three buffers are in use |