|
Arduino PulseWire Transceiver Library
|
Interrupt-driven Arduino RX driver for pulse-based protocols. More...
#include <RxDriverArduino.h>


Public Member Functions | |
| RxDriverArduino (Codec &codec, uint8_t pin, uint32_t freqHz=DEFAULT_BIT_FREQ_HZ, bool useChecksum=false, uint32_t timeoutUs=0) | |
| void | init (Codec &codec, uint8_t pin, uint32_t freqHz=DEFAULT_BIT_FREQ_HZ, bool useChecksum=false, uint32_t timeoutUs=0) |
| void | setFrameSize (uint16_t size) override |
| Set the expected frame size for dynamic data reception. | |
| void | setRxBufferSize (size_t size) |
| Set the size of the internal RX buffer. | |
| bool | begin (uint16_t bitFrequencyHz=DEFAULT_BIT_FREQ_HZ) override |
| Start 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 | end () |
| Stop the receiver. | |
Protected Member Functions | |
| void IRAM_ATTR | handleInterrupt () override |
| void | processEdges () |
| void | checkTimeout () |
| void | reset () |
Protected Attributes | |
| volatile uint32_t | _lastEdge |
| volatile bool | _lastLevel |
| uint8_t | _pin |
| uint32_t | _freqHz |
| uint16_t | _frameSize = DEFAULT_FRAME_SIZE |
| Codec & | _codec |
| RingBuffer< uint8_t > | _rxBuffer |
| RingBuffer< OutputEdge > | _edgeBuffer |
| uint32_t | _bitPeriodUs = 0 |
| uint32_t | _minUs = 0 |
| uint32_t | _maxUs = 0 |
| bool | _useChecksum = false |
| uint32_t | _timeoutUs = 0 |
| volatile bool | _is_active = false |
| volatile bool | _is_open = false |
Interrupt-driven Arduino RX driver for pulse-based protocols.
RxDriverArduino receives and decodes pulse-based signals (such as IR or single-wire protocols) using hardware interrupts for precise edge timing. It supports any Codec (Manchester, NRZ, etc.) and is compatible with both platforms that support attachInterruptArg (e.g., ESP32, RP2040) and those that do not (e.g., AVR, via ISRManager).
Features:
Limitations:
Definition at line 141 of file RxDriverArduino.h.
|
inline |
| codec | IR codec |
| pin | RX pin |
| freqHz | Bit frequency |
| useChecksum | If true, validate checksum (default: false) |
Definition at line 150 of file RxDriverArduino.h.
|
inline |
Definition at line 173 of file RxDriverArduino.h.
|
inlineoverridevirtual |
Get the number of bytes available in the internal buffer.
Implements pulsewire::RxDriver.
Definition at line 242 of file RxDriverArduino.h.
|
inlineoverridevirtual |
Start the receiver.
Implements pulsewire::RxDriver.
Definition at line 186 of file RxDriverArduino.h.
|
inlineprotected |
Definition at line 315 of file RxDriverArduino.h.
|
inlinevirtual |
Stop the receiver.
Implements pulsewire::RxDriver.
Definition at line 250 of file RxDriverArduino.h.
Implements pulsewire::RxDriverInt.
Definition at line 286 of file RxDriverArduino.h.
|
inline |
Definition at line 161 of file RxDriverArduino.h.
|
inlineprotected |
Definition at line 299 of file RxDriverArduino.h.
Read up to 'size' bytes from the internal buffer into 'data'. Returns number of bytes read.
Implements pulsewire::RxDriver.
Definition at line 231 of file RxDriverArduino.h.
|
inlineprotected |
Definition at line 340 of file RxDriverArduino.h.
Set the expected frame size for dynamic data reception.
Implements pulsewire::RxDriver.
Definition at line 175 of file RxDriverArduino.h.
Set the size of the internal RX buffer.
Implements pulsewire::RxDriver.
Definition at line 184 of file RxDriverArduino.h.
|
protected |
Definition at line 272 of file RxDriverArduino.h.
|
protected |
Definition at line 268 of file RxDriverArduino.h.
|
protected |
Definition at line 270 of file RxDriverArduino.h.
|
protected |
Definition at line 267 of file RxDriverArduino.h.
|
protected |
Definition at line 266 of file RxDriverArduino.h.
Definition at line 277 of file RxDriverArduino.h.
Definition at line 278 of file RxDriverArduino.h.
Definition at line 263 of file RxDriverArduino.h.
Definition at line 264 of file RxDriverArduino.h.
|
protected |
Definition at line 274 of file RxDriverArduino.h.
|
protected |
Definition at line 273 of file RxDriverArduino.h.
|
protected |
Definition at line 265 of file RxDriverArduino.h.
|
protected |
Definition at line 269 of file RxDriverArduino.h.
|
protected |
Definition at line 276 of file RxDriverArduino.h.
Definition at line 275 of file RxDriverArduino.h.