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 
75 #if !defined(RAW_BUFFER_LENGTH)
76 # if (defined(RAMEND) && RAMEND <= 0x8FF) || (defined(RAMSIZE) && RAMSIZE < 0x8FF)
77 // for RAMsize <= 2k
78 #define RAW_BUFFER_LENGTH 200
79 # else
80 // For undefined or bigger RAMsize
81 #define RAW_BUFFER_LENGTH 750 // The value for air condition remotes.
82 # endif
83 #endif
84 #if RAW_BUFFER_LENGTH % 2 == 1
85 #error RAW_BUFFER_LENGTH must be even, since the array consists of space / mark pairs.
86 #endif
87 
88 #if RAW_BUFFER_LENGTH <= 254 // saves around 75 bytes program memory and speeds up ISR
89 typedef uint_fast8_t IRRawlenType;
90 #else
91 typedef unsigned int IRRawlenType;
92 #endif
93 
94 /*
95  * Use 8 bit buffer for IR timing in 50 ticks units.
96  * It is save to use 8 bit if RECORD_GAP_TICKS < 256, since any value greater 255 is interpreted as frame gap of 12750 us.
97  * The default for frame gap is currently 8000!
98  * But if we assume that for most protocols the frame gap is way greater than the biggest mark or space duration,
99  * we can choose to use a 8 bit buffer even for frame gaps up to 200000 us.
100  * This enables the use of 8 bit buffer even for more some protocols like B&O or LG air conditioner etc.
101  */
102 #if RECORD_GAP_TICKS <= 400 // Corresponds to RECORD_GAP_MICROS of 200000. A value of 255 is foolproof, but we assume, that the frame gap is
103 typedef uint8_t IRRawbufType; // all timings up to the gap fit into 8 bit.
104 #else
105 typedef uint16_t IRRawbufType; // The gap does not fit into 8 bit ticks value. This must not be a reason to use 16 bit for buffer, but it is at least save.
106 #endif
107 
108 #if (__INT_WIDTH__ < 32)
109 typedef uint32_t IRRawDataType;
110 #define BITS_IN_RAW_DATA_TYPE 32
111 #else
112 typedef uint64_t IRRawDataType;
113 #define BITS_IN_RAW_DATA_TYPE 64
114 #endif
115 
116 /****************************************************
117  * Declarations for the receiver Interrupt Service Routine
118  ****************************************************/
119 // ISR State-Machine : Receiver States
120 #define IR_REC_STATE_IDLE 0 // Counting the gap time and waiting for the start bit to arrive
121 #define IR_REC_STATE_MARK 1 // A mark was received and we are counting the duration of it.
122 #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.
123 #define IR_REC_STATE_STOP 3 // Stopped until set to IR_REC_STATE_IDLE which can only be done by resume()
124 
130  // The fields are ordered to reduce memory overflow caused by struct-padding
131  volatile uint8_t StateForISR;
132  uint_fast8_t IRReceivePin;
133 #if defined(__AVR__)
134  volatile uint8_t *IRReceivePinPortInputRegister;
135  uint8_t IRReceivePinMask;
136 #endif
137  volatile uint_fast16_t TickCounterForISR;
138 #if !defined(IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK)
140 #endif
143  uint16_t initialGapTicks;
145 };
146 
147 #include "IRProtocol.h"
148 
149 /*
150  * Debug directives
151  * Outputs with IR_DEBUG_PRINT can only be activated by defining DEBUG!
152  * If LOCAL_DEBUG is defined in one file, all outputs with IR_DEBUG_PRINT are still suppressed.
153  */
154 #if defined(DEBUG) || defined(TRACE)
155 # define IR_DEBUG_PRINT(...) Serial.print(__VA_ARGS__)
156 # define IR_DEBUG_PRINTLN(...) Serial.println(__VA_ARGS__)
157 #else
158 
161 # define IR_DEBUG_PRINT(...) void()
162 
165 # define IR_DEBUG_PRINTLN(...) void()
166 #endif
167 
168 #if defined(TRACE)
169 # define IR_TRACE_PRINT(...) Serial.print(__VA_ARGS__)
170 # define IR_TRACE_PRINTLN(...) Serial.println(__VA_ARGS__)
171 #else
172 # define IR_TRACE_PRINT(...) void()
173 # define IR_TRACE_PRINTLN(...) void()
174 #endif
175 
176 /****************************************************
177  * RECEIVING
178  ****************************************************/
179 
184  decode_type_t decode_type; // deprecated, moved to decodedIRData.protocol ///< UNKNOWN, NEC, SONY, RC5, ...
185  uint16_t address; // Used by Panasonic & Sharp [16-bits]
186  uint32_t value; // deprecated, moved to decodedIRData.decodedRawData ///< Decoded value / command [max 32-bits]
187  uint8_t bits; // deprecated, moved to decodedIRData.numberOfBits ///< Number of bits in decoded value
188  uint16_t magnitude; // deprecated, moved to decodedIRData.extra ///< Used by MagiQuest [16-bits]
189  bool isRepeat; // deprecated, moved to decodedIRData.flags ///< True if repeat of value is detected
190 
191 // next 3 values are copies of irparams_struct values - see above
192  uint16_t *rawbuf; // deprecated, moved to decodedIRData.rawDataPtr->rawbuf ///< Raw intervals in 50uS ticks
193  uint_fast8_t rawlen; // deprecated, moved to decodedIRData.rawDataPtr->rawlen ///< Number of records in rawbuf
194  bool overflow; // deprecated, moved to decodedIRData.flags ///< true if IR raw code too long
195 };
196 
200 class IRrecv {
201 public:
202 
203  IRrecv();
204  IRrecv(uint_fast8_t aReceivePin);
205  IRrecv(uint_fast8_t aReceivePin, uint_fast8_t aFeedbackLEDPin);
206  void setReceivePin(uint_fast8_t aReceivePinNumber);
207 #if !defined(IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK)
208  void registerReceiveCompleteCallback(void (*aReceiveCompleteCallbackFunction)(void));
209 #endif
210 
211  /*
212  * Stream like API
213  */
214  void begin(uint_fast8_t aReceivePin, bool aEnableLEDFeedback = false, uint_fast8_t aFeedbackLEDPin =
216  void restartTimer();
217  void start();
218  void enableIRIn(); // alias for start
219  void start(uint32_t aMicrosecondsToAddToGapCounter);
220  void restartTimer(uint32_t aMicrosecondsToAddToGapCounter);
221  void startWithTicksToAdd(uint16_t aTicksToAddToGapCounter);
222  void restartTimerWithTicksToAdd(uint16_t aTicksToAddToGapCounter);
223  void restartAfterSend();
224 
225  void addTicksToInternalTickCounter(uint16_t aTicksToAddToInternalTickCounter);
226  void addMicrosToInternalTickCounter(uint16_t aMicrosecondsToAddToInternalTickCounter);
227 
228  bool available();
229  IRData* read(); // returns decoded data
230  // write is a method of class IRsend below
231  // size_t write(IRData *aIRSendData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
232  void stopTimer();
233  void stop();
234  void disableIRIn(); // alias for stop
235  void end(); // alias for stop
236 
237  bool isIdle();
238 
239  /*
240  * The main functions
241  */
242  bool decode(); // Check if available and try to decode
243  void resume(); // Enable receiving of the next value
244 
245  /*
246  * Useful info and print functions
247  */
248  void printIRResultMinimal(Print *aSerial);
249  void printIRResultRawFormatted(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks = true);
250  void printIRResultAsCVariables(Print *aSerial);
253  uint8_t getMaximumTicksFromRawData(bool aSearchSpaceInsteadOfMark);
254  uint32_t getTotalDurationOfRawData();
255 
256  /*
257  * Next 4 functions are also available as non member functions
258  */
259  bool printIRResultShort(Print *aSerial, bool aPrintRepeatGap = true, bool aCheckForRecordGapsMicros = true);
260  void printDistanceWidthTimingInfo(Print *aSerial, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo);
261  void printIRSendUsage(Print *aSerial);
262 #if defined(__AVR__)
263  const __FlashStringHelper* getProtocolString();
264 #else
265  const char* getProtocolString();
266 #endif
267  static void printActiveIRProtocols(Print *aSerial);
268 
269  void compensateAndPrintIRResultAsCArray(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks = true);
270  void compensateAndPrintIRResultAsPronto(Print *aSerial, uint16_t frequency = 38000U);
271 
272  /*
273  * Store the data for further processing
274  */
275  void compensateAndStoreIRResultInArray(uint8_t *aArrayPtr);
276  size_t compensateAndStorePronto(String *aString, uint16_t frequency = 38000U);
277 
278  /*
279  * The main decoding functions used by the individual decoders
280  */
281  bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits,
282  IRRawlenType aStartOffset = 3);
283 
284  bool decodePulseDistanceWidthData(uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint16_t aOneMarkMicros,
285  uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, bool aMSBfirst);
286 
287  bool decodePulseDistanceWidthData(uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint16_t aOneMarkMicros,
288  uint16_t aZeroMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroSpaceMicros, bool aMSBfirst)
289  __attribute__ ((deprecated ("Please use decodePulseDistanceWidthData() with 6 parameters.")));
290 
291  bool decodePulseDistanceWidthDataStrict(uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint16_t aOneMarkMicros,
292  uint16_t aZeroMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroSpaceMicros, bool aMSBfirst);
293 
294  bool decodeBiPhaseData(uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint_fast8_t aStartClockCount,
295  uint_fast8_t aValueOfSpaceToMarkTransition, uint16_t aBiphaseTimeUnit);
296 
297  void initBiphaselevel(uint_fast8_t aRCDecodeRawbuffOffset, uint16_t aBiphaseTimeUnit);
298  uint_fast8_t getBiphaselevel();
299 
300  /*
301  * All standard (decode address + command) protocol decoders
302  */
303  bool decodeBangOlufsen();
304  bool decodeBoseWave();
305  bool decodeDenon();
306  bool decodeFAST();
307  bool decodeJVC();
308  bool decodeKaseikyo();
310  bool decodeLG();
311  bool decodeMagiQuest(); // not completely standard
312  bool decodeNEC();
313  bool decodeRC5();
314  bool decodeRC6();
315  bool decodeSamsung();
316  bool decodeSharp(); // redirected to decodeDenon()
317  bool decodeSony();
318  bool decodeWhynter();
319 
320  bool decodeDistanceWidth();
321 
322  bool decodeHash();
323 
324  // Template function :-)
325  bool decodeShuzu();
326 
327  /*
328  * Old functions
329  */
330  bool decodeDenonOld(decode_results *aResults);
331  bool decodeJVCMSB(decode_results *aResults);
332  bool decodeLGMSB(decode_results *aResults);
333  bool decodeNECMSB(decode_results *aResults);
335  bool decodeSonyMSB(decode_results *aResults);
336  bool decodeSAMSUNG(decode_results *aResults);
337  bool decodeHashOld(decode_results *aResults);
338 
339  bool decode_old(decode_results *aResults);
340 
341  bool decode(
342  decode_results *aResults)
343  __attribute__ ((deprecated ("Please use IrReceiver.decode() without a parameter and IrReceiver.decodedIRData.<fieldname> .")));
344 
345  // for backward compatibility. Now in IRFeedbackLED.hpp
346  void blink13(uint8_t aEnableLEDFeedback)
347  __attribute__ ((deprecated ("Please use setLEDFeedback() or enableLEDFeedback() / disableLEDFeedback().")));
348 
349  /*
350  * Internal functions
351  */
352  void initDecodedIRData();
353  uint_fast8_t compare(uint16_t oldval, uint16_t newval);
354  bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants);
355  void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks);
356  bool checkForRecordGapsMicros(Print *aSerial);
357 
358  IRData decodedIRData; // Decoded IR data for the application
359 
360  // Last decoded IR data for repeat detection and parity for Denon autorepeat
364 
365  uint8_t repeatCount; // Used e.g. for Denon decode for autorepeat decoding.
366 };
367 
368 extern uint_fast8_t sBiphaseDecodeRawbuffOffset; //
369 
370 /*
371  * Mark & Space matching functions
372  */
373 bool matchTicks(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros);
374 bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros);
375 bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros);
376 
377 /*
378  * Old function names
379  */
380 bool MATCH(uint16_t measured, uint16_t desired);
381 bool MATCH_MARK(uint16_t measured_ticks, uint16_t desired_us);
382 bool MATCH_SPACE(uint16_t measured_ticks, uint16_t desired_us);
383 
384 int getMarkExcessMicros();
385 
386 void printActiveIRProtocols(Print *aSerial);
387 
388 /****************************************************
389  * Feedback LED related functions
390  ****************************************************/
391 #define DO_NOT_ENABLE_LED_FEEDBACK 0x00
392 #define LED_FEEDBACK_DISABLED_COMPLETELY 0x00
393 #define LED_FEEDBACK_ENABLED_FOR_RECEIVE 0x01
394 #define LED_FEEDBACK_ENABLED_FOR_SEND 0x02
395 void setFeedbackLED(bool aSwitchLedOn);
396 void setLEDFeedback(uint8_t aFeedbackLEDPin, uint8_t aEnableLEDFeedback); // if aFeedbackLEDPin == 0, then take board BLINKLED_ON() and BLINKLED_OFF() functions
397 void setLEDFeedback(bool aEnableLEDFeedback); // Direct replacement for blink13()
398 void enableLEDFeedback();
399 constexpr auto enableLEDFeedbackForReceive = enableLEDFeedback; // alias for enableLEDFeedback
400 void disableLEDFeedback();
401 constexpr auto disableLEDFeedbackForReceive = disableLEDFeedback; // alias for enableLEDFeedback
404 
405 void setBlinkPin(uint8_t aFeedbackLEDPin) __attribute__ ((deprecated ("Please use setLEDFeedback()."))); // deprecated
406 
407 /*
408  * Pulse parms are ((X*50)-MARK_EXCESS_MICROS) for the Mark and ((X*50)+MARK_EXCESS_MICROS) for the Space.
409  * First MARK is the one after the long gap
410  * Pulse parameters in microseconds
411  */
412 #if !defined(TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT)
413 #define TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT 25 // Relative tolerance (in percent) for matchTicks(), matchMark() and matchSpace() functions used for protocol decoding.
414 #endif
415 
416 #define TICKS(us) ((us)/MICROS_PER_TICK) // (us)/50
417 #if MICROS_PER_TICK == 50 && TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT == 25 // Defaults
418 #define TICKS_LOW(us) ((us)/67 ) // 67 = MICROS_PER_TICK / ((100-25)/100) = (MICROS_PER_TICK * 100) / (100-25)
419 #define TICKS_HIGH(us) (((us)/40) + 1) // 40 = MICROS_PER_TICK / ((100+25)/100) = (MICROS_PER_TICK * 100) / (100+25)
420 #else
421 
422 //#define LTOL (1.0 - (TOLERANCE/100.))
423 #define LTOL (100 - TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT)
424 
425 //#define UTOL (1.0 + (TOLERANCE/100.))
426 #define UTOL (100 + TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT)
427 #define TICKS_LOW(us) ((uint16_t ) ((long) (us) * LTOL / (MICROS_PER_TICK * 100) ))
428 #define TICKS_HIGH(us) ((uint16_t ) ((long) (us) * UTOL / (MICROS_PER_TICK * 100) + 1))
429 #endif
430 
431 /*
432  * The receiver instance
433  */
434 extern IRrecv IrReceiver;
435 
436 /*
437  * The receiver interrupt handler for timer interrupt
438  */
440 
441 /****************************************************
442  * SENDING
443  ****************************************************/
444 
448 #define NO_REPEATS 0
449 #define SEND_REPEAT_COMMAND true
450 
451 
454 class IRsend {
455 public:
456  IRsend();
457 
458  /*
459  * IR_SEND_PIN is defined or fixed by timer, value of IR_SEND_PIN is then "DeterminedByTimer"
460  */
461 #if defined(IR_SEND_PIN)
462  void begin();
463  // 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.
464  void begin(bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin); // 4.3.1 Removed default value USE_DEFAULT_FEEDBACK_LED_PIN for last parameter
465  // The next function is a dummy to avoid acceptance of pre 4.3 calls to begin(DISABLE_LED_FEEDBACK);
466  void begin(uint8_t aSendPin)
467 # if !defined (DOXYGEN)
468  __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.")));
469 # endif
470 
471  // The next function is a dummy to avoid acceptance of pre 4.0 calls to begin(IR_SEND_PIN, DISABLE_LED_FEEDBACK);
472  void begin(uint_fast8_t aSendPin, bool aEnableLEDFeedback)
473 # if !defined (DOXYGEN)
474  __attribute__ ((deprecated ("You must use begin() and enableLEDFeedback() or disableLEDFeedback() since version 4.3.")));
475 # endif
476 #else
477  IRsend(uint_fast8_t aSendPin);
478  void begin(uint_fast8_t aSendPin);
479  void setSendPin(uint_fast8_t aSendPin); // required if we use IRsend() as constructor
480  // Since 4.0 guarded and without default parameter
481  void begin(uint_fast8_t aSendPin, bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin); // aFeedbackLEDPin can be USE_DEFAULT_FEEDBACK_LED_PIN
482 #endif
483 
484  size_t write(IRData *aIRSendData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
485  size_t write(decode_type_t aProtocol, uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats = NO_REPEATS);
486 
487  void enableIROut(uint_fast8_t aFrequencyKHz);
488 #if defined(SEND_PWM_BY_TIMER)
489  void enableHighFrequencyIROut(uint_fast16_t aFrequencyKHz); // Used for Bang&Olufsen
490 #endif
491 
492  void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
493  uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
494  IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
495  int_fast8_t aNumberOfRepeats);
497  IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
498  void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo,
499  IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
500  int_fast8_t aNumberOfRepeats);
501 
503  uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
505  uint_fast8_t aNumberOfBits);
506  void sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
507  uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
508  IRRawDataType aData, uint_fast8_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
509  int_fast8_t aNumberOfRepeats, void (*aSpecialSendRepeatFunction)() = NULL);
510  void sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
511  uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
512  IRRawDataType aData, uint_fast8_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit, uint16_t aRepeatPeriodMillis,
513  int_fast8_t aNumberOfRepeats, void (*aSpecialSendRepeatFunction)() = NULL)
514  __attribute__ ((deprecated ("Since version 4.1.0 parameter aSendStopBit is not longer required.")));
515  void sendPulseDistanceWidthData(uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros,
516  uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, uint8_t aFlags);
517  void sendBiphaseData(uint16_t aBiphaseTimeUnit, uint32_t aData, uint_fast8_t aNumberOfBits);
518 
519  void mark(uint16_t aMarkMicros);
520  static void space(uint16_t aSpaceMicros);
521  void IRLedOff();
522 
523 // 8 Bit array
524  void sendRaw(const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
525  void sendRaw_P(const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
526 
527 // 16 Bit array
528  void sendRaw(const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
529  void sendRaw_P(const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
530 
531  /*
532  * New send functions
533  */
534  void sendBangOlufsen(uint16_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats = NO_REPEATS,
535  int8_t aNumberOfHeaderBits = 8);
536  void sendBangOlufsenDataLink(uint32_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats = NO_REPEATS,
537  int8_t aNumberOfHeaderBits = 8);
538  void sendBangOlufsenRaw(uint32_t aRawData, int_fast8_t aBits, bool aBackToBack = false);
539  void sendBangOlufsenRawDataLink(uint64_t aRawData, int_fast8_t aBits, bool aBackToBack = false,
540  bool aUseDatalinkTiming = false);
541  void sendBoseWave(uint8_t aCommand, int_fast8_t aNumberOfRepeats = NO_REPEATS);
542  void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp = false);
543  void sendDenonRaw(uint16_t aRawData, int_fast8_t aNumberOfRepeats = NO_REPEATS)
544 #if !defined (DOXYGEN)
545  __attribute__ ((deprecated ("Please use sendDenon(aAddress, aCommand, aNumberOfRepeats).")));
546 #endif
547  void sendFAST(uint8_t aCommand, int_fast8_t aNumberOfRepeats);
548  void sendJVC(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
549 
550  void sendLG2Repeat();
551  uint32_t computeLGRawDataAndChecksum(uint8_t aAddress, uint16_t aCommand);
552  void sendLG(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
553  void sendLG2(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
554  void sendLGRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
555 
556  void sendNECRepeat();
557  uint32_t computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand);
558  void sendNEC(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
559  void sendNEC2(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
560  void sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
561  // NEC variants
562  void sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
563  void sendApple(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
564 
565  void sendKaseikyo(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode); // LSB first
566  void sendPanasonic(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
567  void sendKaseikyo_Denon(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
568  void sendKaseikyo_Mitsubishi(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
569  void sendKaseikyo_Sharp(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
570  void sendKaseikyo_JVC(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats); // LSB first
571 
572  void sendRC5(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle = true);
573  void sendRC6(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle = true);
574  void sendSamsungLGRepeat();
575  void sendSamsung(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
576  void sendSamsung16BitAddressAnd8BitCommand(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
577  void sendSamsung16BitAddressAndCommand(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
578  void sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats);
579  void sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
580  void sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats); // redirected to sendDenon
581  void sendSony(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t numberOfBits = 12); // SIRCS_12_PROTOCOL
582 
583  void sendLegoPowerFunctions(uint8_t aChannel, uint8_t tCommand, uint8_t aMode, bool aDoSend5Times = true);
584  void sendLegoPowerFunctions(uint16_t aRawData, bool aDoSend5Times = true);
585  void sendLegoPowerFunctions(uint16_t aRawData, uint8_t aChannel, bool aDoSend5Times = true);
586 
587  void sendMagiQuest(uint32_t aWandId, uint16_t aMagnitude);
588 
589  void sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats = NO_REPEATS);
590  void sendPronto(const char *prontoHexString, int_fast8_t aNumberOfRepeats = NO_REPEATS);
591  void sendPronto(const uint16_t *data, uint16_t length, int_fast8_t aNumberOfRepeats = NO_REPEATS);
592 
593 #if defined(__AVR__)
594  void sendPronto_PF(uint_farptr_t str, int_fast8_t aNumberOfRepeats = NO_REPEATS);
595  void sendPronto_P(const char *str, int_fast8_t aNumberOfRepeats);
596 #endif
597 
598 // Template protocol :-)
599  void sendShuzu(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
600 
601  /*
602  * OLD send functions
603  */
604  void sendDenon(unsigned long data,
605  int nbits)
606  __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).")));
607  void sendDish(uint16_t aData);
608  void sendJVC(unsigned long data, int nbits,
609  bool repeat)
610  __attribute__ ((deprecated ("This old function sends MSB first! Please use sendJVC(aAddress, aCommand, aNumberOfRepeats)."))) {
611  sendJVCMSB(data, nbits, repeat);
612  }
613  void sendJVCMSB(unsigned long data, int nbits, bool repeat = false);
614 
615  void sendLG(unsigned long data,
616  int nbits)
617  __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).")));
618 
619  void sendNEC(uint32_t aRawData,
620  uint8_t nbits)
621  __attribute__ ((deprecated ("This old function sends MSB first! Please use sendNECMSB() or sendNEC(aAddress, aCommand, aNumberOfRepeats)."))) {
622  sendNECMSB(aRawData, nbits);
623  }
624  void sendNECMSB(uint32_t data, uint8_t nbits, bool repeat = false);
625  void sendRC5(uint32_t data, uint8_t nbits);
626  void sendRC5ext(uint8_t addr, uint8_t cmd, bool toggle);
627  void sendRC6Raw(uint32_t data, uint8_t nbits);
628  void sendRC6(uint32_t data, uint8_t nbits) __attribute__ ((deprecated ("Please use sendRC6Raw().")));
629  void sendRC6Raw(uint64_t data, uint8_t nbits);
630  void sendRC6(uint64_t data, uint8_t nbits) __attribute__ ((deprecated ("Please use sendRC6Raw().")));
631  ;
632  void sendSharpRaw(unsigned long data, int nbits);
633  void sendSharp(uint16_t address, uint16_t command);
634  void sendSAMSUNG(unsigned long data, int nbits);
635  __attribute__ ((deprecated ("This old function sends MSB first! Please use sendSamsung().")));
636  void sendSamsungMSB(unsigned long data, int nbits);
637  void sendSonyMSB(unsigned long data, int nbits);
638  void sendSony(unsigned long data,
639  int nbits)
640  __attribute__ ((deprecated ("This old function sends MSB first! Please use sendSony(aAddress, aCommand, aNumberOfRepeats).")));
641  ;
642  void sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend);
643 
644 #if !defined(IR_SEND_PIN)
645  uint8_t sendPin;
646 #endif
648  uint16_t periodOnTimeMicros; // compensated with PULSE_CORRECTION_NANOS for duration of digitalWrite. Around 8 microseconds for 38 kHz.
649  uint16_t getPulseCorrectionNanos();
650 
651  static void customDelayMicroseconds(unsigned long aMicroseconds);
652 };
653 
654 /*
655  * The sender instance
656  */
657 extern IRsend IrSender;
658 
659 void sendNECSpecialRepeat();
660 void sendLG2SpecialRepeat();
662 
663 #endif // _IR_REMOTE_INT_H
IRrecv::decodeHash
bool decodeHash()
decodeHash - decode an arbitrary IR code.
Definition: IRReceive.hpp:1072
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:183
decode_results::rawbuf
uint16_t * rawbuf
Definition: IRremoteInt.h:194
IRsend::sendApple
void sendApple(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Apple: Send NEC with fixed 16 bit Apple address 0x87EE.
Definition: ir_NEC.hpp:213
IRsend::sendMagiQuest
void sendMagiQuest(uint32_t aWandId, uint16_t aMagnitude)
Definition: ir_MagiQuest.hpp:121
IRsend::sendSamsungMSB
void sendSamsungMSB(unsigned long data, int nbits)
Definition: ir_Samsung.hpp:409
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)
Sends NEC protocol.
Definition: ir_NEC.hpp:231
IRrecv::stop
void stop()
Disables the timer for IR reception.
Definition: IRReceive.hpp:431
IRrecv::lastDecodedProtocol
decode_type_t lastDecodedProtocol
Definition: IRremoteInt.h:361
IRsend::aNumberOfRepeats
void int_fast8_t aNumberOfRepeats
Definition: IRremoteInt.h:547
IRrecv::decodeBiPhaseData
bool decodeBiPhaseData(uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint_fast8_t aStartClockCount, uint_fast8_t aValueOfSpaceToMarkTransition, uint16_t aBiphaseTimeUnit)
IRsend::sendPin
uint8_t sendPin
Definition: IRremoteInt.h:645
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:441
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
IRRawlenType
unsigned int IRRawlenType
Definition: IRremoteInt.h:91
IRrecv::enableIRIn
void enableIRIn()
Alias for start().
Definition: IRReceive.hpp:386
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:166
IRsend::setSendPin
void setSendPin(uint_fast8_t aSendPin)
Definition: IRSend.hpp:128
IRrecv::checkForRecordGapsMicros
bool checkForRecordGapsMicros(Print *aSerial)
Definition: IRReceive.hpp:1269
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:325
IRrecv::registerReceiveCompleteCallback
void registerReceiveCompleteCallback(void(*aReceiveCompleteCallbackFunction)(void))
Sets the function to call if a protocol message has arrived.
Definition: IRReceive.hpp:346
IRrecv
Main class for receiving IR signals.
Definition: IRremoteInt.h:200
NO_REPEATS
#define NO_REPEATS
Just for better readability of code.
Definition: IRremoteInt.h:448
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:947
IRrecv::decodeDistanceWidth
bool decodeDistanceWidth()
Definition: ir_DistanceWidthProtocol.hpp:197
IRsend::sendSamsungLGRepeat
void sendSamsungLGRepeat()
Send repeat Repeat commands should be sent in a 110 ms raster.
Definition: ir_Samsung.hpp:121
disableLEDFeedbackForReceive
constexpr auto disableLEDFeedbackForReceive
Definition: IRremoteInt.h:401
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:233
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:196
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:422
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:1156
IRsend::sendPulseDistanceWidth
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Sends PulseDistance frames and repeats.
Definition: IRSend.hpp:691
IRrecv::IRrecv
IRrecv()
Instantiate the IRrecv class.
Definition: IRReceive.hpp:70
sBiphaseDecodeRawbuffOffset
uint_fast8_t sBiphaseDecodeRawbuffOffset
Definition: IRReceive.hpp:965
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:1796
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:189
decode_results::decode_type
decode_type_t decode_type
Definition: IRremoteInt.h:186
matchTicks
bool matchTicks(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Match function without compensating for marks exceeded or spaces shortened by demodulator hardware.
Definition: IRReceive.hpp:1165
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:139
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:290
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:1150
IRrecv::decodeSonyMSB
bool decodeSonyMSB(decode_results *aResults)
Definition: ir_Sony.hpp:154
IRrecv::decodePulseDistanceWidthDataStrict
bool decodePulseDistanceWidthDataStrict(uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint16_t aOneMarkMicros, uint16_t aZeroMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroSpaceMicros, bool aMSBfirst)
Definition: IRReceive.hpp:827
IRsend
Main class for sending IR signals.
Definition: IRremoteInt.h:454
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:129
matchSpace
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
Definition: IRReceive.hpp:1227
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:257
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:509
IRrecv::getBiphaselevel
uint_fast8_t getBiphaselevel()
Gets the level of one time interval (aBiphaseTimeUnit) at a time from the raw buffer.
Definition: IRReceive.hpp:992
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:171
decode_results::value
uint32_t value
Definition: IRremoteInt.h:188
DistanceWidthTimingInfoStruct
Definition: IRProtocol.h:79
MATCH_SPACE
bool MATCH_SPACE(uint16_t measured_ticks, uint16_t desired_us)
Definition: IRReceive.hpp:1253
IRrecv::decodeSAMSUNG
bool decodeSAMSUNG(decode_results *aResults)
Definition: ir_Samsung.hpp:368
IRrecv::decodeBangOlufsen
bool decodeBangOlufsen()
Definition: ir_BangOlufsen.hpp:293
IRrecv::decodeLegoPowerFunctions
bool decodeLegoPowerFunctions()
Definition: ir_Lego.hpp:128
irparams_struct::OverflowFlag
bool OverflowFlag
Raw buffer OverflowFlag occurred.
Definition: IRremoteInt.h:141
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:98
PulseDistanceWidthProtocolConstants
Definition: IRProtocol.h:134
IRrecv::decodePanasonicMSB
bool decodePanasonicMSB(decode_results *aResults)
irparams_struct::rawlen
IRRawlenType rawlen
counter of entries in rawbuf
Definition: IRremoteInt.h:142
IRrecv::decodedIRData
IRData decodedIRData
Definition: IRremoteInt.h:358
IRData
Data structure for the user application, available as decodedIRData.
Definition: IRProtocol.h:108
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:219
IRrecv::decodeSamsung
bool decodeSamsung()
Definition: ir_Samsung.hpp:269
IRsend::sendSamsungLG
void sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_Samsung.hpp:148
IRsend::sendRC5ext
void sendRC5ext(uint8_t addr, uint8_t cmd, bool toggle)
Definition: ir_RC5_RC6.hpp:546
sendSamsungLGSpecialRepeat
void sendSamsungLGSpecialRepeat()
Like above, but implemented as a static function Used for sending special repeat frame.
Definition: ir_Samsung.hpp:135
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:1370
IRsend::sendBangOlufsenDataLink
void sendBangOlufsenDataLink(uint32_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats=NO_REPEATS, int8_t aNumberOfHeaderBits=8)
Definition: ir_BangOlufsen.hpp:157
MATCH
bool MATCH(uint16_t measured, uint16_t desired)
Definition: IRReceive.hpp:1185
IRsend::sendSharp
void sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_Denon.hpp:116
IRsend::sendPulseDistanceWidth
void sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros, uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats, void(*aSpecialSendRepeatFunction)()=NULL) __attribute__((deprecated("Since version 4.1.0 parameter aSendStopBit is not longer required.")))
IRrecv::checkHeader
bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants)
Definition: IRReceive.hpp:1126
IRrecv::decodePulseDistanceWidthData
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
Definition: IRReceive.hpp:954
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:1045
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:420
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:1294
printActiveIRProtocols
void printActiveIRProtocols(Print *aSerial)
Definition: IRReceive.hpp:1298
IRsend::sendNEC
void sendNEC(uint16_t aAddress, uint16_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:183
IRsend::NumberOfRepeats
void nbits is deprecated and may not work as expected ! Use NumberOfRepeats
Definition: IRremoteInt.h:606
IRsend::computeLGRawDataAndChecksum
uint32_t computeLGRawDataAndChecksum(uint8_t aAddress, uint16_t aCommand)
Definition: ir_LG.hpp:147
IRsend::periodOnTimeMicros
uint16_t periodOnTimeMicros
Definition: IRremoteInt.h:648
IRReceiveTimerInterruptHandler
void IRReceiveTimerInterruptHandler()
Definition: IRReceive.hpp:122
IRrecv::getMaximumTicksFromRawData
uint8_t getMaximumTicksFromRawData(bool aSearchSpaceInsteadOfMark)
Definition: IRReceive.hpp:1421
IRrecv::restartTimer
void restartTimer()
Definition: IRReceive.hpp:374
IRrecv::restartTimerWithTicksToAdd
void restartTimerWithTicksToAdd(uint16_t aTicksToAddToGapCounter)
Definition: IRReceive.hpp:407
IRrecv::isIdle
bool isIdle()
Returns status of reception.
Definition: IRReceive.hpp:455
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:1379
getMarkExcessMicros
int getMarkExcessMicros()
Getter function for MARK_EXCESS_MICROS.
Definition: IRReceive.hpp:1260
matchMark
bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
Definition: IRReceive.hpp:1193
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:1717
MATCH_MARK
bool MATCH_MARK(uint16_t measured_ticks, uint16_t desired_us)
Definition: IRReceive.hpp:1219
IRsend::getPulseCorrectionNanos
uint16_t getPulseCorrectionNanos()
Definition: IRSend.hpp:1241
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:137
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:131
IRrecv::setReceivePin
void setReceivePin(uint_fast8_t aReceivePinNumber)
Sets / changes the receiver pin number.
Definition: IRReceive.hpp:313
irparams_struct::rawbuf
IRRawbufType rawbuf[RAW_BUFFER_LENGTH]
raw data / tick counts per mark/space. With 8 bit we can only store up to 12.7 ms....
Definition: IRremoteInt.h:144
IRrecv::decodeDenonOld
bool decodeDenonOld(decode_results *aResults)
Definition: ir_Denon.hpp:280
IRRawDataType
uint32_t IRRawDataType
Definition: IRremoteInt.h:109
IRrecv::start
void start()
Start the receiving process.
Definition: IRReceive.hpp:356
IRrecv::compensateAndStoreIRResultInArray
void compensateAndStoreIRResultInArray(uint8_t *aArrayPtr)
Store the decodedIRData to be used for sendRaw().
Definition: IRReceive.hpp:1773
enableLEDFeedbackForSend
void enableLEDFeedbackForSend()
Definition: IRFeedbackLED.hpp:93
IRsend::computeNECRawDataAndChecksum
uint32_t computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand)
Convert 16 bit address and 16 bit command to 32 bit NECRaw data If we get a command < 0x100,...
Definition: ir_NEC.hpp:160
IRrecv::printIRResultMinimal
void printIRResultMinimal(Print *aSerial)
Function to print protocol number, address, command, raw data and repeat flag of IrReceiver....
Definition: IRReceive.hpp:1580
IRrecv::initDecodedIRData
void initDecodedIRData()
Is internally called by decode before calling decoders.
Definition: IRReceive.hpp:474
IRsend::sendPronto
void sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Definition: ir_Pronto.hpp:193
decode_results::address
uint16_t address
Definition: IRremoteInt.h:187
IRrecv::getMaximumMarkTicksFromRawData
uint8_t getMaximumMarkTicksFromRawData()
Definition: IRReceive.hpp:1397
IrSender
IRsend IrSender
Definition: IRSend.hpp:65
IRProtocol.h
Common declarations for receiving and sending.
IRsend::sendSamsung16BitAddressAnd8BitCommand
void sendSamsung16BitAddressAnd8BitCommand(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Maybe no one needs it in the wild...
Definition: ir_Samsung.hpp:202
IRrecv::addMicrosToInternalTickCounter
void addMicrosToInternalTickCounter(uint16_t aMicrosecondsToAddToInternalTickCounter)
Definition: IRReceive.hpp:416
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:363
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
IRsend::sendSonyMSB
void sendSonyMSB(unsigned long data, int nbits)
Old version with MSB first data.
Definition: ir_Sony.hpp:216
IRrecv::available
bool available()
Returns true if IR receiver data is available.
Definition: IRReceive.hpp:502
IRsend::periodTimeMicros
uint16_t periodTimeMicros
Definition: IRremoteInt.h:647
IRsend::space
static void space(uint16_t aSpaceMicros)
Sends an IR space for the specified number of microseconds.
Definition: IRSend.hpp:1148
IRrecv::getMaximumSpaceTicksFromRawData
uint8_t getMaximumSpaceTicksFromRawData()
Definition: IRReceive.hpp:1407
IRrecv::decodeMagiQuest
bool decodeMagiQuest()
Definition: ir_MagiQuest.hpp:154
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:399
decode_results::magnitude
uint16_t magnitude
Definition: IRremoteInt.h:190
IRrecv::initBiphaselevel
void initBiphaselevel(uint_fast8_t aRCDecodeRawbuffOffset, uint16_t aBiphaseTimeUnit)
Definition: IRReceive.hpp:970
IRsend::sendNEC2
void sendNEC2(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
NEC2 Send frame !!! and repeat the frame for each requested repeat !!! There is NO delay after the la...
Definition: ir_NEC.hpp:201
IRrecv::end
void end()
Alias for stop().
Definition: IRReceive.hpp:447
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:345
IRsend::sendBangOlufsenRawDataLink
void sendBangOlufsenRawDataLink(uint64_t aRawData, int_fast8_t aBits, bool aBackToBack=false, bool aUseDatalinkTiming=false)
Definition: ir_BangOlufsen.hpp:230
IRrecv::decodeNEC
bool decodeNEC()
Decodes also Onkyo and Apple.
Definition: ir_NEC.hpp:238
IRrecv::decodeHashOld
bool decodeHashOld(decode_results *aResults)
Definition: IRReceive.hpp:1097
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:1455
IRRawbufType
uint8_t IRRawbufType
Definition: IRremoteInt.h:103
IRsend::sendSAMSUNG
void sendSAMSUNG(unsigned long data, int nbits)
Definition: ir_Samsung.hpp:421
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:1113
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:535
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:412
IRrecv::stopTimer
void stopTimer()
Definition: IRReceive.hpp:435
IRsend::sendPulseDistanceWidthData
void sendPulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits)
Sends PulseDistance from data contained in parameter using ProtocolConstants structure for timing etc...
Definition: IRSend.hpp:812
IRrecv::decode
bool decode()
The main decode function, attempts to decode the recently receive IR signal.
Definition: IRReceive.hpp:526
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 RAW_BUFFER_LENGTH determines the length of the byte buffer where the received IR timing data is s...
Definition: IRremoteInt.h:81
IRrecv::lastDecodedAddress
uint32_t lastDecodedAddress
Definition: IRremoteInt.h:362
IRsend::sendOnkyo
void sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
There is NO delay after the last sent repeat!
Definition: ir_NEC.hpp:192
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:606
IRrecv::getTotalDurationOfRawData
uint32_t getTotalDurationOfRawData()
Definition: IRReceive.hpp:1438
IRsend::sendLegoPowerFunctions
void sendLegoPowerFunctions(uint8_t aChannel, uint8_t tCommand, uint8_t aMode, bool aDoSend5Times=true)
Definition: ir_Lego.hpp:97
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:195
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:887
IRrecv::getProtocolString
const char * getProtocolString()
Definition: IRReceive.hpp:1835
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:151
IRrecv::resume
void resume()
Restart the ISR (Interrupt Service Routine) state machine, to enable receiving of the next IR frame.
Definition: IRReceive.hpp:463
IRrecv::decodeShuzu
bool decodeShuzu()
Definition: ir_Template.hpp:139
IRrecv::startWithTicksToAdd
void startWithTicksToAdd(uint16_t aTicksToAddToGapCounter)
Definition: IRReceive.hpp:403
IRrecv::decode_old
bool decode_old(decode_results *aResults)
Definition: IRReceive.hpp:1848
IRsend::aCommand
void aCommand
Definition: IRremoteInt.h:610
IrReceiver
IRrecv IrReceiver
The receiver instance.
Definition: IRReceive.hpp:59
IRsend::enableIROut
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
Definition: IRSend.hpp:1188
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:1624
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:191
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:365
irparams_struct::IRReceivePin
uint_fast8_t IRReceivePin
Pin connected to IR data from detector.
Definition: IRremoteInt.h:132
irparams_struct::initialGapTicks
uint16_t initialGapTicks
Tick counts of the length of the gap between previous and current IR frame. Pre 4....
Definition: IRremoteInt.h:143