IRremote
IRremote.hpp File Reference

Public API to the library. More...

#include "IRremoteInt.h"
#include "digitalWriteFast.h"
#include "private/IRTimer.hpp"
#include "IRFeedbackLED.hpp"
#include "IRReceive.hpp"
#include "IRSend.hpp"
#include "ir_BoseWave.hpp"
#include "ir_Denon.hpp"
#include "ir_DistanceProtocol.hpp"
#include "ir_JVC.hpp"
#include "ir_Kaseikyo.hpp"
#include "ir_Lego.hpp"
#include "ir_LG.hpp"
#include "ir_MagiQuest.hpp"
#include "ir_NEC.hpp"
#include "ir_RC5_RC6.hpp"
#include "ir_Samsung.hpp"
#include "ir_Sony.hpp"
#include "ir_Whynter.hpp"
#include "ir_Pronto.hpp"
#include "ir_Dish.hpp"
Include dependency graph for IRremote.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VERSION_IRREMOTE   "3.8.0"
 
#define VERSION_IRREMOTE_MAJOR   3
 
#define VERSION_IRREMOTE_MINOR   8
 
#define VERSION_IRREMOTE_PATCH   0
 
#define VERSION_HEX_VALUE(major, minor, patch)   ((major << 16) | (minor << 8) | (patch))
 
#define VERSION_IRREMOTE_HEX   VERSION_HEX_VALUE(VERSION_IRREMOTE_MAJOR, VERSION_IRREMOTE_MINOR, VERSION_IRREMOTE_PATCH)
 
#define DECODE_DENON
 
#define DECODE_JVC
 
#define DECODE_KASEIKYO
 
#define DECODE_PANASONIC
 
#define DECODE_LG
 
#define DECODE_NEC
 
#define DECODE_SAMSUNG
 
#define DECODE_SONY
 
#define DECODE_RC5
 
#define DECODE_RC6
 
#define DECODE_BOSEWAVE
 
#define DECODE_LEGO_PF
 
#define DECODE_MAGIQUEST
 
#define DECODE_WHYNTER
 
#define DECODE_DISTANCE
 
#define DECODE_HASH
 
#define RAW_BUFFER_LENGTH   112
 The length of the buffer where the IR timing data is stored before decoding 100 is sufficient for most standard protocols, but air conditioners often send a longer protocol data stream. More...
 
#define MARK_EXCESS_MICROS   20
 MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding, to compensate for the signal forming of different IR receiver modules For Vishay TSOP*, marks tend to be too long and spaces tend to be too short. More...
 
#define RECORD_GAP_MICROS   5000
 Minimum gap between IR transmissions, to detect the end of a protocol. More...
 
#define RECORD_GAP_MICROS_WARNING_THRESHOLD   20000
 Threshold for warnings at printIRResult*() to report about changing the RECORD_GAP_MICROS value to a higher value. More...
 
#define RECORD_GAP_TICKS   (RECORD_GAP_MICROS / MICROS_PER_TICK)
 Minimum gap between IR transmissions, in MICROS_PER_TICK. More...
 
#define INPUT_MARK   0
 Sensor output for a mark ("flash") More...
 
#define PULSE_CORRECTION_NANOS   600
 Define to disable carrier PWM generation in software and use (restricted) hardware PWM. More...
 
#define IR_SEND_DUTY_CYCLE_PERCENT   30
 Duty cycle in percent for sent signals. More...
 
#define MICROS_PER_TICK   50
 microseconds per clock interrupt tick More...
 
#define MILLIS_IN_ONE_SECOND   1000L
 
#define MICROS_IN_ONE_SECOND   1000000L
 
#define MICROS_IN_ONE_MILLI   1000L
 
#define RAWBUF   101
 Macros for legacy compatibility. More...
 
#define REPEAT   0xFFFFFFFF
 
#define USECPERTICK   MICROS_PER_TICK
 
#define MARK_EXCESS   MARK_EXCESS_MICROS
 

Detailed Description

Public API to the library.

!!! All the macro values defined here can be overwritten with values, !!!
!!! the user defines in its source code BEFORE the #include <IRremote.hpp> !!!

This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.

MIT License

Copyright (c) 2015-2022 Ken Shirriff http://www.righto.com, Rafi Khan, Armin Joachimsmeyer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For Ken Shiriffs original blog entry, see http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html Initially influenced by: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556 and http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/

Definition in file IRremote.hpp.

Macro Definition Documentation

◆ DECODE_BOSEWAVE

#define DECODE_BOSEWAVE

Definition at line 119 of file IRremote.hpp.

◆ DECODE_DENON

#define DECODE_DENON

Definition at line 107 of file IRremote.hpp.

◆ DECODE_DISTANCE

#define DECODE_DISTANCE

Definition at line 126 of file IRremote.hpp.

◆ DECODE_HASH

#define DECODE_HASH

Definition at line 127 of file IRremote.hpp.

◆ DECODE_JVC

#define DECODE_JVC

Definition at line 108 of file IRremote.hpp.

◆ DECODE_KASEIKYO

#define DECODE_KASEIKYO

Definition at line 109 of file IRremote.hpp.

◆ DECODE_LEGO_PF

#define DECODE_LEGO_PF

Definition at line 120 of file IRremote.hpp.

◆ DECODE_LG

#define DECODE_LG

Definition at line 111 of file IRremote.hpp.

◆ DECODE_MAGIQUEST

#define DECODE_MAGIQUEST

Definition at line 121 of file IRremote.hpp.

◆ DECODE_NEC

#define DECODE_NEC

Definition at line 112 of file IRremote.hpp.

◆ DECODE_PANASONIC

#define DECODE_PANASONIC

Definition at line 110 of file IRremote.hpp.

◆ DECODE_RC5

#define DECODE_RC5

Definition at line 115 of file IRremote.hpp.

◆ DECODE_RC6

#define DECODE_RC6

Definition at line 116 of file IRremote.hpp.

◆ DECODE_SAMSUNG

#define DECODE_SAMSUNG

Definition at line 113 of file IRremote.hpp.

◆ DECODE_SONY

#define DECODE_SONY

Definition at line 114 of file IRremote.hpp.

◆ DECODE_WHYNTER

#define DECODE_WHYNTER

Definition at line 122 of file IRremote.hpp.

◆ INPUT_MARK

#define INPUT_MARK   0

Sensor output for a mark ("flash")

Definition at line 208 of file IRremote.hpp.

◆ IR_SEND_DUTY_CYCLE_PERCENT

#define IR_SEND_DUTY_CYCLE_PERCENT   30

Duty cycle in percent for sent signals.

Definition at line 268 of file IRremote.hpp.

◆ MARK_EXCESS

#define MARK_EXCESS   MARK_EXCESS_MICROS

Definition at line 361 of file IRremote.hpp.

◆ MARK_EXCESS_MICROS

#define MARK_EXCESS_MICROS   20

MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding, to compensate for the signal forming of different IR receiver modules For Vishay TSOP*, marks tend to be too long and spaces tend to be too short.

If you set MARK_EXCESS_MICROS to approx. 50us then the TSOP4838 works best. At 100us it also worked, but not as well. Set MARK_EXCESS to 100us and the VS1838 doesn't work at all.

The right value is critical for IR codes using short pulses like Denon / Sharp / Lego

Observed values: Delta of each signal type is around 50 up to 100 and at low signals up to 200. TSOP is better, especially at low IR signal level. VS1838 Mark Excess -50 to +50 us TSOP31238 Mark Excess 0 to +50

Definition at line 175 of file IRremote.hpp.

◆ MICROS_IN_ONE_MILLI

#define MICROS_IN_ONE_MILLI   1000L

Definition at line 280 of file IRremote.hpp.

◆ MICROS_IN_ONE_SECOND

#define MICROS_IN_ONE_SECOND   1000000L

Definition at line 279 of file IRremote.hpp.

◆ MICROS_PER_TICK

#define MICROS_PER_TICK   50

microseconds per clock interrupt tick

Definition at line 275 of file IRremote.hpp.

◆ MILLIS_IN_ONE_SECOND

#define MILLIS_IN_ONE_SECOND   1000L

Definition at line 278 of file IRremote.hpp.

◆ PULSE_CORRECTION_NANOS

#define PULSE_CORRECTION_NANOS   600

Define to disable carrier PWM generation in software and use (restricted) hardware PWM.

Define to use no carrier PWM, just simulate an active low receiver signal. Define to use or simulate open drain output mode at send pin. Attention, active state of open drain is LOW, so connect the send LED between positive supply and send pin! This amount is subtracted from the on-time of the pulses generated for software PWM generation. It should be the time used for digitalWrite(sendPin, LOW) and the call to delayMicros() Measured value for Nano @16MHz is around 3000, for Bluepill @72MHz is around 700, for Zero 3600

Definition at line 260 of file IRremote.hpp.

◆ RAW_BUFFER_LENGTH

#define RAW_BUFFER_LENGTH   112

The length of the buffer where the IR timing data is stored before decoding 100 is sufficient for most standard protocols, but air conditioners often send a longer protocol data stream.

Definition at line 148 of file IRremote.hpp.

◆ RAWBUF

#define RAWBUF   101

Macros for legacy compatibility.

Definition at line 358 of file IRremote.hpp.

◆ RECORD_GAP_MICROS

#define RECORD_GAP_MICROS   5000

Minimum gap between IR transmissions, to detect the end of a protocol.

Must be greater than any space of a protocol e.g. the NEC header space of 4500 us. Must be smaller than any gap between a command and a repeat; e.g. the retransmission gap for Sony is around 24 ms. Keep in mind, that this is the delay between the end of the received command and the start of decoding.

Definition at line 186 of file IRremote.hpp.

◆ RECORD_GAP_MICROS_WARNING_THRESHOLD

#define RECORD_GAP_MICROS_WARNING_THRESHOLD   20000

Threshold for warnings at printIRResult*() to report about changing the RECORD_GAP_MICROS value to a higher value.

Definition at line 193 of file IRremote.hpp.

◆ RECORD_GAP_TICKS

#define RECORD_GAP_TICKS   (RECORD_GAP_MICROS / MICROS_PER_TICK)

Minimum gap between IR transmissions, in MICROS_PER_TICK.

Definition at line 197 of file IRremote.hpp.

◆ REPEAT

#define REPEAT   0xFFFFFFFF

Definition at line 359 of file IRremote.hpp.

◆ USECPERTICK

#define USECPERTICK   MICROS_PER_TICK

Definition at line 360 of file IRremote.hpp.

◆ VERSION_HEX_VALUE

#define VERSION_HEX_VALUE (   major,
  minor,
  patch 
)    ((major << 16) | (minor << 8) | (patch))

Definition at line 78 of file IRremote.hpp.

◆ VERSION_IRREMOTE

#define VERSION_IRREMOTE   "3.8.0"

Definition at line 69 of file IRremote.hpp.

◆ VERSION_IRREMOTE_HEX

Definition at line 79 of file IRremote.hpp.

◆ VERSION_IRREMOTE_MAJOR

#define VERSION_IRREMOTE_MAJOR   3

Definition at line 70 of file IRremote.hpp.

◆ VERSION_IRREMOTE_MINOR

#define VERSION_IRREMOTE_MINOR   8

Definition at line 71 of file IRremote.hpp.

◆ VERSION_IRREMOTE_PATCH

#define VERSION_IRREMOTE_PATCH   0

Definition at line 72 of file IRremote.hpp.