ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
uart_component_rp2040.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_RP2040
4
5#include <SerialPIO.h>
6#include <SerialUART.h>
7
8#include <vector>
10#include "esphome/core/hal.h"
11#include "esphome/core/log.h"
12#include "uart_component.h"
13
14namespace esphome::uart {
15
17 public:
18 void setup() override;
19 void dump_config() override;
20 float get_setup_priority() const override { return setup_priority::BUS; }
21
22 void write_array(const uint8_t *data, size_t len) override;
23
24 bool peek_byte(uint8_t *data) override;
25 bool read_array(uint8_t *data, size_t len) override;
26
27 int available() override;
28 void flush() override;
29
30 uint16_t get_config();
31
32 bool is_hw_serial() { return this->hw_serial_; }
33 HardwareSerial *get_hw_serial() { return this->serial_; }
34
35 protected:
36 void check_logger_conflict() override {}
37 bool hw_serial_{false};
38
39 HardwareSerial *serial_{nullptr};
40};
41
42} // namespace esphome::uart
43#endif // USE_RP2040
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:533