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

High-performance ESP32 IR RX driver using the RMT peripheral and Manchester decoding. More...

#include <RxDriverESP32.h>

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

Public Member Functions

 RxDriverESP32 (ManchesterCodec &codec, uint8_t pin, bool useChecksum=false)
 
void setFrameSize (uint16_t size) override
 Set the expected frame size for dynamic data reception.
 
void setRxBufferSize (size_t size) override
 Set the size of the internal RX buffer.
 
bool begin (uint32_t bitFrequencyHz) override
 Start the receiver.
 
void end () override
 Stop the receiver.
 
size_t readBytes (uint8_t *buffer, size_t length) override
 
int available () override
 Get the number of bytes available in the internal buffer.
 
void setTimeout (uint32_t timeoutMs)
 Defines the read timeout for readBytes() in milliseconds.
 

Protected Member Functions

size_t readFrame ()
 
void toEdges (rmt_symbol_word_t *symbols, size_t num_symbols, RingBuffer< OutputEdge > &edges)
 Convert RMT symbols to edges and feed into codec.
 

Protected Attributes

size_t _rxBufferSize = 1024
 
size_t _frameSize = 0
 
uint8_t _rxPin
 
uint32_t _freqHz
 
rmt_channel_handle_t _rxChannel = nullptr
 
RingBuffer< uint8_t_rxBuffer
 
RingBuffer< OutputEdge_edgeBuffer
 
Vector< rmt_symbol_word_t_symbols
 
Codec_codec
 
bool _useChecksum = false
 
bool isActive = false
 
QueueHandle_t receive_queue
 
uint32_t _readTimeoutMs = 50
 

Detailed Description

High-performance ESP32 IR RX driver using the RMT peripheral and Manchester decoding.

Note
Supports sending and receiving on the same microcontroller without conflicts.

Definition at line 52 of file RxDriverESP32.h.

Constructor & Destructor Documentation

◆ RxDriverESP32()

pulsewire::RxDriverESP32::RxDriverESP32 ( ManchesterCodec codec,
uint8_t  pin,
bool  useChecksum = false 
)
inline
Parameters
codecIR codec
pinRX pin
freqHzBit frequency
useChecksumIf true, validate checksum (default: false)
timeoutUsTimeout in microseconds to flush frame if no symbol received (default: 5000)

Definition at line 62 of file RxDriverESP32.h.

Member Function Documentation

◆ available()

int pulsewire::RxDriverESP32::available ( )
inlineoverridevirtual

Get the number of bytes available in the internal buffer.

Implements pulsewire::RxDriver.

Definition at line 167 of file RxDriverESP32.h.

◆ begin()

bool pulsewire::RxDriverESP32::begin ( uint32_t  bitFrequencyHz)
inlineoverridevirtual

Start the receiver.

Implements pulsewire::RxDriver.

Definition at line 69 of file RxDriverESP32.h.

◆ end()

void pulsewire::RxDriverESP32::end ( )
inlineoverridevirtual

Stop the receiver.

Implements pulsewire::RxDriver.

Definition at line 150 of file RxDriverESP32.h.

◆ readBytes()

size_t pulsewire::RxDriverESP32::readBytes ( uint8_t data,
size_t  size 
)
inlineoverridevirtual

Read up to 'size' bytes from the internal buffer into 'data'. Returns number of bytes read.

Implements pulsewire::RxDriver.

Definition at line 159 of file RxDriverESP32.h.

◆ readFrame()

size_t pulsewire::RxDriverESP32::readFrame ( )
inlineprotected

Definition at line 189 of file RxDriverESP32.h.

◆ setFrameSize()

void pulsewire::RxDriverESP32::setFrameSize ( uint16_t  size)
inlineoverridevirtual

Set the expected frame size for dynamic data reception.

Implements pulsewire::RxDriver.

Definition at line 65 of file RxDriverESP32.h.

◆ setRxBufferSize()

void pulsewire::RxDriverESP32::setRxBufferSize ( size_t  size)
inlineoverridevirtual

Set the size of the internal RX buffer.

Implements pulsewire::RxDriver.

Definition at line 67 of file RxDriverESP32.h.

◆ setTimeout()

void pulsewire::RxDriver::setTimeout ( uint32_t  timeoutMs)
inlineinherited

Defines the read timeout for readBytes() in milliseconds.

Definition at line 26 of file RxDriver.h.

◆ toEdges()

void pulsewire::RxDriverESP32::toEdges ( rmt_symbol_word_t symbols,
size_t  num_symbols,
RingBuffer< OutputEdge > &  edges 
)
inlineprotected

Convert RMT symbols to edges and feed into codec.

Definition at line 247 of file RxDriverESP32.h.

Field Documentation

◆ _codec

Codec& pulsewire::RxDriverESP32::_codec
protected

Definition at line 184 of file RxDriverESP32.h.

◆ _edgeBuffer

RingBuffer<OutputEdge> pulsewire::RxDriverESP32::_edgeBuffer
protected

Definition at line 182 of file RxDriverESP32.h.

◆ _frameSize

size_t pulsewire::RxDriverESP32::_frameSize = 0
protected

Definition at line 177 of file RxDriverESP32.h.

◆ _freqHz

uint32_t pulsewire::RxDriverESP32::_freqHz
protected

Definition at line 179 of file RxDriverESP32.h.

◆ _readTimeoutMs

uint32_t pulsewire::RxDriver::_readTimeoutMs = 50
protectedinherited

Definition at line 29 of file RxDriver.h.

◆ _rxBuffer

RingBuffer<uint8_t> pulsewire::RxDriverESP32::_rxBuffer
protected

Definition at line 181 of file RxDriverESP32.h.

◆ _rxBufferSize

size_t pulsewire::RxDriverESP32::_rxBufferSize = 1024
protected

Definition at line 176 of file RxDriverESP32.h.

◆ _rxChannel

rmt_channel_handle_t pulsewire::RxDriverESP32::_rxChannel = nullptr
protected

Definition at line 180 of file RxDriverESP32.h.

◆ _rxPin

uint8_t pulsewire::RxDriverESP32::_rxPin
protected

Definition at line 178 of file RxDriverESP32.h.

◆ _symbols

Vector<rmt_symbol_word_t> pulsewire::RxDriverESP32::_symbols
protected

Definition at line 183 of file RxDriverESP32.h.

◆ _useChecksum

bool pulsewire::RxDriverESP32::_useChecksum = false
protected

Definition at line 185 of file RxDriverESP32.h.

◆ isActive

bool pulsewire::RxDriverESP32::isActive = false
protected

Definition at line 186 of file RxDriverESP32.h.

◆ receive_queue

QueueHandle_t pulsewire::RxDriverESP32::receive_queue
protected

Definition at line 187 of file RxDriverESP32.h.


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