esphome/esphome/core
0hax fb2b7ade41
Uart improvments (#1024)
* uart: Add support for specifying the number of bits and parity.

ESP8266SwSerial doesn't really check parity but just read the parity bit
and ignore it when receiving data.

Signed-off-by: 0hax <0hax@protonmail.com>

* uart: support begin and end methods.

A component may need to reset uart buffer/status by using begin() and
end() methods. This is useful for example when a component needs to be
sure it is not reading garbage from previously received data over uart.
For end() methods with software serial, disabling interrupt is
currently impossible because of a bug in esp8266 Core:
https://github.com/esp8266/Arduino/issues/6049

Signed-off-by: 0hax <0hax@protonmail.com>

* esphal: add support for detaching an interrupt.

That's needed when a component needs to enable/disable interrupt on a
gpio.

Signed-off-by: 0hax <0hax@protonmail.com>

* uart: rename CONF_NR_BITS to CONF_DATA_BITS_NUMBER.

Signed-off-by: 0hax <0hax@protonmail.com>

* uart: use static const uint32_t instead of #define.

Signed-off-by: 0hax <0hax@protonmail.com>

* uart: use an enum to handle parity.

Signed-off-by: 0hax <0hax@protonmail.com>

* uart: split between esp32 and esp8266.

Signed-off-by: 0hax <0hax@protonmail.com>

* uart: check_uart_settings for parity and number of data bits.

Signed-off-by: 0hax <0hax@protonmail.com>

* name param data_bits

* add new params to test

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2020-05-24 18:59:07 -03:00
..
application.cpp Optimize application loop speed (#860) 2019-12-04 16:03:37 +01:00
application.h Optimize application loop speed (#860) 2019-12-04 16:03:37 +01:00
automation.h Create Protobuf Plugin for automatically generating native API stubs (#633) 2019-06-18 19:31:22 +02:00
base_automation.h Fix ForCondition time duration check (#610) 2019-06-04 18:34:51 +02:00
component.cpp Fix CI 2019-12-07 18:53:20 +01:00
component.h Optimize application loop speed (#860) 2019-12-04 16:03:37 +01:00
controller.cpp 🏗 Merge C++ into python codebase (#504) 2019-04-17 12:06:00 +02:00
controller.h 🏗 Merge C++ into python codebase (#504) 2019-04-17 12:06:00 +02:00
defines.h Add Captive Portal (#624) 2019-06-09 17:03:51 +02:00
esphal.cpp Uart improvments (#1024) 2020-05-24 18:59:07 -03:00
esphal.h Uart improvments (#1024) 2020-05-24 18:59:07 -03:00
helpers.cpp Fix ESP32 interrupt enable/disable switched 2019-12-04 23:51:27 +01:00
helpers.h Add ESP8266 core v2.6.2 (#905) 2019-12-04 19:30:10 +01:00
log.cpp Filter some debug lines from PlatformIO in output (#771) 2019-10-19 14:04:14 +02:00
log.h Filter some debug lines from PlatformIO in output (#771) 2019-10-19 14:04:14 +02:00
optional.h 🏗 Merge C++ into python codebase (#504) 2019-04-17 12:06:00 +02:00
preferences.cpp Add ESP8266 core v2.6.2 (#905) 2019-12-04 19:30:10 +01:00
preferences.h ESP32 Use NVS directly (#659) 2019-07-03 16:34:40 +02:00
scheduler.cpp Update variable in scheduler (#838) 2019-11-06 22:35:22 +01:00
scheduler.h Scheduler fixes (#813) 2019-10-31 20:25:16 +01:00
util.cpp expose mac address via discovery (#1038) 2020-05-23 22:53:15 -03:00
util.h Captive portal fixes (#766) 2019-10-18 14:46:44 +02:00
version.h Move ESPHome version define (#607) 2019-06-03 16:07:15 +02:00