|
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 (uint32_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. | |
| void | setTimeout (uint32_t timeoutMs) |
| Defines the read timeout for readBytes() in milliseconds. | |
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 |
| uint32_t | _readTimeoutMs = 50 |
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 250 of file RxDriverArduino.h.
|
inlineoverridevirtual |
Start the receiver.
Implements pulsewire::RxDriver.
Definition at line 186 of file RxDriverArduino.h.
|
inlineprotected |
Definition at line 333 of file RxDriverArduino.h.
|
inlinevirtual |
Stop the receiver.
Implements pulsewire::RxDriver.
Definition at line 258 of file RxDriverArduino.h.
Implements pulsewire::RxDriverInt.
Definition at line 294 of file RxDriverArduino.h.
|
inline |
Definition at line 161 of file RxDriverArduino.h.
|
inlineprotected |
Definition at line 307 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 233 of file RxDriverArduino.h.
|
inlineprotected |
Definition at line 351 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.
Defines the read timeout for readBytes() in milliseconds.
Definition at line 26 of file RxDriver.h.
|
protected |
Definition at line 280 of file RxDriverArduino.h.
|
protected |
Definition at line 276 of file RxDriverArduino.h.
|
protected |
Definition at line 278 of file RxDriverArduino.h.
|
protected |
Definition at line 275 of file RxDriverArduino.h.
|
protected |
Definition at line 274 of file RxDriverArduino.h.
Definition at line 285 of file RxDriverArduino.h.
Definition at line 286 of file RxDriverArduino.h.
Definition at line 271 of file RxDriverArduino.h.
Definition at line 272 of file RxDriverArduino.h.
|
protected |
Definition at line 282 of file RxDriverArduino.h.
|
protected |
Definition at line 281 of file RxDriverArduino.h.
|
protected |
Definition at line 273 of file RxDriverArduino.h.
|
protectedinherited |
Definition at line 29 of file RxDriver.h.
|
protected |
Definition at line 277 of file RxDriverArduino.h.
|
protected |
Definition at line 284 of file RxDriverArduino.h.
Definition at line 283 of file RxDriverArduino.h.