diff options
author | Henrik <henrik.solver@gmail.com> | 2015-04-17 21:15:26 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-04-18 14:53:00 +0100 |
commit | e3cd1543170a9b00b75fb0d1d097f0d68dc8d45b (patch) | |
tree | 651c11d9ad82968006e3be55f00d55655caaf6ee /docs/library/pyb.CAN.rst | |
parent | 259eaab9a9de1b01ac45803fe4f0e58b90f99d84 (diff) | |
download | micropython-e3cd1543170a9b00b75fb0d1d097f0d68dc8d45b.tar.gz micropython-e3cd1543170a9b00b75fb0d1d097f0d68dc8d45b.zip |
stmhal: Add support for sending and receiving CAN RTR messages.
Diffstat (limited to 'docs/library/pyb.CAN.rst')
-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 |