Skip to content

Commit ff7af02

Browse files
authored
Merge pull request #3 from anfroholic/pr/5310
@anfroholic Thank you very much.
2 parents 7e8a8f4 + 3d1e2f4 commit ff7af02

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/esp32/quickref.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,16 @@ Any available output-capablepins can be used for TX, RX, BUS-OFF, and CLKOUT sig
390390
The driver is accessed via the :ref:`machine.CAN <machine.CAN>` class::
391391

392392
from machine import CAN
393-
BAUDRATE_500k = 500
394-
can = CAN(0, extframe=True, mode=CAN.LOOPBACK, baudrate=BAUDRATE_500k)
395-
dev.setfilter(0, CAN.FILTER_ADDRESS, [0x102, 0]) # set a filter to receive messages with id = 0x102
396-
can.send([1,2,3], 0x102) # send a message with id 123
397-
can.recv() # receive message
393+
can = CAN(0, tx=4, rx=16, extframe=True, mode=CAN.LOOPBACK, baudrate=500000)
394+
can.setfilter(0, CAN.FILTER_ADDRESS, [0x102, 0]) # set a filter to receive messages with id = 0x102
395+
can.send([1,2,3], 0x102) # send a message with id 123
396+
can.recv() # receive message
397+
398+
can.any() # returns True if FIFO is not empty, else False
399+
can.info() # get information about the controller’s error states and TX and RX buffers
400+
can.deinit() # turn off the can bus
401+
can.clear_rx_queue() # clear messages in the FIFO
402+
can.clear_tx_queue() # clear messages in the transmit buffer
398403
399404
Real time clock (RTC)
400405
---------------------

0 commit comments

Comments
 (0)