Infrared4Arduino 1.2.3
|
Base class for classes based upon ICP pins capture. More...
#include <IrWidget.h>
Public Member Functions | |
virtual void | capture ()=0 |
void | receive () |
For compatibility with the receiver classes, receive is a synonym for capture. More... | |
size_t | getDataLength () const |
Returns the number of collected durations. More... | |
bool | isReady () const |
Returns true if there is collected data. More... | |
void | reset () |
microseconds_t | getDuration (unsigned int i) const |
Returns the index-th duration, if possible. More... | |
void | setEndingTimeout (milliseconds_t timeout) |
Sets the ending timeout. More... | |
milliseconds_t | getEndingTimeout () const |
frequency_t | getFrequency () const |
Returns frequency of received signal. More... | |
void | dump (Stream &stream) const |
Prints a textual representation of the received data to the Stream supplied. More... | |
Public Member Functions inherited from IrReader | |
virtual void | reset () |
virtual frequency_t | getFrequency () const =0 |
Returns frequency of received signal. More... | |
virtual void | enable () |
Start reception of IR data. More... | |
virtual void | disable () |
Stop reception of IR data. More... | |
virtual void | receive ()=0 |
Convenience function: enable, wait until data is collected or timeout has occured, disable. More... | |
virtual bool | isReady () const =0 |
Returns true if there is collected data. More... | |
operator bool () const | |
Same as isReady() More... | |
virtual size_t | getDataLength () const =0 |
Returns the number of collected durations. More... | |
virtual microseconds_t | getDuration (unsigned int index) const =0 |
Returns the index-th duration, if possible. More... | |
virtual void | dump (Stream &stream) const |
Prints a textual representation of the received data to the Stream supplied. More... | |
IrSequence * | toIrSequence () const |
Generates an IrSequence from the IrReader. More... | |
virtual bool | isEmpty () const |
virtual void | setEndingTimeout (milliseconds_t timeOut) |
virtual milliseconds_t | getEndingTimeout () const |
virtual void | setBeginningTimeout (milliseconds_t timeOut) |
virtual milliseconds_t | getBeginningTimeout () const |
unsigned int | getBufferSize () const |
void | setMarkExcess (int16_t markExcess_) |
Sets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to the off.durations. More... | |
int16_t | getMarkExcess () const |
Gets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to the off.durations. More... | |
Static Public Attributes | |
static constexpr int16_t | defaultMarkExcess = 0 |
static const bool | invertingSensor = true |
Set true means if sensor signal is inverted (low = signal on) (false has not been tested, and is not supported). More... | |
Static Public Attributes inherited from IrReader | |
static constexpr milliseconds_t | defaultBeginningTimeout = 2000U |
static constexpr milliseconds_t | defaultEndingTimeout = 30U |
static constexpr size_t | defaultCaptureLength = 100U |
Protected Types | |
typedef uint8_t | ovlBitsDataType |
Protected Member Functions | |
IrWidget (size_t captureLength=defaultCaptureLength, bool pullup=false, int16_t markExcess=defaultMarkExcess, milliseconds_t beginningTimeout=defaultBeginningTimeout, milliseconds_t endingTimeout=defaultEndingTimeout) | |
virtual | ~IrWidget () |
void | debugPinToggle (void) |
void | debugPinClear (void) |
virtual uint32_t | unpackTimeVal (uint32_t val) const =0 |
Protected Member Functions inherited from IrReader | |
IrReader (size_t bufSize_) | |
Constructs an IrReader with buffersize bufSize_, possibly increased to be even. More... | |
IrReader () | |
virtual | ~IrReader () |
Static Protected Member Functions | |
static uint32_t | timerValueToNanoSeconds (uint32_t x) |
Static Protected Member Functions inherited from IrReader | |
static unsigned int | forceEven (unsigned int x) |
Protected Attributes | |
frequency_t | frequency |
ovlBitsDataType | endingTimeout |
uint16_t * | captureData |
uint16_t | captureCount |
Protected Attributes inherited from IrReader | |
milliseconds_t | beginningTimeout |
milliseconds_t | endingTimeout |
size_t | bufferSize |
int16_t | markExcess |
Microseconds subtracted from pulses and added to gaps. More... | |
bool | timeouted |
True if last receive ended with a timeout. More... | |
Static Protected Attributes | |
static constexpr uint8_t | RANGE_EXTENSION_BITS = 4 |
static constexpr uint8_t | sampleSize = 2 |
Base class for classes based upon ICP pins capture.
Definition at line 44 of file IrWidget.h.
|
protected |
Definition at line 127 of file IrWidget.h.
|
protected |
|
protectedvirtual |
|
pure virtual |
Implemented in IrWidgetAggregating.
|
inlineprotected |
Definition at line 193 of file IrWidget.h.
|
inlineprotected |
Definition at line 187 of file IrWidget.h.
|
virtual |
Prints a textual representation of the received data to the Stream supplied.
stream | Stream to which to print |
Reimplemented from IrReader.
|
inlinevirtual |
Returns the number of collected durations.
Implements IrReader.
Definition at line 74 of file IrWidget.h.
|
inlinevirtual |
Returns the index-th duration, if possible.
index | index of duration |
Implements IrReader.
Definition at line 86 of file IrWidget.h.
|
virtual |
Reimplemented from IrReader.
|
inlinevirtual |
Returns frequency of received signal.
This is a dumb default implementation, to be overridden when meaningful.
Implements IrReader.
Definition at line 101 of file IrWidget.h.
|
inlinevirtual |
Returns true if there is collected data.
Implements IrReader.
Definition at line 78 of file IrWidget.h.
|
inlinevirtual |
For compatibility with the receiver classes, receive is a synonym for capture.
Implements IrReader.
Definition at line 70 of file IrWidget.h.
|
inlinevirtual |
Reimplemented from IrReader.
Definition at line 82 of file IrWidget.h.
|
virtual |
Sets the ending timeout.
In this implementation, this is effectively rounded to the nearest multiple of 32 milliseconds.
timeout | timeout in milliseconds. |
Reimplemented from IrReader.
|
inlinestaticprotected |
Definition at line 206 of file IrWidget.h.
|
protectedpure virtual |
|
protected |
Definition at line 199 of file IrWidget.h.
|
protected |
Definition at line 198 of file IrWidget.h.
|
staticconstexpr |
Definition at line 46 of file IrWidget.h.
|
protected |
Definition at line 132 of file IrWidget.h.
|
protected |
Definition at line 49 of file IrWidget.h.
|
static |
Set true means if sensor signal is inverted (low = signal on) (false has not been tested, and is not supported).
Definition at line 63 of file IrWidget.h.
|
staticconstexprprotected |
Definition at line 130 of file IrWidget.h.
|
staticconstexprprotected |
Definition at line 200 of file IrWidget.h.