33 #define ENABLE_PULL_UP
38 #define USE_PRESCALER_FACTOR_8 1
52 boolean pullup =
false,
101 void dump(Stream &stream)
const;
104 void setup(
boolean setup);
110 #if USE_PRESCALER_FACTOR_8
111 #define CAPTURE_PRESCALER_SETTING (_BV(CAT3(CS, CAP_TIM, 1)))
112 #define CAPTURE_PRESCALER_BITS (3)
114 #define CAPTURE_PRESCALER_SETTING (_BV(CAT3(CS, CAP_TIM, 0)))
115 #define CAPTURE_PRESCALER_BITS (0)
117 #define CAPTURE_PRESCALER_FACTOR (_BV(CAPTURE_PRESCALER_BITS))
119 #if RANGE_EXTENSION_BITS > 8
134 #if defined(_AVR_IOM32U4_H_)
135 #ifndef ALTERNATE_PIN
141 #else // Alternate pin
147 #endif // ALTERNATE_PIN
148 #elif defined(_AVR_IOM2560_H_)
149 #ifndef ALTERNATE_PIN
155 #else // ALTERNATE_PIN
161 #endif // ALTERNATE_PIN
174 #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) // clear bit
175 #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) // set bit
176 #define __CAT2(base, portname) base##portname // internally needed by CAT2
177 #define CAT2(prefix, num) __CAT2(prefix, num) // build a define name from 2 params
178 #define __CAT3(prefix, num, postfix) prefix##num##postfix // internally needed by CAT3
179 #define CAT3(prefix, num, postfix) __CAT3(prefix, num, postfix) // build a define name from 3 params
184 #if defined(DEBUG_PIN) && defined(DEBUG_PORT)
185 CAT2(PIN, DEBUG_PORT) = _BV(DEBUG_PIN);
190 #if defined(DEBUG_PIN) && defined(DEBUG_PORT)
191 cbi(
CAT2(PORT, DEBUG_PORT), DEBUG_PIN);
206 #if (F_CPU % 8000000) == 0
208 #elif (F_CPU % 1000000) == 0
210 #elif (F_CPU % 115200) == 0 // serial bps rate compatible cpu clocks, e.g. 7372800 or 14745600
static const milliseconds_t defaultBeginningTimeout
uint16_t microseconds_t
Type for durations in micro seconds.
static const milliseconds_t defaultEndingTimeout
virtual boolean isEmpty() const
uint16_t milliseconds_t
Type for durations in milli seconds.
Abstract base class for all IR readers, capturing or receiving.
boolean timeouted
True if last receive ended with a timeout.
uint16_t frequency_t
Type for modulation frequency in Hz.
milliseconds_t beginningTimeout
static const size_t defaultCaptureLength
int16_t markExcess
Microseconds subtracted from pulses and added to gaps.