|
Arduino PulseWire Transceiver Library
|
Bi-directional IR transceiver class with Stream interface and driver abstraction. More...
#include <Transceiver.h>


Public Member Functions | |
| Transceiver ()=default | |
| Default constructor. | |
| Transceiver (RxDriver &rx, TxDriver &tx) | |
| Constructor with RX and TX drivers. | |
| Transceiver (RxDriver &rx) | |
| Constructor with RX driver. | |
| Transceiver (TxDriver &tx) | |
| Constructor with TX driver. | |
| Transceiver (RxDriver &rx, TxDriver &tx, FramingMode mode, size_t frameSize) | |
| Constructor with RX and TX drivers. | |
| Transceiver (RxDriver &rx, FramingMode mode, size_t frameSize) | |
| Constructor with RX driver. | |
| Transceiver (TxDriver &tx, FramingMode mode, size_t frameSize) | |
| Constructor with TX driver. | |
| void | setRxDriver (RxDriver *driver) |
| Set the RX driver. | |
| void | setTxDriver (TxDriver *driver) |
| Set the TX driver. | |
| void | setFrameSize (uint16_t size) |
| Set the expected maximum frame size for RX/TX drivers and single-char buffer. | |
| bool | setFramingMode (FramingMode mode) |
| bool | begin (uint16_t bitFrequencyHz=DEFAULT_BIT_FREQ_HZ) |
| Initialize the transceiver and drivers. | |
| void | end () |
| End/stop the RX driver. | |
| size_t | write (uint8_t byte) override |
| Write a single byte to the TX driver. | |
| size_t | write (const uint8_t *buffer, size_t size) override |
| Write a buffer to the TX driver. | |
| void | flush () override |
| Not implemented. | |
| int | availableForWrite () override |
| Return the number of bytes available for writing (always 1024) | |
| int | available () override |
| Return the number of bytes available to read. | |
| int | read () override |
| Read a single byte from the buffer. | |
| virtual size_t | readBytes (uint8_t *buffer, size_t length) |
| Read bytes into the provided buffer, up to the specified length. | |
| int | peek () override |
| Peek at the next byte in the buffer without removing it. | |
Protected Member Functions | |
| void | refillSingleCharBuffer () |
Protected Attributes | |
| RxDriver * | _rxDriver = nullptr |
| TxDriver * | _txDriver = nullptr |
| RingBuffer< uint8_t > | _singleCharRxBuffer {64} |
| int | _frameSize = 0 |
Bi-directional IR transceiver class with Stream interface and driver abstraction.
This class provides a flexible, buffered interface for IR communication. It supports pluggable RX and TX drivers, frame size management, and integrates with the Arduino Stream API.
Definition at line 23 of file Transceiver.h.
Constructor with RX and TX drivers.
Definition at line 33 of file Transceiver.h.
|
inline |
Constructor with RX driver.
Definition at line 38 of file Transceiver.h.
|
inline |
Constructor with TX driver.
Definition at line 43 of file Transceiver.h.
|
inline |
Constructor with RX and TX drivers.
Definition at line 48 of file Transceiver.h.
Constructor with RX driver.
Definition at line 57 of file Transceiver.h.
Constructor with TX driver.
Definition at line 66 of file Transceiver.h.
|
inlineoverride |
Return the number of bytes available to read.
Definition at line 170 of file Transceiver.h.
|
inlineoverride |
Return the number of bytes available for writing (always 1024)
Definition at line 165 of file Transceiver.h.
Initialize the transceiver and drivers.
Definition at line 109 of file Transceiver.h.
|
inline |
End/stop the RX driver.
Definition at line 134 of file Transceiver.h.
|
inlineoverride |
Not implemented.
Definition at line 156 of file Transceiver.h.
|
inlineoverride |
Peek at the next byte in the buffer without removing it.
Definition at line 204 of file Transceiver.h.
|
inlineoverride |
Read a single byte from the buffer.
Definition at line 177 of file Transceiver.h.
Read bytes into the provided buffer, up to the specified length.
| buffer | |
| length |
Definition at line 191 of file Transceiver.h.
|
inlineprotected |
Definition at line 215 of file Transceiver.h.
Set the expected maximum frame size for RX/TX drivers and single-char buffer.
Definition at line 86 of file Transceiver.h.
|
inline |
Definition at line 98 of file Transceiver.h.
Set the RX driver.
Definition at line 75 of file Transceiver.h.
Set the TX driver.
Definition at line 80 of file Transceiver.h.
Write a buffer to the TX driver.
Definition at line 147 of file Transceiver.h.
Write a single byte to the TX driver.
Definition at line 142 of file Transceiver.h.
|
protected |
Definition at line 213 of file Transceiver.h.
Definition at line 210 of file Transceiver.h.
|
protected |
Definition at line 212 of file Transceiver.h.
Definition at line 211 of file Transceiver.h.