|
ESPHome 2026.5.0-dev
|
#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 UARTFlushResult | flush ()=0 |
| virtual bool | is_connected () |
| 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. | |
| template<typename F > | |
| void | add_debug_callback (F &&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 40 of file uart_component.h.
|
inline |
Definition at line 197 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 167 of file uart_component.h.
|
inline |
Definition at line 151 of file uart_component.h.
|
inline |
Definition at line 159 of file uart_component.h.
|
inline |
Definition at line 115 of file uart_component.h.
|
inline |
Definition at line 127 of file uart_component.h.
|
inline |
Definition at line 135 of file uart_component.h.
|
inline |
Definition at line 143 of file uart_component.h.
|
inlinevirtual |
Reimplemented in esphome::usb_uart::USBUartChannel.
Definition at line 90 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 193 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 181 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 67 of file uart_component.h.
|
inline |
Definition at line 163 of file uart_component.h.
|
inline |
Definition at line 147 of file uart_component.h.
|
inline |
Definition at line 107 of file uart_component.h.
|
inlinevirtual |
Reimplemented in esphome::uart::IDFUARTComponent, and esphome::usb_uart::USBUartChannel.
Definition at line 95 of file uart_component.h.
|
inline |
Definition at line 155 of file uart_component.h.
|
inline |
Definition at line 111 of file uart_component.h.
|
inlinevirtual |
Reimplemented in esphome::uart::IDFUARTComponent.
Definition at line 119 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 103 of file uart_component.h.
|
inlinevirtual |
Reimplemented in esphome::uart::IDFUARTComponent.
Definition at line 131 of file uart_component.h.
|
inline |
Definition at line 139 of file uart_component.h.
|
inline |
Definition at line 99 of file uart_component.h.
|
inline |
Definition at line 46 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 50 of file uart_component.h.
|
inline |
Definition at line 54 of file uart_component.h.
|
protected |
Definition at line 212 of file uart_component.h.
|
protected |
Definition at line 214 of file uart_component.h.
|
protected |
Definition at line 217 of file uart_component.h.
|
protected |
Definition at line 206 of file uart_component.h.
|
protected |
Definition at line 215 of file uart_component.h.
|
protected |
Definition at line 207 of file uart_component.h.
|
protected |
Definition at line 210 of file uart_component.h.
|
staticconstexpr |
Definition at line 42 of file uart_component.h.
|
protected |
Definition at line 205 of file uart_component.h.
|
protected |
Definition at line 211 of file uart_component.h.
|
protected |
Definition at line 213 of file uart_component.h.
|
protected |
Definition at line 204 of file uart_component.h.