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

Receiver class for communication. More...

#include <Transceiver.h>

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

Public Member Functions

 Receiver (RxDriver &rx)
 
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)
 
void setTimeout (uint32_t timeoutUs)
 
bool begin (uint32_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
 

Detailed Description

Receiver class for communication.

The Receiver class is a specialized version of the Transceiver class designed for reception-only operations. It provides a simplified interface for receiving IR signals using an RX driver.

Definition at line 253 of file Transceiver.h.

Constructor & Destructor Documentation

◆ Receiver()

pulsewire::Receiver::Receiver ( RxDriver rx)
inline

Definition at line 255 of file Transceiver.h.

Member Function Documentation

◆ available()

int pulsewire::Transceiver::available ( )
inlineoverrideinherited

Return the number of bytes available to read.

Definition at line 177 of file Transceiver.h.

◆ availableForWrite()

int pulsewire::Transceiver::availableForWrite ( )
inlineoverrideinherited

Return the number of bytes available for writing (always 1024)

Definition at line 172 of file Transceiver.h.

◆ begin()

bool pulsewire::Transceiver::begin ( uint32_t  bitFrequencyHz = DEFAULT_BIT_FREQ_HZ)
inlineinherited

Initialize the transceiver and drivers.

Definition at line 115 of file Transceiver.h.

◆ end()

void pulsewire::Transceiver::end ( )
inlineinherited

End/stop the RX driver.

Definition at line 140 of file Transceiver.h.

◆ flush()

void pulsewire::Transceiver::flush ( )
inlineoverrideinherited

Not implemented.

Definition at line 163 of file Transceiver.h.

◆ peek()

int pulsewire::Transceiver::peek ( )
inlineoverrideinherited

Peek at the next byte in the buffer without removing it.

Definition at line 211 of file Transceiver.h.

◆ read()

int pulsewire::Transceiver::read ( )
inlineoverrideinherited

Read a single byte from the buffer.

Definition at line 184 of file Transceiver.h.

◆ readBytes()

virtual size_t pulsewire::Transceiver::readBytes ( uint8_t buffer,
size_t  length 
)
inlinevirtualinherited

Read bytes into the provided buffer, up to the specified length.

Parameters
buffer
length
Returns
size_t

Definition at line 198 of file Transceiver.h.

◆ refillSingleCharBuffer()

void pulsewire::Transceiver::refillSingleCharBuffer ( )
inlineprotectedinherited

Definition at line 222 of file Transceiver.h.

◆ setFrameSize()

void pulsewire::Transceiver::setFrameSize ( uint16_t  size)
inlineinherited

Set the expected maximum frame size for RX/TX drivers and single-char buffer.

Definition at line 86 of file Transceiver.h.

◆ setFramingMode()

bool pulsewire::Transceiver::setFramingMode ( FramingMode  mode)
inlineinherited

Definition at line 98 of file Transceiver.h.

◆ setRxDriver()

void pulsewire::Transceiver::setRxDriver ( RxDriver driver)
inlineinherited

Set the RX driver.

Definition at line 75 of file Transceiver.h.

◆ setTimeout()

void pulsewire::Transceiver::setTimeout ( uint32_t  timeoutUs)
inlineinherited

Definition at line 106 of file Transceiver.h.

◆ setTxDriver()

void pulsewire::Transceiver::setTxDriver ( TxDriver driver)
inlineinherited

Set the TX driver.

Definition at line 80 of file Transceiver.h.

◆ write() [1/2]

size_t pulsewire::Transceiver::write ( const uint8_t buffer,
size_t  size 
)
inlineoverrideinherited

Write a buffer to the TX driver.

Definition at line 154 of file Transceiver.h.

◆ write() [2/2]

size_t pulsewire::Transceiver::write ( uint8_t  byte)
inlineoverrideinherited

Write a single byte to the TX driver.

Definition at line 149 of file Transceiver.h.

Field Documentation

◆ _frameSize

int pulsewire::Transceiver::_frameSize = 0
protectedinherited

Definition at line 220 of file Transceiver.h.

◆ _rxDriver

RxDriver* pulsewire::Transceiver::_rxDriver = nullptr
protectedinherited

Definition at line 217 of file Transceiver.h.

◆ _singleCharRxBuffer

RingBuffer<uint8_t> pulsewire::Transceiver::_singleCharRxBuffer {64}
protectedinherited

Definition at line 219 of file Transceiver.h.

◆ _txDriver

TxDriver* pulsewire::Transceiver::_txDriver = nullptr
protectedinherited

Definition at line 218 of file Transceiver.h.


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