ESPHome 2025.6.3
|
#include <uart_component.h>
Public Member Functions | |
void | write_array (const std::vector< uint8_t > &data) |
void | write_byte (uint8_t data) |
void | write_str (const char *str) |
virtual void | write_array (const uint8_t *data, size_t len)=0 |
bool | read_byte (uint8_t *data) |
virtual bool | peek_byte (uint8_t *data)=0 |
virtual bool | read_array (uint8_t *data, size_t len)=0 |
virtual int | available ()=0 |
virtual void | flush ()=0 |
void | set_tx_pin (InternalGPIOPin *tx_pin) |
void | set_rx_pin (InternalGPIOPin *rx_pin) |
void | set_rx_buffer_size (size_t rx_buffer_size) |
size_t | get_rx_buffer_size () |
void | set_stop_bits (uint8_t stop_bits) |
uint8_t | get_stop_bits () const |
void | set_data_bits (uint8_t data_bits) |
uint8_t | get_data_bits () const |
void | set_parity (UARTParityOptions parity) |
UARTParityOptions | get_parity () const |
void | set_baud_rate (uint32_t baud_rate) |
uint32_t | get_baud_rate () const |
virtual void | load_settings (bool dump_config) |
Load the UART settings. | |
virtual void | load_settings () |
Load the UART settings. | |
void | add_debug_callback (std::function< void(UARTDirection, uint8_t)> &&callback) |
Protected Member Functions | |
virtual void | check_logger_conflict ()=0 |
bool | check_read_timeout_ (size_t len=1) |
Protected Attributes | |
InternalGPIOPin * | tx_pin_ |
InternalGPIOPin * | rx_pin_ |
size_t | rx_buffer_size_ |
uint32_t | baud_rate_ |
uint8_t | stop_bits_ |
uint8_t | data_bits_ |
UARTParityOptions | parity_ |
CallbackManager< void(UARTDirection, uint8_t)> | debug_callback_ {} |
Definition at line 32 of file uart_component.h.
|
inline |
Definition at line 153 of file uart_component.h.
|
pure virtual |
Implemented in esphome::uart::ESP32ArduinoUARTComponent, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
protectedpure virtual |
Implemented in esphome::uart::ESP32ArduinoUARTComponent, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
protected |
Definition at line 8 of file uart_component.cpp.
|
pure virtual |
Implemented in esphome::uart::ESP32ArduinoUARTComponent, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
inline |
Definition at line 123 of file uart_component.h.
|
inline |
Definition at line 107 of file uart_component.h.
|
inline |
Definition at line 115 of file uart_component.h.
|
inline |
Definition at line 91 of file uart_component.h.
|
inline |
Definition at line 99 of file uart_component.h.
|
inlinevirtual |
Load the UART settings.
Example:
This will load the current UART interface with the latest settings (baud_rate, parity, etc).
Reimplemented in esphome::uart::ESP32ArduinoUARTComponent, esphome::uart::ESP8266UartComponent, and esphome::uart::IDFUARTComponent.
Definition at line 149 of file uart_component.h.
|
inlinevirtual |
Load the UART settings.
dump_config | If true (default), output the new settings to logs; otherwise, change settings quietly. |
Example:
This will load the current UART interface with the latest settings (baud_rate, parity, etc).
Reimplemented in esphome::uart::ESP32ArduinoUARTComponent, esphome::uart::ESP8266UartComponent, and esphome::uart::IDFUARTComponent.
Definition at line 137 of file uart_component.h.
|
pure virtual |
Implemented in esphome::uart::ESP32ArduinoUARTComponent, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
pure virtual |
Implemented in esphome::uart::ESP32ArduinoUARTComponent, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
inline |
Definition at line 57 of file uart_component.h.
|
inline |
Definition at line 119 of file uart_component.h.
|
inline |
Definition at line 103 of file uart_component.h.
|
inline |
Definition at line 111 of file uart_component.h.
|
inline |
Definition at line 87 of file uart_component.h.
|
inline |
Definition at line 83 of file uart_component.h.
|
inline |
Definition at line 95 of file uart_component.h.
|
inline |
Definition at line 79 of file uart_component.h.
|
inline |
Definition at line 36 of file uart_component.h.
|
pure virtual |
Implemented in esphome::uart::ESP32ArduinoUARTComponent, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
inline |
Definition at line 40 of file uart_component.h.
|
inline |
Definition at line 44 of file uart_component.h.
|
protected |
Definition at line 165 of file uart_component.h.
|
protected |
Definition at line 167 of file uart_component.h.
|
protected |
Definition at line 170 of file uart_component.h.
|
protected |
Definition at line 168 of file uart_component.h.
|
protected |
Definition at line 164 of file uart_component.h.
|
protected |
Definition at line 163 of file uart_component.h.
|
protected |
Definition at line 166 of file uart_component.h.
|
protected |
Definition at line 162 of file uart_component.h.