Infrared4Arduino 1.2.3
Loading...
Searching...
No Matches
IrWidgetAggregating.h
Go to the documentation of this file.
1// Copyright (c) 2012 Michael Dreher <michael(at)5dot1.de>
2// this code may be distributed under the terms of the General Public License V2 (GPL V2)
3
4// This is a slight reorganization of the original code, by Bengt Martensson.
5
6#pragma once
7
8#include "IrWidget.h"
9
16private:
17 static IrWidgetAggregating *instance;
19 }
20
21public:
22 void capture();
23 static void deleteInstance();
24
26 return instance;
27 }
28
30 bool pullup = false,
34
35protected:
37 bool pullup = false,
41
42private:
43 inline uint16_t packTimeVal/*Normal*/(uint32_t val) const {
44 if (val >= 0x8000) {
45 val = val >> (RANGE_EXTENSION_BITS + 1);
46 val |= 0x8000;
47 }
48
49 return val;
50 }
51
52 inline uint32_t unpackTimeVal/*Normal*/(uint32_t val) const {
53 if (val & 0x8000) {
54 val = (val & 0x7fff) << (RANGE_EXTENSION_BITS + 1);
55 }
56
57 return val;
58 }
59};
uint16_t milliseconds_t
Type for durations in milli seconds.
Definition: InfraredTypes.h:24
static constexpr size_t defaultCaptureLength
Definition: IrReader.h:35
int16_t markExcess
Microseconds subtracted from pulses and added to gaps.
Definition: IrReader.h:44
milliseconds_t beginningTimeout
Definition: IrReader.h:38
static constexpr milliseconds_t defaultEndingTimeout
Definition: IrReader.h:34
static constexpr milliseconds_t defaultBeginningTimeout
Definition: IrReader.h:33
This class implements the IrWidget.
IrWidgetAggregating(size_t captureLength=defaultCaptureLength, bool pullup=false, int16_t markExcess=defaultMarkExcess, milliseconds_t beginningTimeout=defaultBeginningTimeout, milliseconds_t endingTimeout=defaultEndingTimeout)
static void deleteInstance()
static IrWidgetAggregating * getInstance()
static IrWidgetAggregating * newIrWidgetAggregating(size_t captureLength=defaultCaptureLength, bool pullup=false, int16_t markExcess=defaultMarkExcess, milliseconds_t beginningTimeout=defaultBeginningTimeout, milliseconds_t endingTimeout=defaultEndingTimeout)
Base class for classes based upon ICP pins capture.
Definition: IrWidget.h:44
static constexpr int16_t defaultMarkExcess
Definition: IrWidget.h:46
static constexpr uint8_t RANGE_EXTENSION_BITS
Definition: IrWidget.h:130
ovlBitsDataType endingTimeout
Definition: IrWidget.h:132