Utilizes the internal CAN controller resources of the ESP32 to implement CAN bus data transmission and reception. Note: Before use, the device must be connected to a CAN UNIT .
Init bus n extframe True/False mode x baudrate TX RX
Get state of the controller
If any message waiting on the FIFO
Send Message with id x
list
or tuple
, and the data frame's data length is required to be 8 bytes
.Receive message
Set filter bank x mode x message
Clear filter
Clear TX queue
Clear RX queue
Restart
Deinit
Test case: Use two M5Core devices, connect the CAN UNIT to PORT C on each (if you need to use a different port, please change the pin configuration in the initialization program), and run the following program on each device. Press button A to send a data frame.