* adds extended HardwareSerial examples
* Adds new example with Serial RxTimeout
* adds and improves Serial onReceive expamples
* adjust includes CMake - UART example
* adjust includes CMake - UART example
* fixes CMake and CI
* adds ESP/Serial to CMakeList
* adds ESP/Serial to CMakeList
* fixes demo include
* fixes BREAK demo
* fixes onReceive demo
* Changes FIFO Full criteria
Changed the "1-by-1" Serial only when baud rate is 57600 or lower.
* example code replacement
* replaces functions in hal
* Changes UART ISR to only trigger on RX FIFO Full and timeout
* changes initial RX timeout
* Eliminates extra testing for _uart != NULL
* reconfiguration with "uartSetFastReading()"
* Adds new function "uartSetFastReading()"
* changed default onReceive() behaviour
* forces User callback in case of error
* Error Code Order
Set NO_ERROR as first error code, same as ESP_OK = 0
* Adds HardwareSerial::setTxBufferSize()
* uartBegin def fix
* checks TXBufferSize as defined in IDF
Makes sure that the buffer size will not cause a reset to the board.
* Removes double value in Rx/Tx Buffer Size
Keeps Rx/Tx buffer size as set, not doubling it. It makes the process more clear.
Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
* fixes setPins and begin to keep rx/tx unmodified
* adds Hardware Flow Control mode and CTS/RTS pin setting
* adds Hardware Flow Control mode and CTS/RTS pin setting
* adds Hardware Flow Control mode and CTS/RTS pin setting
* adds Hardware Flow Control mode and CTS/RTS pin setting
* Code Review
## Summary
This PR is a complete reffactoring of UART Serial Hardware and respective HAL in order to use IDF instead of current Register manipulation approach.
It implements Arduino SerialEvent functionality.
Fix#5287Fix#5273Fix#5519Fix#5247Fix#5403Fix#5429Fix#5047Fix#5463Fix#5362Fix#5112Fix#5443
## Impact
It solves many reported issues related to UART.
It was tested and works fine for ESP32, ESP-S2 and ESP32-C3.
* add option to Flush() to only clear txQueue
Add the option to cause Flush() to just wait for tx data to clear the tx fifo and uart, leave the rx queue and rx fifo as is.
* support tx only flush()
* support tx only Flush()
* support txOnly for Flush()
* compatibility to Stream()
* compatibility for Stream()
* default value error
* default value error
* Update esp32-hal-uart.h
* Update esp32-hal-uart.c
* Update HardwareSerial.cpp
* sp
* correctly implement flushTxOnly()
* Expose uartStartDetectBaudrate(uart_t *) in esp32-hal-uart.h and call it from HardwareSerial::begin() if baudrate detection is requested (by passing a baudrate of 0) to solve baudrate detection problems
* Avoid a division by zero error in uartGetBaudRate()
* Added baudrate detection to esp32-hal-uart and HardwareSerial
* Solved compiler warning for uartResizeRxBuffer()
* Add unit to header variable name (timeout_ms)
* Reverting accidentally changed files to master
* Add small delay after baudrate detection