ESPHome 2025.12.3
Loading...
Searching...
No Matches
uart_component_libretiny.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_LIBRETINY
4
5#include <vector>
7#include "esphome/core/hal.h"
8#include "esphome/core/log.h"
9#include "uart_component.h"
10
11namespace esphome::uart {
12
14 public:
15 void setup() override;
16 void dump_config() override;
17 float get_setup_priority() const override { return setup_priority::BUS; }
18
19 void write_array(const uint8_t *data, size_t len) override;
20
21 bool peek_byte(uint8_t *data) override;
22 bool read_array(uint8_t *data, size_t len) override;
23
24 int available() override;
25 void flush() override;
26
27 uint16_t get_config();
28
29 HardwareSerial *get_hw_serial() { return this->serial_; }
30 int8_t get_hw_serial_number() { return this->hardware_idx_; }
31
32 protected:
33 void check_logger_conflict() override;
34
35 HardwareSerial *serial_{nullptr};
36 int8_t hardware_idx_{-1};
37};
38
39} // namespace esphome::uart
40#endif // USE_LIBRETINY
bool read_array(uint8_t *data, size_t len) override
void write_array(const uint8_t *data, size_t len) override
const float BUS
For communication buses like i2c/spi.
Definition component.cpp:78
std::string size_t len
Definition helpers.h:503