Skip to content

Commit 25bcbfb

Browse files
committed
Add ESP32 related docs
1 parent b31cb2e commit 25bcbfb

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

API.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Returns `1` on success, `0` on failure.
2121

2222
### Set pins
2323

24+
#### MCP2515
25+
2426
Override the default `CS` and `INT` pins used by the library. **Must** be called before `CAN.begin(...)`.
2527

2628
```arduino
@@ -31,8 +33,22 @@ CAN.setPins(cs, irq);
3133

3234
This call is optional and only needs to be used if you need to change the default pins used.
3335

36+
#### ESP32
37+
38+
Override the default `CTX` and `CRX` pins used by the library. **Must** be called before `CAN.begin(...)`.
39+
40+
```arduino
41+
CAN.setPins(rx, tx);
42+
```
43+
* `rx` - new CRX pin to use, defaults to `4`
44+
* `tx` - new CTX pin to use, defaults to `5`.
45+
46+
This call is optional and only needs to be used if you need to change the default pins used.
47+
3448
### Set SPI Frequency
3549

50+
**MCP2515 only**
51+
3652
Override the default SPI frequency of 10 MHz used by the library. **Must** be called before `CAN.begin(...)`.
3753

3854
```arduino
@@ -44,6 +60,8 @@ This call is optional and only needs to be used if you need to change the defaul
4460

4561
### Set Clock Frequency
4662

63+
**MCP2515 only**
64+
4765
Override the default clock source frequency that is connected to the MCP2515. **Must** be called before `CAN.begin(...)`.
4866

4967
```arduino

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ An Arduino library for sending and receiving data using CAN bus.
77
## Compatible Hardware
88

99
* [Microchip MCP2515](http://www.microchip.com/wwwproducts/en/en010406) based boards/shields
10+
* [Espressif ESP32](http://espressif.com/en/products/hardware/esp32/overview)'s built-in [SJA1000](https://www.nxp.com/products/analog/interfaces/in-vehicle-network/can-transceiver-and-controllers/stand-alone-can-controller:SJA1000T) compatible CAN controller with an external 3.3V CAN transceiver
1011

1112
### Microchip MCP2515 wiring
1213

@@ -25,6 +26,19 @@ An Arduino library for sending and receiving data using CAN bus.
2526

2627
**NOTE**: Logic level converters must be used for boards which operate at 3.3V.
2728

29+
### Espressif ESP32 wiring
30+
31+
Requires an external 3.3V CAN transceiver, such as a [TI SN65HVD230](http://www.ti.com/product/SN65HVD230).
32+
33+
| CAN transceiver | ESP32 |
34+
| :-------------: | :---: |
35+
| 3V3 | 3V3 |
36+
| GND | GND |
37+
| CTX | 5 |
38+
| CRX | 4 |
39+
40+
`CTX` and `CRX` pins can be changed by using `CAN.setPins(rx, tx)`.
41+
2842
## Installation
2943

3044
### Using the Arduino IDE Library Manager
@@ -51,4 +65,4 @@ See [examples](examples) folder.
5165

5266
## License
5367

54-
This libary is [licensed](LICENSE) under the [MIT Licence](http://en.wikipedia.org/wiki/MIT_License).
68+
This library is [licensed](LICENSE) under the [MIT Licence](http://en.wikipedia.org/wiki/MIT_License).

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version=0.0.0
33
author=Sandeep Mistry <[email protected]>
44
maintainer=Sandeep Mistry <[email protected]>
55
sentence=An Arduino library for sending and receiving data using CAN bus.
6-
paragraph=Supports Microchip MCP2515 based boards/shields.
6+
paragraph=Supports Microchip MCP2515 based boards/shields and the Espressif ESP32's built-in SJA1000 compatible CAN controller.
77
category=Communication
88
url=https://github.com/sandeepmistry/arduino-CAN
99
architectures=*

0 commit comments

Comments
 (0)