You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarified documentation for supportability of newer ESP32 variants
Added info on how to check if the selected pins are valid
Corrects pin validation for ESP32 S2 and ESP32 C3 devices
Copy file name to clipboardExpand all lines: README.md
+40-1Lines changed: 40 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# EspSoftwareSerial
2
2
3
-
## Implementation of the Arduino software serial library for the ESP8266 / ESP32
3
+
## Implementation of the Arduino software serial library for the ESP8266 / ESP32 family
4
4
5
5
This fork implements interrupt service routine best practice.
6
6
In the receive interrupt, instead of blocking for whole bytes
@@ -27,6 +27,8 @@ ongoing, there will be some inexactness in interrupt timings. This may
27
27
lead to inevitable, but few, bit errors when having heavy data traffic
28
28
at high baud rates.
29
29
30
+
This library supports ESP8266, ESP32, ESP32-S2 and ESP32-C3 devices
31
+
30
32
## Resource optimization
31
33
32
34
The memory footprint can be optimized to just fit the amount of expected
@@ -97,6 +99,43 @@ To detect incoming bytes with the parity bit set (MARK parity), use the
97
99
``readParity()`` function. To send a byte with the parity bit set, just add
98
100
``MARK`` as the second argument when writing, e.g. ``write(ch, SWSERIAL_PARITY_MARK)``.
99
101
102
+
## Checking for correct pin selection / configuration
103
+
In general, most pins on the ESP8266 and ESP32 devices can be used by SoftwareSerial,
104
+
however each device has a number of pins that have special functions or require careful
105
+
handling to prevent undesirable situations, for example they are connected to the
106
+
on-board SPI flash memory or they are used to determine boot and programming modes
107
+
after powerup or brownouts. These pins are not able to be configured by this library.
108
+
109
+
The exact list for each device can be found in the [ESP32 data sheet](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf)
110
+
in sections 2.2 (Pin Descriptions) and 2.4 (Strapping pins) or by referring to the
111
+
``isValidGPIOpin()``, ``isValidRxGPIOpin()`` and ``isValidTxGPIOpin()`` functions
112
+
113
+
The easiest and safest method is to test the object returned at runtime, to see if
114
+
its valid. For example:
115
+
116
+
```
117
+
#include <SoftwareSerial.h>
118
+
119
+
#define MYPORT_TX 12
120
+
#define MYPORT_RX 13
121
+
122
+
SoftwareSerial myPort;
123
+
124
+
125
+
....
126
+
127
+
128
+
Serial.begin(115200); // Standard hardware serial port
0 commit comments