|
Arduino PulseWire Transceiver Library
|
Provides common logic for transmitting signals using various framing modes. More...
#include <TxDriverCommon.h>


Public Member Functions | |
| TxDriverCommon (TxProtocol &protocol, Codec &codec, uint8_t pin, bool useChecksum=false) | |
| virtual void | init (TxProtocol &protocol, Codec &codec, uint8_t pin, bool useChecksum=false) |
| bool | begin (uint16_t bitFrequencyHz) override |
| void | setFrameSize (uint16_t size) |
| Set the expected frame size for dynamic data transmission. | |
| void | setFramingMode (FramingMode mode) override |
| int | write (uint8_t byte) override |
| size_t | write (const uint8_t *data, size_t len) |
| Build frames in the buffer and send when full. | |
| void | flush () override |
| virtual void | end () |
Protected Member Functions | |
| void | sendPreamble () |
| void | sendData (const uint8_t *data, uint8_t len) |
| void | sendEnd () |
Protected Attributes | |
| Codec * | _codec = nullptr |
| TxProtocol * | _protocol = nullptr |
| RingBuffer< uint8_t > | _byteBuffer |
| uint16_t | _frameSize = DEFAULT_FRAME_SIZE |
| FramingMode | _framingMode = FramingMode::WriteBytes |
| uint16_t | _bitFrequencyHz = DEFAULT_BIT_FREQ_HZ |
| bool | _useChecksum = false |
| uint8_t | check_sum = 0 |
| uint8_t | _pin = -1 |
Provides common logic for transmitting signals using various framing modes.
The TxDriverCommon class is a foundational component for managing the transmission of signals. It integrates a specified TxProtocol and Codec implementation to handle the framing and buffering of data. The class is responsible for:
Codec.This class supports dynamic configuration of frame sizes, framing modes, and optional checksum appending for data integrity. It is designed to work with a specified transmission pin and bit frequency.
Codec handles the encoding of bytes into signal edges and timings, while the TxProtocol manages the protocol-specific details of the transmission. Definition at line 36 of file TxDriverCommon.h.
|
inline |
| codec | IR codec |
| pin | TX pin |
| signal | Signal implementation |
| freqHz | Bit frequency |
| useChecksum | If true, append checksum to frame (default: false) |
Definition at line 46 of file TxDriverCommon.h.
Implements pulsewire::TxDriver.
Definition at line 62 of file TxDriverCommon.h.
Definition at line 26 of file TxDriver.h.
|
inlineoverridevirtual |
Reimplemented from pulsewire::TxDriver.
Definition at line 133 of file TxDriverCommon.h.
|
inlinevirtual |
Definition at line 52 of file TxDriverCommon.h.
Definition at line 158 of file TxDriverCommon.h.
|
inlineprotected |
Definition at line 163 of file TxDriverCommon.h.
|
inlineprotected |
Definition at line 153 of file TxDriverCommon.h.
Set the expected frame size for dynamic data transmission.
Implements pulsewire::TxDriver.
Definition at line 72 of file TxDriverCommon.h.
|
inlineoverridevirtual |
Set the framing mode for how data is sent (e.g., fixed-size frames, immediate write, or flush)
Implements pulsewire::TxDriver.
Definition at line 82 of file TxDriverCommon.h.
Build frames in the buffer and send when full.
Implements pulsewire::TxDriver.
Definition at line 102 of file TxDriverCommon.h.
Implements pulsewire::TxDriver.
Definition at line 84 of file TxDriverCommon.h.
|
protected |
Definition at line 148 of file TxDriverCommon.h.
|
protected |
Definition at line 145 of file TxDriverCommon.h.
Definition at line 143 of file TxDriverCommon.h.
|
protected |
Definition at line 146 of file TxDriverCommon.h.
|
protected |
Definition at line 147 of file TxDriverCommon.h.
|
protected |
Definition at line 151 of file TxDriverCommon.h.
|
protected |
Definition at line 144 of file TxDriverCommon.h.
Definition at line 149 of file TxDriverCommon.h.
|
protected |
Definition at line 150 of file TxDriverCommon.h.