Arduino PulseWire Transceiver Library
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes
pulsewire::TxDriverArduino Class Reference

Generic driver for transmitting data using a specified codec and signal implementation. More...

#include <TxDriverArduino.h>

Inheritance diagram for pulsewire::TxDriverArduino:
Inheritance graph
[legend]
Collaboration diagram for pulsewire::TxDriverArduino:
Collaboration graph
[legend]

Public Member Functions

 TxDriverArduino (Codec &codec, uint8_t pin, SignalBase &signal, bool useChecksum=false)
 
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

TxProtocolGeneric _txProtocol
 
SignalBase_signal = nullptr
 
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
 

Detailed Description

Generic driver for transmitting data using a specified codec and signal implementation.

The TxDriverArduino class extends the functionality of TxDriverCommon by providing a generic implementation for transmitting data. It integrates a Codec for encoding data and a SignalBase implementation for managing the transmission signal.

This class is responsible for:

Note
The TxProtocolGeneric is used to handle protocol-specific details, while the SignalBase implementation manages the physical signal transmission.

Definition at line 29 of file TxDriverArduino.h.

Constructor & Destructor Documentation

◆ TxDriverArduino()

pulsewire::TxDriverArduino::TxDriverArduino ( Codec codec,
uint8_t  pin,
SignalBase signal,
bool  useChecksum = false 
)
inline

Definition at line 32 of file TxDriverArduino.h.

Member Function Documentation

◆ begin()

bool pulsewire::TxDriverCommon::begin ( uint16_t  bitFrequencyHz)
inlineoverridevirtualinherited

Implements pulsewire::TxDriver.

Definition at line 62 of file TxDriverCommon.h.

◆ end()

virtual void pulsewire::TxDriver::end ( )
inlinevirtualinherited

Definition at line 26 of file TxDriver.h.

◆ flush()

void pulsewire::TxDriverCommon::flush ( )
inlineoverridevirtualinherited

Reimplemented from pulsewire::TxDriver.

Definition at line 133 of file TxDriverCommon.h.

◆ init()

void pulsewire::TxDriverArduino::init ( TxProtocol protocol,
Codec codec,
uint8_t  pin,
bool  useChecksum = false 
)
inlinevirtual

Reimplemented from pulsewire::TxDriverCommon.

Definition at line 40 of file TxDriverArduino.h.

◆ sendData()

void pulsewire::TxDriverCommon::sendData ( const uint8_t data,
uint8_t  len 
)
inlineprotectedinherited

Definition at line 158 of file TxDriverCommon.h.

◆ sendEnd()

void pulsewire::TxDriverCommon::sendEnd ( )
inlineprotectedinherited

Definition at line 163 of file TxDriverCommon.h.

◆ sendPreamble()

void pulsewire::TxDriverCommon::sendPreamble ( )
inlineprotectedinherited

Definition at line 153 of file TxDriverCommon.h.

◆ setFrameSize()

void pulsewire::TxDriverCommon::setFrameSize ( uint16_t  size)
inlinevirtualinherited

Set the expected frame size for dynamic data transmission.

Implements pulsewire::TxDriver.

Definition at line 72 of file TxDriverCommon.h.

◆ setFramingMode()

void pulsewire::TxDriverCommon::setFramingMode ( FramingMode  mode)
inlineoverridevirtualinherited

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.

◆ write() [1/2]

size_t pulsewire::TxDriverCommon::write ( const uint8_t data,
size_t  len 
)
inlinevirtualinherited

Build frames in the buffer and send when full.

Implements pulsewire::TxDriver.

Definition at line 102 of file TxDriverCommon.h.

◆ write() [2/2]

int pulsewire::TxDriverCommon::write ( uint8_t  byte)
inlineoverridevirtualinherited

Implements pulsewire::TxDriver.

Definition at line 84 of file TxDriverCommon.h.

Field Documentation

◆ _bitFrequencyHz

uint16_t pulsewire::TxDriverCommon::_bitFrequencyHz = DEFAULT_BIT_FREQ_HZ
protectedinherited

Definition at line 148 of file TxDriverCommon.h.

◆ _byteBuffer

RingBuffer<uint8_t> pulsewire::TxDriverCommon::_byteBuffer
protectedinherited

Definition at line 145 of file TxDriverCommon.h.

◆ _codec

Codec* pulsewire::TxDriverCommon::_codec = nullptr
protectedinherited

Definition at line 143 of file TxDriverCommon.h.

◆ _frameSize

uint16_t pulsewire::TxDriverCommon::_frameSize = DEFAULT_FRAME_SIZE
protectedinherited

Definition at line 146 of file TxDriverCommon.h.

◆ _framingMode

FramingMode pulsewire::TxDriverCommon::_framingMode = FramingMode::WriteBytes
protectedinherited

Definition at line 147 of file TxDriverCommon.h.

◆ _pin

uint8_t pulsewire::TxDriverCommon::_pin = -1
protectedinherited

Definition at line 151 of file TxDriverCommon.h.

◆ _protocol

TxProtocol* pulsewire::TxDriverCommon::_protocol = nullptr
protectedinherited

Definition at line 144 of file TxDriverCommon.h.

◆ _signal

SignalBase* pulsewire::TxDriverArduino::_signal = nullptr
protected

Definition at line 51 of file TxDriverArduino.h.

◆ _txProtocol

TxProtocolGeneric pulsewire::TxDriverArduino::_txProtocol
protected

Definition at line 50 of file TxDriverArduino.h.

◆ _useChecksum

bool pulsewire::TxDriverCommon::_useChecksum = false
protectedinherited

Definition at line 149 of file TxDriverCommon.h.

◆ check_sum

uint8_t pulsewire::TxDriverCommon::check_sum = 0
protectedinherited

Definition at line 150 of file TxDriverCommon.h.


The documentation for this class was generated from the following file: