10#ifndef M5_UNIT_RS485_UNIT_SP485_STREAM_HPP
11#define M5_UNIT_RS485_UNIT_SP485_STREAM_HPP
13#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
66 size_t write(
const uint8_t b)
override
68 return _unit.
write(b);
76 size_t write(
const uint8_t* buffer,
size_t size)
override
78 return _unit.
write(buffer, size);
Non-instantiable base class for RS-485 transceiver units.
Definition rs485_component.hpp:37
int available()
Returns the number of available bytes to read.
Definition rs485_component.hpp:148
size_t write(const uint8_t d)
Writes one byte.
Definition rs485_component.cpp:179
int peek()
Peeks the next incoming byte without removing it.
Definition rs485_component.hpp:164
int read()
Reads one byte.
Definition rs485_component.hpp:172
void flush()
Flushes the serial port.
Definition rs485_component.hpp:243
int availableForWrite()
Returns the number of bytes that can be written without blocking.
Definition rs485_component.hpp:156
Thin Arduino Stream/Print adapter for any RS485Component (UnitSP485 / UnitSIT3088 / ....
Definition unit_SP485_stream.hpp:27
void flush() override
Flushes the serial port.
Definition unit_SP485_stream.hpp:83
int peek() override
Peeks the next incoming byte without removing it.
Definition unit_SP485_stream.hpp:57
size_t write(const uint8_t *buffer, size_t size) override
Writes bytes from buffer.
Definition unit_SP485_stream.hpp:76
UnitSP485Stream(RS485Component &unit)
Constructs a Stream adapter for any RS485Component-derived unit.
Definition unit_SP485_stream.hpp:33
int read() override
Reads one byte.
Definition unit_SP485_stream.hpp:49
int available() override
Returns the number of bytes available to read.
Definition unit_SP485_stream.hpp:41
int availableForWrite() override
Returns available buffer space for write.
Definition unit_SP485_stream.hpp:92
size_t write(const uint8_t b) override
Writes one byte.
Definition unit_SP485_stream.hpp:66
Top level namespace of M5Stack.
Common base for RS-485 transceiver units in M5UnitUnified.