IRremote
IRremoteInt.h File Reference

Contains all declarations required for the interface to IRremote. Could not be named IRremote.h, since this has another semantic (it must include all *.hpp files) for old example code found in the wild. More...

#include <Arduino.h>
#include "IRProtocol.h"
Include dependency graph for IRremoteInt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  irparams_struct
 This struct contains the data and control used for receiver static functions and the ISR (interrupt service routine) Only StateForISR needs to be volatile. More...
 
struct  decode_results
 Results returned from old decoders !!!deprecated!!! More...
 
class  IRrecv
 Main class for receiving IR signals. More...
 
class  IRsend
 Main class for sending IR signals. More...
 

Macros

#define MARK   1
 
#define SPACE   0
 
#define DISABLE_LED_FEEDBACK   false
 For better readability of code. More...
 
#define ENABLE_LED_FEEDBACK   true
 
#define USE_DEFAULT_FEEDBACK_LED_PIN   0
 
#define RAW_BUFFER_LENGTH   100
 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 IR_REC_STATE_IDLE   0
 
#define IR_REC_STATE_MARK   1
 
#define IR_REC_STATE_SPACE   2
 
#define IR_REC_STATE_STOP   3
 
#define IR_DEBUG_PRINT(...)   void()
 If DEBUG, print the arguments, otherwise do nothing. More...
 
#define IR_DEBUG_PRINTLN(...)   void()
 If DEBUG, print the arguments as a line, otherwise do nothing. More...
 
#define IR_TRACE_PRINT(...)   void()
 
#define IR_TRACE_PRINTLN(...)   void()
 
#define DO_NOT_ENABLE_LED_FEEDBACK   0x00
 
#define LED_FEEDBACK_DISABLED_COMPLETELY   0x00
 
#define LED_FEEDBACK_ENABLED_FOR_RECEIVE   0x01
 
#define LED_FEEDBACK_ENABLED_FOR_SEND   0x02
 
#define TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING   25
 
#define LTOL   (100 - TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING)
 Lower tolerance for comparison of measured data. More...
 
#define UTOL   (100 + TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING)
 Upper tolerance for comparison of measured data. More...
 
#define TICKS_LOW(us)   ((unsigned int ) ((long) (us) * LTOL / (MICROS_PER_TICK * 100) ))
 
#define TICKS_HIGH(us)   ((unsigned int ) ((long) (us) * UTOL / (MICROS_PER_TICK * 100) + 1))
 
#define NO_REPEATS   0
 Just for better readability of code. More...
 
#define SEND_STOP_BIT   true
 
#define SEND_NO_STOP_BIT   false
 
#define SEND_REPEAT_COMMAND   true
 used for e.g. NEC, where a repeat is different from just repeating the data. More...
 

Typedefs

typedef uint32_t IRRawDataType
 

Functions

bool matchTicks (unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
 Match function without compensating for marks exceeded or spaces shortened by demodulator hardware Currently not used. More...
 
bool matchMark (unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
 Compensate for marks exceeded by demodulator hardware. More...
 
bool matchSpace (unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
 Compensate for spaces shortened by demodulator hardware. More...
 
bool MATCH (unsigned int measured, unsigned int desired)
 
bool MATCH_MARK (unsigned int measured_ticks, unsigned int desired_us)
 
bool MATCH_SPACE (unsigned int measured_ticks, unsigned int desired_us)
 
int getMarkExcessMicros ()
 Getter function for MARK_EXCESS_MICROS. More...
 
void printActiveIRProtocols (Print *aSerial)
 
void setFeedbackLED (bool aSwitchLedOn)
 Flash LED while receiving or sending IR data. More...
 
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 disable it here!!! Use disableLEDFeedbackForReceive() or disableLEDFeedbackForSend() More...
 
void setLEDFeedback (bool aEnableLEDFeedback)
 
void enableLEDFeedback ()
 
void disableLEDFeedback ()
 
void enableLEDFeedbackForSend ()
 
void disableLEDFeedbackForSend ()
 
void setBlinkPin (uint8_t aFeedbackLEDPin) __attribute__((deprecated("Please use setLEDFeedback().")))
 Old deprecated function name for setLEDFeedback() More...
 
void sendNECSpecialRepeat ()
 Static function for sending special repeat frame. More...
 
void sendLG2SpecialRepeat ()
 Static function for sending special repeat frame. More...
 
void sendSamsungLGSpecialRepeat ()
 Static function for sending special repeat frame. More...
 

Variables

uint_fast8_t sBiphaseDecodeRawbuffOffset
 
constexpr auto enableLEDFeedbackForReceive = enableLEDFeedback
 
constexpr auto disableLEDFeedbackForReceive = disableLEDFeedback
 
IRrecv IrReceiver
 The receiver instance. More...
 
IRsend IrSender
 

Detailed Description

Contains all declarations required for the interface to IRremote. Could not be named IRremote.h, since this has another semantic (it must include all *.hpp files) for old example code found in the wild.

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.

Definition in file IRremoteInt.h.

Macro Definition Documentation

◆ DISABLE_LED_FEEDBACK

#define DISABLE_LED_FEEDBACK   false

For better readability of code.

Definition at line 63 of file IRremoteInt.h.

◆ DO_NOT_ENABLE_LED_FEEDBACK

#define DO_NOT_ENABLE_LED_FEEDBACK   0x00

Definition at line 339 of file IRremoteInt.h.

◆ ENABLE_LED_FEEDBACK

#define ENABLE_LED_FEEDBACK   true

Definition at line 64 of file IRremoteInt.h.

◆ IR_DEBUG_PRINT

#define IR_DEBUG_PRINT (   ...)    void()

If DEBUG, print the arguments, otherwise do nothing.

Definition at line 134 of file IRremoteInt.h.

◆ IR_DEBUG_PRINTLN

#define IR_DEBUG_PRINTLN (   ...)    void()

If DEBUG, print the arguments as a line, otherwise do nothing.

Definition at line 138 of file IRremoteInt.h.

◆ IR_REC_STATE_IDLE

#define IR_REC_STATE_IDLE   0

Definition at line 87 of file IRremoteInt.h.

◆ IR_REC_STATE_MARK

#define IR_REC_STATE_MARK   1

Definition at line 88 of file IRremoteInt.h.

◆ IR_REC_STATE_SPACE

#define IR_REC_STATE_SPACE   2

Definition at line 89 of file IRremoteInt.h.

◆ IR_REC_STATE_STOP

#define IR_REC_STATE_STOP   3

Definition at line 90 of file IRremoteInt.h.

◆ IR_TRACE_PRINT

#define IR_TRACE_PRINT (   ...)    void()

Definition at line 145 of file IRremoteInt.h.

◆ IR_TRACE_PRINTLN

#define IR_TRACE_PRINTLN (   ...)    void()

Definition at line 146 of file IRremoteInt.h.

◆ LED_FEEDBACK_DISABLED_COMPLETELY

#define LED_FEEDBACK_DISABLED_COMPLETELY   0x00

Definition at line 340 of file IRremoteInt.h.

◆ LED_FEEDBACK_ENABLED_FOR_RECEIVE

#define LED_FEEDBACK_ENABLED_FOR_RECEIVE   0x01

Definition at line 341 of file IRremoteInt.h.

◆ LED_FEEDBACK_ENABLED_FOR_SEND

#define LED_FEEDBACK_ENABLED_FOR_SEND   0x02

Definition at line 342 of file IRremoteInt.h.

◆ LTOL

Lower tolerance for comparison of measured data.

Definition at line 366 of file IRremoteInt.h.

◆ MARK

#define MARK   1

Definition at line 39 of file IRremoteInt.h.

◆ NO_REPEATS

#define NO_REPEATS   0

Just for better readability of code.

Definition at line 393 of file IRremoteInt.h.

◆ RAW_BUFFER_LENGTH

#define RAW_BUFFER_LENGTH   100

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.

Length of raw duration buffer. Must be even. 100 supports up to 48 bit codings inclusive 1 start and 1 stop bit.

Definition at line 75 of file IRremoteInt.h.

◆ SEND_NO_STOP_BIT

#define SEND_NO_STOP_BIT   false

Definition at line 395 of file IRremoteInt.h.

◆ SEND_REPEAT_COMMAND

#define SEND_REPEAT_COMMAND   true

used for e.g. NEC, where a repeat is different from just repeating the data.

Definition at line 396 of file IRremoteInt.h.

◆ SEND_STOP_BIT

#define SEND_STOP_BIT   true

Definition at line 394 of file IRremoteInt.h.

◆ SPACE

#define SPACE   0

Definition at line 40 of file IRremoteInt.h.

◆ TICKS_HIGH

#define TICKS_HIGH (   us)    ((unsigned int ) ((long) (us) * UTOL / (MICROS_PER_TICK * 100) + 1))

Definition at line 378 of file IRremoteInt.h.

◆ TICKS_LOW

#define TICKS_LOW (   us)    ((unsigned int ) ((long) (us) * LTOL / (MICROS_PER_TICK * 100) ))

Definition at line 377 of file IRremoteInt.h.

◆ TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING

#define TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING   25

Definition at line 361 of file IRremoteInt.h.

◆ USE_DEFAULT_FEEDBACK_LED_PIN

#define USE_DEFAULT_FEEDBACK_LED_PIN   0

Definition at line 65 of file IRremoteInt.h.

◆ UTOL

Upper tolerance for comparison of measured data.

Definition at line 369 of file IRremoteInt.h.

Typedef Documentation

◆ IRRawDataType

typedef uint32_t IRRawDataType

Definition at line 117 of file IRremoteInt.h.

Variable Documentation

◆ disableLEDFeedbackForReceive

constexpr auto disableLEDFeedbackForReceive = disableLEDFeedback
constexpr

Definition at line 348 of file IRremoteInt.h.

◆ enableLEDFeedbackForReceive

constexpr auto enableLEDFeedbackForReceive = enableLEDFeedback
constexpr

Definition at line 346 of file IRremoteInt.h.