|
ESPHome 2026.3.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 size_t | available ()=0 |
| virtual FlushResult | flush ()=0 |
| virtual void | set_flush_timeout (uint32_t flush_timeout_ms) |
| void | set_tx_pin (InternalGPIOPin *tx_pin) |
| void | set_rx_pin (InternalGPIOPin *rx_pin) |
| void | set_flow_control_pin (InternalGPIOPin *flow_control_pin) |
| void | set_rx_buffer_size (size_t rx_buffer_size) |
| size_t | get_rx_buffer_size () |
| virtual void | set_rx_full_threshold (size_t rx_full_threshold) |
| void | set_rx_full_threshold_ms (uint8_t time) |
| size_t | get_rx_full_threshold () |
| virtual void | set_rx_timeout (size_t rx_timeout) |
| size_t | get_rx_timeout () |
| 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) |
Static Public Attributes | |
| static constexpr size_t | RX_FULL_THRESHOLD_UNSET = 0 |
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_ {} |
| InternalGPIOPin * | flow_control_pin_ {} |
| size_t | rx_buffer_size_ {} |
| size_t | rx_full_threshold_ {RX_FULL_THRESHOLD_UNSET} |
| size_t | rx_timeout_ {0} |
| uint32_t | baud_rate_ {0} |
| uint8_t | stop_bits_ {0} |
| uint8_t | data_bits_ {0} |
| UARTParityOptions | parity_ {UART_CONFIG_PARITY_NONE} |
| CallbackManager< void(UARTDirection, uint8_t)> | debug_callback_ {} |
Definition at line 45 of file uart_component.h.
|
inline |
Definition at line 198 of file uart_component.h.
|
pure virtual |
Implemented in esphome::ble_nus::BLENUS, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_cdc_acm::USBCDCACMInstance, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
protectedpure virtual |
Implemented in esphome::ble_nus::BLENUS, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_cdc_acm::USBCDCACMInstance, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
protected |
Definition at line 7 of file uart_component.cpp.
|
pure virtual |
Implemented in esphome::ble_nus::BLENUS, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_cdc_acm::USBCDCACMInstance, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
inline |
Definition at line 168 of file uart_component.h.
|
inline |
Definition at line 152 of file uart_component.h.
|
inline |
Definition at line 160 of file uart_component.h.
|
inline |
Definition at line 116 of file uart_component.h.
|
inline |
Definition at line 128 of file uart_component.h.
|
inline |
Definition at line 136 of file uart_component.h.
|
inline |
Definition at line 144 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::ESP8266UartComponent, and esphome::uart::IDFUARTComponent.
Definition at line 194 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::ESP8266UartComponent, and esphome::uart::IDFUARTComponent.
Definition at line 182 of file uart_component.h.
|
pure virtual |
Implemented in esphome::ble_nus::BLENUS, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_cdc_acm::USBCDCACMInstance, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
pure virtual |
Implemented in esphome::ble_nus::BLENUS, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_cdc_acm::USBCDCACMInstance, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
inline |
Definition at line 72 of file uart_component.h.
|
inline |
Definition at line 164 of file uart_component.h.
|
inline |
Definition at line 148 of file uart_component.h.
|
inline |
Definition at line 108 of file uart_component.h.
|
inlinevirtual |
Reimplemented in esphome::uart::IDFUARTComponent, and esphome::usb_uart::USBUartChannel.
Definition at line 96 of file uart_component.h.
|
inline |
Definition at line 156 of file uart_component.h.
|
inline |
Definition at line 112 of file uart_component.h.
|
inlinevirtual |
Reimplemented in esphome::uart::IDFUARTComponent.
Definition at line 120 of file uart_component.h.
| void esphome::uart::UARTComponent::set_rx_full_threshold_ms | ( | uint8_t | time | ) |
Definition at line 22 of file uart_component.cpp.
|
inline |
Definition at line 104 of file uart_component.h.
|
inlinevirtual |
Reimplemented in esphome::uart::IDFUARTComponent.
Definition at line 132 of file uart_component.h.
|
inline |
Definition at line 140 of file uart_component.h.
|
inline |
Definition at line 100 of file uart_component.h.
|
inline |
Definition at line 51 of file uart_component.h.
|
pure virtual |
Implemented in esphome::ble_nus::BLENUS, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2040UartComponent, esphome::usb_cdc_acm::USBCDCACMInstance, esphome::usb_uart::USBUartChannel, and esphome::weikai::WeikaiChannel.
|
inline |
Definition at line 55 of file uart_component.h.
|
inline |
Definition at line 59 of file uart_component.h.
|
protected |
Definition at line 215 of file uart_component.h.
|
protected |
Definition at line 217 of file uart_component.h.
|
protected |
Definition at line 220 of file uart_component.h.
|
protected |
Definition at line 209 of file uart_component.h.
|
protected |
Definition at line 218 of file uart_component.h.
|
protected |
Definition at line 210 of file uart_component.h.
|
protected |
Definition at line 213 of file uart_component.h.
|
staticconstexpr |
Definition at line 47 of file uart_component.h.
|
protected |
Definition at line 208 of file uart_component.h.
|
protected |
Definition at line 214 of file uart_component.h.
|
protected |
Definition at line 216 of file uart_component.h.
|
protected |
Definition at line 207 of file uart_component.h.