8000 Add to can docs · micropython/micropython@111247b · GitHub
[go: up one dir, main page]

Skip to content

Commit 111247b

Browse 10000 files
anfroholicIhorNehrutsa
authored andcommitted
Add to can docs
Add more commands and fix some errors in docs
1 parent bea5e26 commit 111247b

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
@@ -398,11 +398,16 @@ Any available output-capablepins can be used for TX, RX, BUS-OFF, and CLKOUT sig
398398
The driver is accessed via the :ref:`machine.CAN <machine.CAN>` class::
399399

400400
from machine import CAN
401-
BAUDRATE_500k = 500
402-
can = CAN(0, extframe=True, mode=CAN.LOOPBACK, baudrate=BAUDRATE_500k)
403-
dev.setfilter(0, CAN.FILTER_ADDRESS, [0x102, 0]) # set a filter to receive messages with id = 0x102
404-
can.send([1,2,3], 0x102) # send a message with id 123
405-
can.recv() # receive message
401+
can = CAN(0, tx=4, rx=16, extframe=True, mode=CAN.LOOPBACK, baudrate=500000)
402+
can.setfilter(0, CAN.FILTER_ADDRESS, [0x102, 0]) # set a filter to receive messages with id = 0x102
403+
can.send([1,2,3], 0x102) # send a message with id 123
404+
can.recv() # receive message
405+
406+
can.any() # returns True if FIFO is not empty, else False
407+
can.info() # get information about the controller’s error states and TX and RX buffers
408+
can.deinit() # turn off the can bus
409+
can.clear_rx_queue() # clear messages in the FIFO
410+
can.clear_tx_queue() # clear messages in the transmit buffer
406411

407412
Real time clock (RTC)
408413
---------------------

0 commit comments

Comments
 (0)
0