13#if LT_ARD_HAS_SOFTSERIAL 
   14#include <SoftwareSerial.h> 
   20static const char *
const TAG = 
"uart.lt";
 
   22static const char *UART_TYPE[] = {
 
   32      config |= SERIAL_PARITY_NONE;
 
   35      config |= SERIAL_PARITY_EVEN;
 
   38      config |= SERIAL_PARITY_ODD;
 
   43  config |= 0x10 + (this->
stop_bits_ - 1) * 0x20;
 
 
   64  else if ((tx_pin == -1 || tx_pin == PIN_SERIAL0_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL0_RX)) {
 
   70  else if ((tx_pin == -1 || tx_pin == PIN_SERIAL1_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL1_RX)) {
 
   76  else if ((tx_pin == -1 || tx_pin == PIN_SERIAL2_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL2_RX)) {
 
   82#if LT_ARD_HAS_SOFTSERIAL 
   83    this->
serial_ = 
new SoftwareSerial(rx_pin, tx_pin, rx_inverted || tx_inverted);
 
   86    ESP_LOGE(TAG, 
"  SoftwareSerial is not implemented for this chip. Only hardware pins are supported:");
 
   88    ESP_LOGE(TAG, 
"    TX=%u, RX=%u", PIN_SERIAL0_TX, PIN_SERIAL0_RX);
 
   91    ESP_LOGE(TAG, 
"    TX=%u, RX=%u", PIN_SERIAL1_TX, PIN_SERIAL1_RX);
 
   94    ESP_LOGE(TAG, 
"    TX=%u, RX=%u", PIN_SERIAL2_TX, PIN_SERIAL2_RX);
 
 
  106  ESP_LOGCONFIG(TAG, 
"UART Bus:");
 
  107  ESP_LOGCONFIG(TAG, 
"  Type: %s", UART_TYPE[is_software]);
 
  113  if (this->
rx_pin_ != 
nullptr) {
 
  117                "  Baud Rate: %u baud\n" 
 
  127#ifdef USE_UART_DEBUGGER 
  128  for (
size_t i = 0; i < 
len; i++) {
 
 
  145#ifdef USE_UART_DEBUGGER 
  146  for (
size_t i = 0; i < 
len; i++) {
 
 
  155  ESP_LOGVV(TAG, 
"    Flushing");
 
 
  166    ESP_LOGW(TAG, 
"  You're using the same serial port for logging and the UART component. Please " 
  167                  "disable logging over the serial port by setting logger->baud_rate to 0.");
 
 
virtual void mark_failed()
Mark this component as failed.
virtual uint8_t get_pin() const =0
virtual bool is_inverted() const =0
void dump_config() override
bool read_array(uint8_t *data, size_t len) override
bool peek_byte(uint8_t *data) override
void check_logger_conflict() override
void write_array(const uint8_t *data, size_t len) override
HardwareSerial * get_hw_serial()
UARTParityOptions parity_
bool check_read_timeout_(size_t len=1)
InternalGPIOPin * tx_pin_
uint32_t get_baud_rate() const
CallbackManager< void(UARTDirection, uint8_t)> debug_callback_
InternalGPIOPin * rx_pin_
const LogString * parity_to_str(UARTParityOptions parity)
@ UART_CONFIG_PARITY_EVEN
@ UART_CONFIG_PARITY_NONE
Providing packet encoding functions for exchanging data with a remote host.