IRremote
IRremoteInt.h
Go to the documentation of this file.
1 
33 #ifndef _IR_REMOTE_INT_H
34 #define _IR_REMOTE_INT_H
35 
36 #include <Arduino.h>
37 
38 #define MARK 1
39 #define SPACE 0
40 
41 #if defined(PARTICLE)
42 #define F_CPU 16000000 // definition for a board for which F_CPU is not defined
43 #endif
44 #if defined(F_CPU) // F_CPU is used to generate the receive send timings in some CPU's
45 #define CLOCKS_PER_MICRO (F_CPU / MICROS_IN_ONE_SECOND)
46 #endif
47 
48 /*
49  * For backwards compatibility
50  */
51 #if defined(SYSCLOCK) // allow for processor specific code to define F_CPU
52 #undef F_CPU
53 #define F_CPU SYSCLOCK // Clock frequency to be used for timing.
54 #endif
55 
56 //#define DEBUG // Activate this for lots of lovely debug output from the IRremote core and all protocol decoders.
57 //#define TRACE // Activate this for more debug output.
58 
62 #define DISABLE_LED_FEEDBACK false
63 #define ENABLE_LED_FEEDBACK true
64 #define USE_DEFAULT_FEEDBACK_LED_PIN 0
65 
70 #if !defined(RAW_BUFFER_LENGTH)
71 # if defined(DECODE_MAGIQUEST)
72 #define RAW_BUFFER_LENGTH 112 // MagiQuest requires 112 bytes.
73 # else
74 #define RAW_BUFFER_LENGTH 100
75 //#define RAW_BUFFER_LENGTH 750 // 750 (600 if we have only 2k RAM) is the value for air condition remotes.
76 # endif
77 #endif
78 #if RAW_BUFFER_LENGTH % 2 == 1
79 #error RAW_BUFFER_LENGTH must be even, since the array consists of space / mark pairs.
80 #endif
81 
82 /****************************************************
83  * Declarations for the receiver Interrupt Service Routine
84  ****************************************************/
85 // ISR State-Machine : Receiver States
86 #define IR_REC_STATE_IDLE 0 // Counting the gap time and waiting for the start bit to arrive
87 #define IR_REC_STATE_MARK 1 // A mark was received and we are counting the duration of it.
88 #define IR_REC_STATE_SPACE 2 // A space was received and we are counting the duration of it. If space is too long, we assume end of frame.
89 #define IR_REC_STATE_STOP 3 // Stopped until set to IR_REC_STATE_IDLE which can only be done by resume()
90 
96  // The fields are ordered to reduce memory over caused by struct-padding
97  volatile uint8_t StateForISR;
98  uint_fast8_t IRReceivePin;
99 #if defined(__AVR__)
100  volatile uint8_t *IRReceivePinPortInputRegister;
101  uint8_t IRReceivePinMask;
102 #endif
103  volatile uint_fast16_t TickCounterForISR;
104 #if !IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK
106 #endif
108 #if RAW_BUFFER_LENGTH <= 254 // saves around 75 bytes program memory and speeds up ISR
109  uint_fast8_t rawlen;
110 #else
111  uint_fast16_t rawlen;
112 #endif
114 };
115 
116 #if (__INT_WIDTH__ < 32)
117 typedef uint32_t IRRawDataType;
118 #define BITS_IN_RAW_DATA_TYPE 32
119 #else
120 typedef uint64_t IRRawDataType;
121 #define BITS_IN_RAW_DATA_TYPE 64
122 #endif
123 #include "IRProtocol.h"
124 
125 /*
126  * Debug directives
127  * Outputs with IR_DEBUG_PRINT can only be activated by defining DEBUG!
128  * If LOCAL_DEBUG is defined in one file, all outputs with IR_DEBUG_PRINT are still suppressed.
129  */
130 #if defined(DEBUG) || defined(TRACE)
131 # define IR_DEBUG_PRINT(...) Serial.print(__VA_ARGS__)
132 # define IR_DEBUG_PRINTLN(...) Serial.println(__VA_ARGS__)
133 #else
134 
137 # define IR_DEBUG_PRINT(...) void()
138 
141 # define IR_DEBUG_PRINTLN(...) void()
142 #endif
143 
144 #if defined(TRACE)
145 # define IR_TRACE_PRINT(...) Serial.print(__VA_ARGS__)
146 # define IR_TRACE_PRINTLN(...) Serial.println(__VA_ARGS__)
147 #else
148 # define IR_TRACE_PRINT(...) void()
149 # define IR_TRACE_PRINTLN(...) void()
150 #endif
151 
152 /****************************************************
153  * RECEIVING
154  ****************************************************/
155 
160  decode_type_t decode_type; // deprecated, moved to decodedIRData.protocol ///< UNKNOWN, NEC, SONY, RC5, ...
161  uint16_t address; // Used by Panasonic & Sharp [16-bits]
162  uint32_t value; // deprecated, moved to decodedIRData.decodedRawData ///< Decoded value / command [max 32-bits]
163  uint8_t bits; // deprecated, moved to decodedIRData.numberOfBits ///< Number of bits in decoded value
164  uint16_t magnitude; // deprecated, moved to decodedIRData.extra ///< Used by MagiQuest [16-bits]
165  bool isRepeat; // deprecated, moved to decodedIRData.flags ///< True if repeat of value is detected
166 
167 // next 3 values are copies of irparams_struct values - see above
168  uint16_t *rawbuf; // deprecated, moved to decodedIRData.rawDataPtr->rawbuf ///< Raw intervals in 50uS ticks
169  uint_fast8_t rawlen; // deprecated, moved to decodedIRData.rawDataPtr->rawlen ///< Number of records in rawbuf
170  bool overflow; // deprecated, moved to decodedIRData.flags ///< true if IR raw code too long
171 };
172 
176 class IRrecv {
177 public:
178 
179  IRrecv();
180  IRrecv(uint_fast8_t aReceivePin);
181  IRrecv(uint_fast8_t aReceivePin, uint_fast8_t aFeedbackLEDPin);
182  void setReceivePin(uint_fast8_t aReceivePinNumber);
183  void registerReceiveCompleteCallback(void (*aReceiveCompleteCallbackFunction)(void));
184  /*
185  * Stream like API
186  */
187  void begin(uint_fast8_t aReceivePin, bool aEnableLEDFeedback = false, uint_fast8_t aFeedbackLEDPin =
189  void restartTimer();
190  void start();
191  void enableIRIn(); // alias for start
192  void start(uint32_t aMicrosecondsToAddToGapCounter);
193  void restartTimer(uint32_t aMicrosecondsToAddToGapCounter);
194  void startWithTicksToAdd(uint16_t aTicksToAddToGapCounter);
195  void restartTimerWithTicksToAdd(uint16_t aTicksToAddToGapCounter);
196  void restartAfterSend();
197 
198  void addTicksToInternalTickCounter(uint16_t aTicksToAddToInternalTickCounter);
199  void addMicrosToInternalTickCounter(uint16_t aMicrosecondsToAddToInternalTickCounter);
200 
201  bool available();
202  IRData* read(); // returns decoded data
203  // write is a method of class IRsend below
204  // size_t write(IRData *aIRSendData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
205  void stopTimer();
206  void stop();
207  void disableIRIn(); // alias for stop
208  void end(); // alias for stop
209 
210  bool isIdle();
211 
212  /*
213  * The main functions
214  */
215  bool decode(); // Check if available and try to decode
216  void resume(); // Enable receiving of the next value
217 
218  /*
219  * Useful info and print functions
220  */
221  void printIRResultMinimal(Print *aSerial);
222  void printIRResultRawFormatted(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks = true);
223  void printIRResultAsCVariables(Print *aSerial);
224  uint32_t getTotalDurationOfRawData();
225 
226  /*
227  * Next 4 functions are also available as non member functions
228  */
229  bool printIRResultShort(Print *aSerial, bool aPrintRepeatGap = true, bool aCheckForRecordGapsMicros = true);
230  void printDistanceWidthTimingInfo(Print *aSerial, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo);
231  void printIRSendUsage(Print *aSerial);
232 #if defined(__AVR__)
233  const __FlashStringHelper* getProtocolString();
234 #else
235  const char* getProtocolString();
236 #endif
237  static void printActiveIRProtocols(Print *aSerial);
238 
239  void compensateAndPrintIRResultAsCArray(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks = true);
240  void compensateAndPrintIRResultAsPronto(Print *aSerial, uint16_t frequency = 38000U);
241 
242  /*
243  * Store the data for further processing
244  */
245  void compensateAndStoreIRResultInArray(uint8_t *aArrayPtr);
246  size_t compensateAndStorePronto(String *aString, uint16_t frequency = 38000U);
247 
248  /*
249  * The main decoding functions used by the individual decoders
250  */
251  bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits,
252  uint_fast8_t aStartOffset = 3);
253 
254  bool decodePulseDistanceWidthData(uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset, uint16_t aOneMarkMicros,
255  uint16_t aZeroMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroSpaceMicros, bool aMSBfirst);
256 
257  bool decodeBiPhaseData(uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset, uint_fast8_t aStartClockCount,
258  uint_fast8_t aValueOfSpaceToMarkTransition, uint16_t aBiphaseTimeUnit);
259 
260  void initBiphaselevel(uint_fast8_t aRCDecodeRawbuffOffset, uint16_t aBiphaseTimeUnit);
261  uint_fast8_t getBiphaselevel();
262 
263  /*
264  * All standard (decode address + command) protocol decoders
265  */
266  bool decodeBangOlufsen();
267  bool decodeBoseWave();
268  bool decodeDenon();
269  bool decodeFAST();
270  bool decodeJVC();
271  bool decodeKaseikyo();
273  bool decodeLG();
274  bool decodeMagiQuest(); // not completely standard
275  bool decodeNEC();
276  bool decodeRC5();
277  bool decodeRC6();
278  bool decodeSamsung();
279  bool decodeSharp(); // redirected to decodeDenon()
280  bool decodeSony();
281  bool decodeWhynter();
282 
283  bool decodeDistanceWidth();
284 
285  bool decodeHash();
286 
287  // Template function :-)
288  bool decodeShuzu();
289 
290  /*
291  * Old functions
292  */
293  bool decodeDenonOld(decode_results *aResults);
294  bool decodeJVCMSB(decode_results *aResults);
295  bool decodeLGMSB(decode_results *aResults);
296  bool decodeNECMSB(decode_results *aResults);
298  bool decodeSonyMSB(decode_results *aResults);
299  bool decodeSAMSUNG(decode_results *aResults);
300  bool decodeHashOld(decode_results *aResults);
301 
302  bool decode_old(decode_results *aResults);
303 
304  bool decode(
305  decode_results *aResults)
306  __attribute__ ((deprecated ("Please use IrReceiver.decode() without a parameter and IrReceiver.decodedIRData.<fieldname> .")));
307 
308  // for backward compatibility. Now in IRFeedbackLED.hpp
309  void blink13(uint8_t aEnableLEDFeedback)
310  __attribute__ ((deprecated ("Please use setLEDFeedback() or enableLEDFeedback() / disableLEDFeedback().")));
311 
312  /*
313  * Internal functions
314  */
315  void initDecodedIRData();
316  uint_fast8_t compare(uint16_t oldval, uint16_t newval);
317  bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants);
318  void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks);
319  bool checkForRecordGapsMicros(Print *aSerial);
320 
321  IRData decodedIRData; // Decoded IR data for the application
322 
323  // Last decoded IR data for repeat detection and parity for Denon autorepeat
327 
328  uint8_t repeatCount; // Used e.g. for Denon decode for autorepeat decoding.
329 };
330 
331 extern uint_fast8_t sBiphaseDecodeRawbuffOffset; //
332 
333 /*
334  * Mark & Space matching functions
335  */
336 bool matchTicks(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros);
337 bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros);
338 bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros);
339 
340 /*
341  * Old function names
342  */
343 bool MATCH(uint16_t measured, uint16_t desired);
344 bool MATCH_MARK(uint16_t measured_ticks, uint16_t desired_us);
345 bool MATCH_SPACE(uint16_t measured_ticks, uint16_t desired_us);
346 
347 int getMarkExcessMicros();
348 
349 void printActiveIRProtocols(Print *aSerial);
350 
351 /****************************************************
352  * Feedback LED related functions
353  ****************************************************/
354 #define DO_NOT_ENABLE_LED_FEEDBACK 0x00
355 #define LED_FEEDBACK_DISABLED_COMPLETELY 0x00
356 #define LED_FEEDBACK_ENABLED_FOR_RECEIVE 0x01
357 #define LED_FEEDBACK_ENABLED_FOR_SEND 0x02
358 void setFeedbackLED(bool aSwitchLedOn);
359 void setLEDFeedback(uint8_t aFeedbackLEDPin, uint8_t aEnableLEDFeedback); // if aFeedbackLEDPin == 0, then take board BLINKLED_ON() and BLINKLED_OFF() functions
360 void setLEDFeedback(bool aEnableLEDFeedback); // Direct replacement for blink13()
361 void enableLEDFeedback();
362 constexpr auto enableLEDFeedbackForReceive = enableLEDFeedback; // alias for enableLEDFeedback
363 void disableLEDFeedback();
364 constexpr auto disableLEDFeedbackForReceive = disableLEDFeedback; // alias for enableLEDFeedback
367 
368 void setBlinkPin(uint8_t aFeedbackLEDPin) __attribute__ ((deprecated ("Please use setLEDFeedback()."))); // deprecated
369 
370 /*
371  * Pulse parms are ((X*50)-MARK_EXCESS_MICROS) for the Mark and ((X*50)+MARK_EXCESS_MICROS) for the Space.
372  * First MARK is the one after the long gap
373  * Pulse parameters in microseconds
374  */
375 #if !defined(TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING)
376 #define TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING 25 // Relative tolerance (in percent) for matchTicks(), matchMark() and matchSpace() functions used for protocol decoding.
377 #endif
378 
380 //#define LTOL (1.0 - (TOLERANCE/100.))
381 #define LTOL (100 - TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING)
382 
383 //#define UTOL (1.0 + (TOLERANCE/100.))
384 #define UTOL (100 + TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING)
385 
386 //#define TICKS_LOW(us) ((int)(((us)*LTOL/MICROS_PER_TICK)))
387 //#define TICKS_HIGH(us) ((int)(((us)*UTOL/MICROS_PER_TICK + 1)))
388 #if MICROS_PER_TICK == 50 && TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING == 25 // Defaults
389 #define TICKS_LOW(us) ((us)/67 ) // (us) / ((MICROS_PER_TICK:50 / LTOL:75 ) * 100)
390 #define TICKS_HIGH(us) (((us)/40) + 1) // (us) / ((MICROS_PER_TICK:50 / UTOL:125) * 100) + 1
391 #else
392 #define TICKS_LOW(us) ((uint16_t ) ((long) (us) * LTOL / (MICROS_PER_TICK * 100) ))
393 #define TICKS_HIGH(us) ((uint16_t ) ((long) (us) * UTOL / (MICROS_PER_TICK * 100) + 1))
394 #endif
395 
396 /*
397  * The receiver instance
398  */
399 extern IRrecv IrReceiver;
400 
401 /*
402  * The receiver interrupt handler for timer interrupt
403  */
405 
406 /****************************************************
407  * SENDING
408  ****************************************************/
409 
413 #define NO_REPEATS 0
414 #define SEND_REPEAT_COMMAND true
415 
416 
419 class IRsend {
420 public:
421  IRsend();
422 
423  /*
424  * IR_SEND_PIN is defined or fixed by timer, value of IR_SEND_PIN is then "DeterminedByTimer"
425  */
426 #if defined(IR_SEND_PIN)
427  void begin();
428  // The default parameter allowed to specify IrSender.begin(7); without errors, if IR_SEND_PIN was defined. But the semantics is not the one the user expect.
429  void begin(bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin); // 4.3.1 Removed default value USE_DEFAULT_FEEDBACK_LED_PIN for last parameter
430  // The next function is a dummy to avoid acceptance of pre 4.3 calls to begin(DISABLE_LED_FEEDBACK);
431  void begin(uint8_t aSendPin)
432 # if !defined (DOXYGEN)
433  __attribute__ ((deprecated ("Error: IR_SEND_PIN is still defined, therefore the function begin(aSendPin) is NOT available. You must disable '#define IR_SEND_PIN' to enable this function.")));
434 # endif
435 
436  // The next function is a dummy to avoid acceptance of pre 4.0 calls to begin(IR_SEND_PIN, DISABLE_LED_FEEDBACK);
437  void begin(uint_fast8_t aSendPin, bool aEnableLEDFeedback)
438 # if !defined (DOXYGEN)
439  __attribute__ ((deprecated ("You must use begin() and enableLEDFeedback() or disableLEDFeedback() since version 4.3.")));
440 # endif
441 #else
442  IRsend(uint_fast8_t aSendPin);
443  void begin(uint_fast8_t aSendPin);
444  void setSendPin(uint_fast8_t aSendPin); // required if we use IRsend() as constructor
445  // Since 4.0 guarded and without default parameter
446  void begin(uint_fast8_t aSendPin, bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin); // aFeedbackLEDPin can be USE_DEFAULT_FEEDBACK_LED_PIN
447 #endif
448 
449  size_t write(IRData *aIRSendData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
450  size_t write(decode_type_t aProtocol, uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats = NO_REPEATS);
451 
452  void enableIROut(uint_fast8_t aFrequencyKHz);
453 #if defined(SEND_PWM_BY_TIMER)
454  void enableHighFrequencyIROut(uint_fast16_t aFrequencyKHz); // Used for Bang&Olufsen
455 #endif
456 
457  void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
458  uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
459  IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
460  int_fast8_t aNumberOfRepeats);
461  void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
462  uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
463  IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit,
464  uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats)
465  __attribute__ ((deprecated ("Since version 4.1.0 parameter aSendStopBit is not longer required.")));
467  IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
468  void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo,
469  IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
470  int_fast8_t aNumberOfRepeats);
471 
473  uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
475  uint_fast8_t aNumberOfBits);
476  void sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
477  uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
478  IRRawDataType aData, uint_fast8_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
479  int_fast8_t aNumberOfRepeats, void (*aSpecialSendRepeatFunction)() = NULL);
480  void sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
481  uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
482  IRRawDataType aData, uint_fast8_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit, uint16_t aRepeatPeriodMillis,
483  int_fast8_t aNumberOfRepeats, void (*aSpecialSendRepeatFunction)() = NULL)
484  __attribute__ ((deprecated ("Since version 4.1.0 parameter aSendStopBit is not longer required.")));
485  void sendPulseDistanceWidthData(uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros,
486  uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, uint8_t aFlags);
487  void sendPulseDistanceWidthData(uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros,
488  uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit)
489  __attribute__ ((deprecated ("Since version 4.1.0 last parameter aSendStopBit is not longer required.")));
490  void sendBiphaseData(uint16_t aBiphaseTimeUnit, uint32_t aData, uint_fast8_t aNumberOfBits);
491 
492  void mark(uint16_t aMarkMicros);
493  static void space(uint16_t aSpaceMicros);
494  void IRLedOff();
495 
496 // 8 Bit array
497  void sendRaw(const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
498  void sendRaw_P(const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
499 
500 // 16 Bit array
501  void sendRaw(const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
502  void sendRaw_P(const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
503 
504  /*
505  * New send functions
506  */
507  void sendBangOlufsen(uint16_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats = NO_REPEATS,
508  int8_t aNumberOfHeaderBits = 8);
509  void sendBangOlufsenDataLink(uint32_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats = NO_REPEATS,
510  int8_t aNumberOfHeaderBits = 8);
511  void sendBangOlufsenRaw(uint32_t aRawData, int_fast8_t aBits, bool aBackToBack = false);
512  void sendBangOlufsenRawDataLink(uint64_t aRawData, int_fast8_t aBits, bool aBackToBack = false,
513  bool aUseDatalinkTiming = false);
514  void sendBoseWave(uint8_t aCommand, int_fast8_t aNumberOfRepeats = NO_REPEATS);
515  void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp = false);
516  void sendDenonRaw(uint16_t aRawData, int_fast8_t aNumberOfRepeats = NO_REPEATS)
517 #if !defined (DOXYGEN)
518  __attribute__ ((deprecated ("Please use sendDenon(aAddress, aCommand, aNumberOfRepeats).")));
519 #endif
520  void sendFAST(uint8_t aCommand, int_fast8_t aNumberOfRepeats);
521  void sendJVC(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
522 
523  void sendLG2Repeat();
524  uint32_t computeLGRawDataAndChecksum(uint8_t aAddress, uint16_t aCommand);
525  void sendLG(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
526  void sendLG2(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
527  void sendLGRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
528 
529  void sendNECRepeat();
530  uint32_t computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand);
531  void sendNEC(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
532  void sendNEC2(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
533  void sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
534  // NEC variants
535  void sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
536  void sendApple(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
537 
538  void sendKaseikyo(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode); // LSB first
539  void sendPanasonic(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
540  void sendKaseikyo_Denon(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
541  void sendKaseikyo_Mitsubishi(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
542  void sendKaseikyo_Sharp(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
543  void sendKaseikyo_JVC(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
544 
545  void sendRC5(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle = true);
546  void sendRC6(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle = true);
547  void sendSamsungLGRepeat();
548  void sendSamsung(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
549  void sendSamsung16BitAddressAndCommand(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
550  void sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats);
551  void sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
552  void sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats); // redirected to sendDenon
553  void sendSony(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t numberOfBits = 12); // SIRCS_12_PROTOCOL
554 
555  void sendLegoPowerFunctions(uint8_t aChannel, uint8_t tCommand, uint8_t aMode, bool aDoSend5Times = true);
556  void sendLegoPowerFunctions(uint16_t aRawData, bool aDoSend5Times = true);
557  void sendLegoPowerFunctions(uint16_t aRawData, uint8_t aChannel, bool aDoSend5Times = true);
558 
559  void sendMagiQuest(uint32_t aWandId, uint16_t aMagnitude);
560 
561  void sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats = NO_REPEATS);
562  void sendPronto(const char *prontoHexString, int_fast8_t aNumberOfRepeats = NO_REPEATS);
563  void sendPronto(const uint16_t *data, uint16_t length, int_fast8_t aNumberOfRepeats = NO_REPEATS);
564 
565 #if defined(__AVR__)
566  void sendPronto_PF(uint_farptr_t str, int_fast8_t aNumberOfRepeats = NO_REPEATS);
567  void sendPronto_P(const char *str, int_fast8_t aNumberOfRepeats);
568 #endif
569 
570 // Template protocol :-)
571  void sendShuzu(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
572 
573  /*
574  * OLD send functions
575  */
576  void sendDenon(unsigned long data,
577  int nbits)
578  __attribute__ ((deprecated ("The function sendDenon(data, nbits) is deprecated and may not work as expected! Use sendDenonRaw(data, NumberOfRepeats) or better sendDenon(Address, Command, NumberOfRepeats).")));
579  void sendDish(uint16_t aData);
580  void sendJVC(unsigned long data, int nbits,
581  bool repeat)
582  __attribute__ ((deprecated ("This old function sends MSB first! Please use sendJVC(aAddress, aCommand, aNumberOfRepeats)."))) {
583  sendJVCMSB(data, nbits, repeat);
584  }
585  void sendJVCMSB(unsigned long data, int nbits, bool repeat = false);
586 
587  void sendLG(unsigned long data,
588  int nbits)
589  __attribute__ ((deprecated ("The function sendLG(data, nbits) is deprecated and may not work as expected! Use sendLGRaw(data, NumberOfRepeats) or better sendLG(Address, Command, NumberOfRepeats).")));
590 
591  void sendNEC(uint32_t aRawData,
592  uint8_t nbits)
593  __attribute__ ((deprecated ("This old function sends MSB first! Please use sendNECMSB() or sendNEC(aAddress, aCommand, aNumberOfRepeats)."))) {
594  sendNECMSB(aRawData, nbits);
595  }
596  void sendNECMSB(uint32_t data, uint8_t nbits, bool repeat = false);
597  void sendRC5(uint32_t data, uint8_t nbits);
598  void sendRC5ext(uint8_t addr, uint8_t cmd, bool toggle);
599  void sendRC6Raw(uint32_t data, uint8_t nbits);
600  void sendRC6(uint32_t data, uint8_t nbits) __attribute__ ((deprecated ("Please use sendRC6Raw().")));
601  void sendRC6Raw(uint64_t data, uint8_t nbits);
602  void sendRC6(uint64_t data, uint8_t nbits) __attribute__ ((deprecated ("Please use sendRC6Raw().")));
603  ;
604  void sendSharpRaw(unsigned long data, int nbits);
605  void sendSharp(uint16_t address, uint16_t command);
606  void sendSAMSUNG(unsigned long data, int nbits);
607  __attribute__ ((deprecated ("This old function sends MSB first! Please use sendSamsung().")));
608  void sendSony(unsigned long data,
609  int nbits)
610  __attribute__ ((deprecated ("This old function sends MSB first! Please use sendSony(aAddress, aCommand, aNumberOfRepeats).")));
611  ;
612  void sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend);
613 
614 #if !defined(IR_SEND_PIN)
615  uint8_t sendPin;
616 #endif
618  uint16_t periodOnTimeMicros; // compensated with PULSE_CORRECTION_NANOS for duration of digitalWrite. Around 8 microseconds for 38 kHz.
619  uint16_t getPulseCorrectionNanos();
620 
621  static void customDelayMicroseconds(unsigned long aMicroseconds);
622 };
623 
624 /*
625  * The sender instance
626  */
627 extern IRsend IrSender;
628 
629 void sendNECSpecialRepeat();
630 void sendLG2SpecialRepeat();
632 
633 #endif // _IR_REMOTE_INT_H
IRrecv::decodeHash
bool decodeHash()
decodeHash - decode an arbitrary IR code.
Definition: IRReceive.hpp:963
IRsend::sendShuzu
void sendShuzu(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_Template.hpp:134
IRsend::sendLGRaw
void sendLGRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Here you can put your raw data, even one with "wrong" checksum.
Definition: ir_LG.hpp:286
decode_results
Results returned from old decoders !!!deprecated!!!
Definition: IRremoteInt.h:159
decode_results::rawbuf
uint16_t * rawbuf
Definition: IRremoteInt.h:170
IRsend::sendApple
void sendApple(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_NEC.hpp:207
IRsend::sendMagiQuest
void sendMagiQuest(uint32_t aWandId, uint16_t aMagnitude)
Definition: ir_MagiQuest.hpp:118
setFeedbackLED
void setFeedbackLED(bool aSwitchLedOn)
Flash LED while receiving or sending IR data.
Definition: IRFeedbackLED.hpp:108
IRsend::sendDish
void sendDish(uint16_t aData)
Definition: ir_Others.hpp:64
IRsend::sendNECRaw
void sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Definition: ir_NEC.hpp:225
IRrecv::stop
void stop()
Disables the timer for IR reception.
Definition: IRReceive.hpp:425
IRrecv::lastDecodedProtocol
decode_type_t lastDecodedProtocol
Definition: IRremoteInt.h:324
IRsend::aNumberOfRepeats
void int_fast8_t aNumberOfRepeats
Definition: IRremoteInt.h:520
IRsend::sendPin
uint8_t sendPin
Definition: IRremoteInt.h:615
IRsend::sendJVC
void sendJVC(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
The JVC protocol repeats by skipping the header mark and space -> this leads to a poor repeat detecti...
Definition: ir_JVC.hpp:92
IRrecv::disableIRIn
void disableIRIn()
Alias for stop().
Definition: IRReceive.hpp:435
IRsend::sendKaseikyo_Sharp
void sendKaseikyo_Sharp(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with SHARP_VENDOR_ID_CODE.
Definition: ir_Kaseikyo.hpp:185
setBlinkPin
void setBlinkPin(uint8_t aFeedbackLEDPin) __attribute__((deprecated("Please use setLEDFeedback().")))
Old deprecated function name for setLEDFeedback()
Definition: IRFeedbackLED.hpp:153
IRrecv::enableIRIn
void enableIRIn()
Alias for start().
Definition: IRReceive.hpp:380
enableLEDFeedback
void enableLEDFeedback()
Definition: IRFeedbackLED.hpp:85
IRsend::sendBangOlufsenRaw
void sendBangOlufsenRaw(uint32_t aRawData, int_fast8_t aBits, bool aBackToBack=false)
Definition: ir_BangOlufsen.hpp:163
IRsend::setSendPin
void setSendPin(uint_fast8_t aSendPin)
Definition: IRSend.hpp:128
IRrecv::checkForRecordGapsMicros
bool checkForRecordGapsMicros(Print *aSerial)
Definition: IRReceive.hpp:1158
IRsend::sendBoseWave
void sendBoseWave(uint8_t aCommand, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Definition: ir_BoseWave.hpp:57
IRsend::sendSony
void sendSony(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t numberOfBits=12)
Definition: ir_Sony.hpp:103
disableLEDFeedbackForSend
void disableLEDFeedbackForSend()
Definition: IRFeedbackLED.hpp:97
IRrecv::compensateAndStorePronto
size_t compensateAndStorePronto(String *aString, uint16_t frequency=38000U)
Definition: ir_Pronto.hpp:322
IRrecv::registerReceiveCompleteCallback
void registerReceiveCompleteCallback(void(*aReceiveCompleteCallbackFunction)(void))
Sets the function to call if a protocol message has arrived.
Definition: IRReceive.hpp:341
IRrecv
Main class for receiving IR signals.
Definition: IRremoteInt.h:176
NO_REPEATS
#define NO_REPEATS
Just for better readability of code.
Definition: IRremoteInt.h:413
IRsend::sendRC6Raw
void sendRC6Raw(uint32_t data, uint8_t nbits)
Definition: ir_RC5_RC6.hpp:284
IRsend::mark
void mark(uint16_t aMarkMicros)
Sends an IR mark for the specified number of microseconds.
Definition: IRSend.hpp:969
IRrecv::decodeDistanceWidth
bool decodeDistanceWidth()
Definition: ir_DistanceWidthProtocol.hpp:152
IRsend::sendSamsungLGRepeat
void sendSamsungLGRepeat()
Send repeat Repeat commands should be sent in a 110 ms raster.
Definition: ir_Samsung.hpp:118
disableLEDFeedbackForReceive
constexpr auto disableLEDFeedbackForReceive
Definition: IRremoteInt.h:364
IRsend::sendSamsung48
void sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats)
Here we send Samsung48 We send 2 x (8 bit command and then ~command)
Definition: ir_Samsung.hpp:213
IRsend::sendRC6
void sendRC6(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle=true)
Assemble raw data for RC6 from parameters and toggle state and send We do not wait for the minimal tr...
Definition: ir_RC5_RC6.hpp:350
decode_results::overflow
bool overflow
Definition: IRremoteInt.h:172
decode_type_t
decode_type_t
An enum consisting of all supported formats.
Definition: IRProtocol.h:40
IRrecv::restartAfterSend
void restartAfterSend()
Restarts receiver after send.
Definition: IRReceive.hpp:416
IRsend::customDelayMicroseconds
static void customDelayMicroseconds(unsigned long aMicroseconds)
Custom delay function that circumvents Arduino's delayMicroseconds 16 bit limit and is (mostly) not e...
Definition: IRSend.hpp:1173
IRsend::sendPulseDistanceWidth
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Sends PulseDistance frames and repeats and enables receiver again.
Definition: IRSend.hpp:702
IRrecv::IRrecv
IRrecv()
Instantiate the IRrecv class.
Definition: IRReceive.hpp:75
sBiphaseDecodeRawbuffOffset
uint_fast8_t sBiphaseDecodeRawbuffOffset
Definition: IRReceive.hpp:856
IRsend::IRsend
IRsend()
Definition: IRSend.hpp:67
IRrecv::decodeSharp
bool decodeSharp()
Definition: ir_Denon.hpp:151
IRrecv::blink13
void blink13(uint8_t aEnableLEDFeedback) __attribute__((deprecated("Please use setLEDFeedback() or enableLEDFeedback() / disableLEDFeedback().")))
Old deprecated function name for setLEDFeedback() or enableLEDFeedback() / disableLEDFeedback()
Definition: IRFeedbackLED.hpp:147
IRrecv::printIRResultAsCVariables
void printIRResultAsCVariables(Print *aSerial)
Print results as C variables to be used for sendXXX()
Definition: IRReceive.hpp:1661
irparams_struct::rawbuf
uint16_t rawbuf[RAW_BUFFER_LENGTH]
raw data / tick counts per mark/space, first entry is the length of the gap between previous and curr...
Definition: IRremoteInt.h:113
IRsend::sendWhynter
void sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend)
Definition: ir_Others.hpp:90
IRsend::sendDenonRaw
void sendDenonRaw(uint16_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS) void sendFAST(uint8_t aCommand
Definition: ir_Denon.hpp:249
IRsend::__attribute__
__attribute__((deprecated("This old function sends MSB first! Please use sendSamsung().")))
decode_results::bits
uint8_t bits
Definition: IRremoteInt.h:165
decode_results::decode_type
decode_type_t decode_type
Definition: IRremoteInt.h:162
matchTicks
bool matchTicks(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Match function without compensating for marks exceeded or spaces shortened by demodulator hardware Cu...
Definition: IRReceive.hpp:1056
irparams_struct::ReceiveCompleteCallbackFunction
void(* ReceiveCompleteCallbackFunction)(void)
The function to call if a protocol message has arrived, i.e. StateForISR changed to IR_REC_STATE_STOP...
Definition: IRremoteInt.h:105
IRrecv::begin
void begin(uint_fast8_t aReceivePin, bool aEnableLEDFeedback=false, uint_fast8_t aFeedbackLEDPin=USE_DEFAULT_FEEDBACK_LED_PIN)
Initializes the receive and feedback pin.
Definition: IRReceive.hpp:286
IRsend::sendRaw_P
void sendRaw_P(const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz)
New function using an 8 byte tick (50 us) timing array in FLASH to save program memory Raw data start...
Definition: IRSend.hpp:489
IRrecv::checkForRepeatSpaceTicksAndSetFlag
void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks)
Definition: IRReceive.hpp:1042
IRrecv::decodeSonyMSB
bool decodeSonyMSB(decode_results *aResults)
Definition: ir_Sony.hpp:154
IRsend
Main class for sending IR signals.
Definition: IRremoteInt.h:419
IRrecv::decodeSony
bool decodeSony()
Definition: ir_Sony.hpp:109
irparams_struct
This struct contains the data and control used for receiver static functions and the ISR (interrupt s...
Definition: IRremoteInt.h:95
matchSpace
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
Definition: IRReceive.hpp:1116
IRrecv::compensateAndPrintIRResultAsPronto
void compensateAndPrintIRResultAsPronto(Print *aSerial, uint16_t frequency=38000U)
Print the result (second argument) as Pronto Hex on the Print supplied as argument.
Definition: ir_Pronto.hpp:254
sendLG2SpecialRepeat
void sendLG2SpecialRepeat()
Static function for sending special repeat frame.
Definition: ir_LG.hpp:140
IRrecv::read
IRData * read()
If IR receiver data is available, returns pointer to IrReceiver.decodedIRData, else NULL.
Definition: IRReceive.hpp:508
IRrecv::getBiphaselevel
uint_fast8_t getBiphaselevel()
Gets the level of one time interval (aBiphaseTimeUnit) at a time from the raw buffer.
Definition: IRReceive.hpp:883
irparams_struct::rawlen
uint_fast8_t rawlen
counter of entries in rawbuf
Definition: IRremoteInt.h:109
IRrecv::decodePulseDistanceWidthData
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
Definition: IRReceive.hpp:845
IRrecv::decodeLGMSB
bool decodeLGMSB(decode_results *aResults)
Definition: ir_LG.hpp:290
IRsend::sendSamsung
void sendSamsung(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Here we send Samsung32 If we get a command < 0x100, we send command and then ~command If we get an ad...
Definition: ir_Samsung.hpp:167
decode_results::value
uint32_t value
Definition: IRremoteInt.h:164
IRsend::sendNEC2
void sendNEC2(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_NEC.hpp:185
DistanceWidthTimingInfoStruct
Definition: IRProtocol.h:78
MATCH_SPACE
bool MATCH_SPACE(uint16_t measured_ticks, uint16_t desired_us)
Definition: IRReceive.hpp:1142
IRrecv::decodeSAMSUNG
bool decodeSAMSUNG(decode_results *aResults)
Definition: ir_Samsung.hpp:343
IRrecv::decodeBangOlufsen
bool decodeBangOlufsen()
Definition: ir_BangOlufsen.hpp:290
IRrecv::decodeLegoPowerFunctions
bool decodeLegoPowerFunctions()
Definition: ir_Lego.hpp:127
irparams_struct::OverflowFlag
bool OverflowFlag
Raw buffer OverflowFlag occurred.
Definition: IRremoteInt.h:107
IRsend::sendRaw
void sendRaw(const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz)
Function using an 8 byte tick timing array to save program memory Raw data starts with a Mark.
Definition: IRSend.hpp:435
IRrecv::decodeFAST
bool decodeFAST()
Definition: ir_FAST.hpp:97
PulseDistanceWidthProtocolConstants
Definition: IRProtocol.h:132
IRrecv::decodePanasonicMSB
bool decodePanasonicMSB(decode_results *aResults)
IRrecv::decodedIRData
IRData decodedIRData
Definition: IRremoteInt.h:321
IRData
Data structure for the user application, available as decodedIRData.
Definition: IRProtocol.h:107
IRsend::sendLG2Repeat
void sendLG2Repeat()
Definition: ir_LG.hpp:129
IRsend::sendSamsung16BitAddressAndCommand
void sendSamsung16BitAddressAndCommand(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Maybe no one needs it in the wild...
Definition: ir_Samsung.hpp:198
IRrecv::decodeSamsung
bool decodeSamsung()
Definition: ir_Samsung.hpp:244
IRsend::sendSamsungLG
void sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_Samsung.hpp:145
IRsend::sendRC5ext
void sendRC5ext(uint8_t addr, uint8_t cmd, bool toggle)
Definition: ir_RC5_RC6.hpp:546
IRrecv::decodeBiPhaseData
bool decodeBiPhaseData(uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset, uint_fast8_t aStartClockCount, uint_fast8_t aValueOfSpaceToMarkTransition, uint16_t aBiphaseTimeUnit)
sendSamsungLGSpecialRepeat
void sendSamsungLGSpecialRepeat()
Like above, but implemented as a static function Used for sending special repeat frame.
Definition: ir_Samsung.hpp:132
disableLEDFeedback
void disableLEDFeedback()
Definition: IRFeedbackLED.hpp:89
IRrecv::printIRResultShort
bool printIRResultShort(Print *aSerial, bool aPrintRepeatGap=true, bool aCheckForRecordGapsMicros=true)
Function to print values and flags of IrReceiver.decodedIRData in one line.
Definition: IRReceive.hpp:1259
IRsend::sendBangOlufsenDataLink
void sendBangOlufsenDataLink(uint32_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats=NO_REPEATS, int8_t aNumberOfHeaderBits=8)
Definition: ir_BangOlufsen.hpp:154
MATCH
bool MATCH(uint16_t measured, uint16_t desired)
Definition: IRReceive.hpp:1076
IRsend::sendSharp
void sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_Denon.hpp:116
IRrecv::checkHeader
bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants)
Definition: IRReceive.hpp:1018
IRsend::sendKaseikyo
void sendKaseikyo(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode)
Address can be interpreted as sub-device << 4 + 4 bit device.
Definition: ir_Kaseikyo.hpp:132
IRrecv::compare
uint_fast8_t compare(uint16_t oldval, uint16_t newval)
Compare two (tick) values for Hash decoder Use a tolerance of 20% to enable e.g.
Definition: IRReceive.hpp:936
IRsend::begin
void begin(uint_fast8_t aSendPin)
Initializes the send pin and enable LED feedback with board specific FEEDBACK_LED_ON() and FEEDBACK_L...
Definition: IRSend.hpp:121
IRsend::sendNECMSB
void sendNECMSB(uint32_t data, uint8_t nbits, bool repeat=false)
With Send sendNECMSB() you can send your old 32 bit codes.
Definition: ir_NEC.hpp:414
IRsend::sendKaseikyo_JVC
void sendKaseikyo_JVC(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with JVC_VENDOR_ID_CODE.
Definition: ir_Kaseikyo.hpp:192
IRrecv::printActiveIRProtocols
static void printActiveIRProtocols(Print *aSerial)
Definition: IRReceive.hpp:1183
printActiveIRProtocols
void printActiveIRProtocols(Print *aSerial)
Definition: IRReceive.hpp:1187
IRsend::NumberOfRepeats
void nbits is deprecated and may not work as expected ! Use NumberOfRepeats
Definition: IRremoteInt.h:578
IRsend::computeLGRawDataAndChecksum
uint32_t computeLGRawDataAndChecksum(uint8_t aAddress, uint16_t aCommand)
Definition: ir_LG.hpp:147
IRsend::periodOnTimeMicros
uint16_t periodOnTimeMicros
Definition: IRremoteInt.h:618
IRReceiveTimerInterruptHandler
void IRReceiveTimerInterruptHandler()
Definition: IRReceive.hpp:127
IRrecv::restartTimer
void restartTimer()
Definition: IRReceive.hpp:368
IRrecv::restartTimerWithTicksToAdd
void restartTimerWithTicksToAdd(uint16_t aTicksToAddToGapCounter)
Definition: IRReceive.hpp:401
IRrecv::isIdle
bool isIdle()
Returns status of reception.
Definition: IRReceive.hpp:449
IRsend::sendPanasonic
void sendPanasonic(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with PANASONIC_VENDOR_ID_CODE.
Definition: ir_Kaseikyo.hpp:164
IRrecv::printDistanceWidthTimingInfo
void printDistanceWidthTimingInfo(Print *aSerial, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo)
Definition: IRReceive.hpp:1268
getMarkExcessMicros
int getMarkExcessMicros()
Getter function for MARK_EXCESS_MICROS.
Definition: IRReceive.hpp:1149
matchMark
bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
Definition: IRReceive.hpp:1083
IRrecv::compensateAndPrintIRResultAsCArray
void compensateAndPrintIRResultAsCArray(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks=true)
Dump out the IrReceiver.decodedIRData.rawDataPtr->rawbuf[] to be used as C definition for sendRaw().
Definition: IRReceive.hpp:1573
MATCH_MARK
bool MATCH_MARK(uint16_t measured_ticks, uint16_t desired_us)
Definition: IRReceive.hpp:1109
IRsend::getPulseCorrectionNanos
uint16_t getPulseCorrectionNanos()
Definition: IRSend.hpp:1258
IRsend::write
size_t write(IRData *aIRSendData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Interprets and sends a IRData structure.
Definition: IRSend.hpp:170
irparams_struct::TickCounterForISR
volatile uint_fast16_t TickCounterForISR
Counts 50uS ticks. The value is copied into the rawbuf array on every transition. Counting is indepen...
Definition: IRremoteInt.h:103
IRsend::sendDenon
void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp=false)
Definition: ir_Denon.hpp:120
irparams_struct::StateForISR
volatile uint8_t StateForISR
State Machine state.
Definition: IRremoteInt.h:97
IRrecv::setReceivePin
void setReceivePin(uint_fast8_t aReceivePinNumber)
Sets / changes the receiver pin number.
Definition: IRReceive.hpp:309
IRrecv::decodeDenonOld
bool decodeDenonOld(decode_results *aResults)
Definition: ir_Denon.hpp:280
IRRawDataType
uint32_t IRRawDataType
Definition: IRremoteInt.h:117
IRrecv::start
void start()
Start the receiving process.
Definition: IRReceive.hpp:350
IRrecv::compensateAndStoreIRResultInArray
void compensateAndStoreIRResultInArray(uint8_t *aArrayPtr)
Store the decodedIRData to be used for sendRaw().
Definition: IRReceive.hpp:1634
enableLEDFeedbackForSend
void enableLEDFeedbackForSend()
Definition: IRFeedbackLED.hpp:93
IRsend::computeNECRawDataAndChecksum
uint32_t computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand)
Definition: ir_NEC.hpp:153
IRrecv::printIRResultMinimal
void printIRResultMinimal(Print *aSerial)
Function to print protocol number, address, command, raw data and repeat flag of IrReceiver....
Definition: IRReceive.hpp:1430
IRrecv::initDecodedIRData
void initDecodedIRData()
Is internally called by decode before calling decoders.
Definition: IRReceive.hpp:468
IRsend::sendPronto
void sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Definition: ir_Pronto.hpp:190
decode_results::address
uint16_t address
Definition: IRremoteInt.h:163
IrSender
IRsend IrSender
Definition: IRSend.hpp:65
IRProtocol.h
Common declarations for receiving and sending.
IRrecv::addMicrosToInternalTickCounter
void addMicrosToInternalTickCounter(uint16_t aMicrosecondsToAddToInternalTickCounter)
Definition: IRReceive.hpp:410
IRsend::sendJVCMSB
void sendJVCMSB(unsigned long data, int nbits, bool repeat=false)
With Send sendJVCMSB() you can send your old 32 bit codes.
Definition: ir_JVC.hpp:242
IRrecv::lastDecodedCommand
uint32_t lastDecodedCommand
Definition: IRremoteInt.h:326
IRrecv::decodeRC5
bool decodeRC5()
Try to decode data as RC5 protocol.
Definition: ir_RC5_RC6.hpp:155
IRrecv::decodeBoseWave
bool decodeBoseWave()
Definition: ir_BoseWave.hpp:64
IRrecv::available
bool available()
Returns true if IR receiver data is available.
Definition: IRReceive.hpp:501
IRsend::periodTimeMicros
uint16_t periodTimeMicros
Definition: IRremoteInt.h:617
IRsend::space
static void space(uint16_t aSpaceMicros)
Sends an IR space for the specified number of microseconds.
Definition: IRSend.hpp:1165
IRrecv::decodeMagiQuest
bool decodeMagiQuest()
Definition: ir_MagiQuest.hpp:151
IRsend::sendRC5
void sendRC5(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle=true)
Definition: ir_RC5_RC6.hpp:103
enableLEDFeedbackForReceive
constexpr auto enableLEDFeedbackForReceive
Definition: IRremoteInt.h:362
decode_results::magnitude
uint16_t magnitude
Definition: IRremoteInt.h:166
IRrecv::initBiphaselevel
void initBiphaselevel(uint_fast8_t aRCDecodeRawbuffOffset, uint16_t aBiphaseTimeUnit)
Definition: IRReceive.hpp:861
IRrecv::end
void end()
Alias for stop().
Definition: IRReceive.hpp:441
IRsend::sendKaseikyo_Mitsubishi
void sendKaseikyo_Mitsubishi(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with MITSUBISHI_VENDOR_ID_CODE.
Definition: ir_Kaseikyo.hpp:178
IRrecv::decodeNECMSB
bool decodeNECMSB(decode_results *aResults)
Definition: ir_NEC.hpp:339
IRsend::sendBangOlufsenRawDataLink
void sendBangOlufsenRawDataLink(uint64_t aRawData, int_fast8_t aBits, bool aBackToBack=false, bool aUseDatalinkTiming=false)
Definition: ir_BangOlufsen.hpp:227
IRrecv::decodeNEC
bool decodeNEC()
Decodes also Onkyo and Apple.
Definition: ir_NEC.hpp:232
IRrecv::decodeHashOld
bool decodeHashOld(decode_results *aResults)
Definition: IRReceive.hpp:989
IRsend::sendNECRepeat
void sendNECRepeat()
Send special NEC repeat frame Repeat commands should be sent in a 110 ms raster.
Definition: ir_NEC.hpp:135
IRrecv::printIRSendUsage
void printIRSendUsage(Print *aSerial)
Function to print values and flags of IrReceiver.decodedIRData in one line.
Definition: IRReceive.hpp:1297
IRsend::sendSAMSUNG
void sendSAMSUNG(unsigned long data, int nbits)
Definition: ir_Samsung.hpp:385
IRsend::IRLedOff
void IRLedOff()
Just switch the IR sending LED off to send an IR space A space is "no output", so the PWM output is d...
Definition: IRSend.hpp:1132
IRsend::sendPulseDistanceWidthFromArray
void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros, uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats)
Definition: IRSend.hpp:549
sendFAST
void sendFAST(uint8_t aSendPin, uint16_t aCommand, uint_fast8_t aNumberOfRepeats=0)
Definition: TinyIRSender.hpp:294
IRrecv::decodeDenon
bool decodeDenon()
Definition: ir_Denon.hpp:155
IRrecv::decodeLG
bool decodeLG()
Definition: ir_LG.hpp:176
IRrecv::addTicksToInternalTickCounter
void addTicksToInternalTickCounter(uint16_t aTicksToAddToInternalTickCounter)
Definition: IRReceive.hpp:406
IRrecv::stopTimer
void stopTimer()
Definition: IRReceive.hpp:429
IRsend::sendPulseDistanceWidthData
void sendPulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits)
Sends PulseDistance data The output always ends with a space Each additional call costs 16 bytes prog...
Definition: IRSend.hpp:832
IRrecv::decode
bool decode()
The main decode function, attempts to decode the recently receive IR signal.
Definition: IRReceive.hpp:525
IRrecv::decodeJVC
bool decodeJVC()
Definition: ir_JVC.hpp:119
IRsend::sendSharpRaw
void sendSharpRaw(unsigned long data, int nbits)
RAW_BUFFER_LENGTH
#define RAW_BUFFER_LENGTH
The length of the buffer where the IR timing data is stored before decoding 100 is sufficient for mos...
Definition: IRremoteInt.h:74
IRrecv::lastDecodedAddress
uint32_t lastDecodedAddress
Definition: IRremoteInt.h:325
IRsend::sendOnkyo
void sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_NEC.hpp:195
IRrecv::decodeKaseikyo
bool decodeKaseikyo()
Definition: ir_Kaseikyo.hpp:199
IRsend::Command
void nbits is deprecated and may not work as expected ! Use Command
Definition: IRremoteInt.h:578
IRrecv::getTotalDurationOfRawData
uint32_t getTotalDurationOfRawData()
Definition: IRReceive.hpp:1282
IRsend::sendLegoPowerFunctions
void sendLegoPowerFunctions(uint8_t aChannel, uint8_t tCommand, uint8_t aMode, bool aDoSend5Times=true)
Definition: ir_Lego.hpp:96
USE_DEFAULT_FEEDBACK_LED_PIN
#define USE_DEFAULT_FEEDBACK_LED_PIN
Definition: IRremoteInt.h:64
decode_results::rawlen
uint_fast8_t rawlen
Definition: IRremoteInt.h:171
IRrecv::decodeRC6
bool decodeRC6()
Try to decode data as RC6 protocol.
Definition: ir_RC5_RC6.hpp:394
IRsend::sendBiphaseData
void sendBiphaseData(uint16_t aBiphaseTimeUnit, uint32_t aData, uint_fast8_t aNumberOfBits)
Sends Biphase data MSB first Always send start bit, do not send the trailing space of the start bit 0...
Definition: IRSend.hpp:909
IRrecv::getProtocolString
const char * getProtocolString()
Definition: IRReceive.hpp:1700
IRsend::sendLG
void sendLG(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
LG uses the NEC repeat.
Definition: ir_LG.hpp:165
IRsend::sendBangOlufsen
void sendBangOlufsen(uint16_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats=NO_REPEATS, int8_t aNumberOfHeaderBits=8)
Definition: ir_BangOlufsen.hpp:148
IRrecv::resume
void resume()
Restart the ISR (Interrupt Service Routine) state machine, to enable receiving of the next IR frame.
Definition: IRReceive.hpp:457
IRrecv::decodeShuzu
bool decodeShuzu()
Definition: ir_Template.hpp:139
IRrecv::startWithTicksToAdd
void startWithTicksToAdd(uint16_t aTicksToAddToGapCounter)
Definition: IRReceive.hpp:397
IRrecv::decode_old
bool decode_old(decode_results *aResults)
Definition: IRReceive.hpp:1713
IRsend::aCommand
void aCommand
Definition: IRremoteInt.h:582
IrReceiver
IRrecv IrReceiver
The receiver instance.
Definition: IRReceive.hpp:64
IRsend::enableIROut
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
Definition: IRSend.hpp:1205
IRsend::sendKaseikyo_Denon
void sendKaseikyo_Denon(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with DENON_VENDOR_ID_CODE.
Definition: ir_Kaseikyo.hpp:171
IRrecv::printIRResultRawFormatted
void printIRResultRawFormatted(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks=true)
Dump out the timings in IrReceiver.decodedIRData.rawDataPtr->rawbuf[] array 8 values per line.
Definition: IRReceive.hpp:1474
IRsend::sendLG2
void sendLG2(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
LG2 uses a special repeat.
Definition: ir_LG.hpp:172
decode_results::isRepeat
bool isRepeat
Definition: IRremoteInt.h:167
IRrecv::decodeJVCMSB
bool decodeJVCMSB(decode_results *aResults)
Definition: ir_JVC.hpp:177
sendNECSpecialRepeat
void sendNECSpecialRepeat()
Static function variant of IRsend::sendNECRepeat For use in ProtocolConstants.
Definition: ir_NEC.hpp:146
setLEDFeedback
void setLEDFeedback(uint8_t aFeedbackLEDPin, uint8_t aEnableLEDFeedback)
Enable blinking of feedback LED (LED_BUILTIN is taken as default) on IR sending and receiving Cannot ...
Definition: IRFeedbackLED.hpp:56
IRrecv::decodeWhynter
bool decodeWhynter()
Definition: ir_Others.hpp:94
IRrecv::repeatCount
uint8_t repeatCount
Definition: IRremoteInt.h:328
IRsend::sendNEC
void sendNEC(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
NEC Send frame and special repeats There is NO delay after the last sent repeat!
Definition: ir_NEC.hpp:176
irparams_struct::IRReceivePin
uint_fast8_t IRReceivePin
Pin connected to IR data from detector.
Definition: IRremoteInt.h:98