All ESP32 variants integrate a so-called TWAI (Two-Wire Automotive Interface) controller. The TWAI is compatible with the ISO11898-1 protocol and corresponds to a CAN2.0 interface. So the Espressif Controllers also become interesting for all industrial applications where CAN Bus Interface is used for communication.
A description of the Two-Wire Automotive Interface and the driver configuration can be found in the ESP-IDF Programming Guide, the driver component itself and examples are in the ESP-IDF directory on Github.
It should be mentioned that in any case an external CAN transceiver is needed to physically connect the ESP32 to a CAN network.
To help developers get started, Espressif also provides software examples. The TWAI Network Example is a demo application that shows how to use the TWAI driver to program a target (ESP32, etc.) as a TWAI node and let two (or more) nodes communicate over a TWAI network. You can run the TWAI Self Test Example before to check if your CAN transceiver is connected to your ESP32 board correctly.
You have to make sure to use the right GPIOs on your board for TX and RX. You find a description of each board in the Programming Guide. See below links to some popular boards to easily find the description:
To get started with Espressif development environment check out also our other docs regarding Espressif.
Espressif is providing more ressources on their webpages: