IRremote
|
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>
Go to the source code of this file.
Classes | |
struct | irparams_struct |
This struct contains the data and control used for receiver functions and the ISR (interrupt service routine) Only StateForISR needs to be volatile. More... | |
struct | IRData |
Data structure for the user application, available as decodedIRData. More... | |
struct | decode_results |
Results returned from old decoders !!!deprecated!!! More... | |
class | IRrecv |
class | IRsend |
Main class for sending IR signals. More... | |
Macros | |
#define | MARK 1 |
#define | SPACE 0 |
#define | RAW_BUFFER_LENGTH 750 |
The RAW_BUFFER_LENGTH determines the length of the byte buffer where the received IR timing data is stored before decoding. More... | |
#define | BITS_IN_RAW_DATA_TYPE 32 |
#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 | DECODED_RAW_DATA_ARRAY_SIZE ((((RAW_BUFFER_LENGTH - 2) - 1) / (2 * BITS_IN_RAW_DATA_TYPE)) + 1) |
#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 | USE_DEFAULT_FEEDBACK_LED_PIN 0 |
Main class for receiving IR signals. More... | |
#define | DISABLE_LED_FEEDBACK false |
#define | ENABLE_LED_FEEDBACK true |
#define | TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT 25 |
#define | TICKS(us) ((us)/MICROS_PER_TICK) |
#define | LTOL (100 - TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT) |
Lower tolerance for comparison of measured data. More... | |
#define | UTOL (100 + TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT) |
Upper tolerance for comparison of measured data. More... | |
#define | TICKS_LOW(us) ((uint16_t ) ((long) (us) * LTOL / (MICROS_PER_TICK * 100) )) |
#define | TICKS_HIGH(us) ((uint16_t ) ((long) (us) * UTOL / (MICROS_PER_TICK * 100) + 1)) |
#define | NO_REPEATS 0 |
Just for better readability of code. More... | |
#define | SEND_REPEAT_COMMAND true |
used for e.g. NEC, where a repeat is different from just repeating the data. More... | |
Typedefs | |
typedef unsigned int | IRRawlenType |
typedef uint8_t | IRRawbufType |
typedef uint32_t | IRRawDataType |
Functions | |
void | printIRResultShort (Print *aSerial, IRData *aIRDataPtr, bool aPrintRepeatGap) __attribute__((deprecated("Remove last parameter |
void | printIRResultShort (Print *aSerial, IRData *aIRDataPtr) __attribute__((deprecated("Use member function or printIRDataShort() instead."))) |
void | printIRDataShort (Print *aSerial, IRData *aIRDataPtr) |
bool | matchTicks (uint16_t aMeasuredTicks, uint16_t aMatchValueMicros) |
Match function WITHOUT compensating for marks exceeded or spaces shortened by demodulator hardware. More... | |
bool | matchTicks (uint16_t aMeasuredTicks, uint16_t aMatchValueMicros, int16_t aCompensationMicrosForTicks) |
Match function WITH compensating for marks exceeded or spaces shortened by demodulator hardware. More... | |
bool | matchMark (uint16_t aMeasuredTicks, uint16_t aMatchValueMicros) |
Compensate for marks exceeded by demodulator hardware. More... | |
bool | matchSpace (uint16_t aMeasuredTicks, uint16_t aMatchValueMicros) |
Compensate for spaces shortened by demodulator hardware. More... | |
bool | MATCH (uint16_t measured, uint16_t desired) |
bool | MATCH_MARK (uint16_t measured_ticks, uint16_t desired_us) |
bool | MATCH_SPACE (uint16_t measured_ticks, uint16_t desired_us) |
int | getMarkExcessMicros () |
Getter function for MARK_EXCESS_MICROS. More... | |
void | printActiveIRProtocols (Print *aSerial) |
void | setLEDFeedback (bool aEnableLEDFeedback) |
void | setLEDFeedbackPin (uint8_t aFeedbackLEDPin) |
void | setFeedbackLED (bool aSwitchLedOn) |
Flash LED while receiving or sending IR data. More... | |
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 | IRReceiveTimerInterruptHandler () |
void | sendNECSpecialRepeat () |
Static function variant of IRsend::sendNECRepeat For use in ProtocolConstants. More... | |
void | sendLG2SpecialRepeat () |
Static function for sending special repeat frame. More... | |
void | sendSamsungLGSpecialRepeat () |
Like above, but implemented as a static function Used for sending special repeat frame. More... | |
Variables | |
unsigned long | sMicrosAtLastStopTimer |
void it is not supported any | more |
uint_fast8_t | sBiphaseDecodeRawbuffOffset |
constexpr auto | enableLEDFeedbackForReceive = enableLEDFeedback |
constexpr auto | disableLEDFeedbackForReceive = disableLEDFeedback |
IRrecv | IrReceiver |
The receiver instance. More... | |
IRsend | IrSender |
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-2025 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.
#define BITS_IN_RAW_DATA_TYPE 32 |
Definition at line 107 of file IRremoteInt.h.
#define DECODED_RAW_DATA_ARRAY_SIZE ((((RAW_BUFFER_LENGTH - 2) - 1) / (2 * BITS_IN_RAW_DATA_TYPE)) + 1) |
Definition at line 146 of file IRremoteInt.h.
#define DISABLE_LED_FEEDBACK false |
Definition at line 455 of file IRremoteInt.h.
#define ENABLE_LED_FEEDBACK true |
Definition at line 456 of file IRremoteInt.h.
#define IR_DEBUG_PRINT | ( | ... | ) | void() |
If DEBUG, print the arguments, otherwise do nothing.
Definition at line 187 of file IRremoteInt.h.
#define IR_DEBUG_PRINTLN | ( | ... | ) | void() |
If DEBUG, print the arguments as a line, otherwise do nothing.
Definition at line 191 of file IRremoteInt.h.
#define IR_REC_STATE_IDLE 0 |
Definition at line 117 of file IRremoteInt.h.
#define IR_REC_STATE_MARK 1 |
Definition at line 118 of file IRremoteInt.h.
#define IR_REC_STATE_SPACE 2 |
Definition at line 119 of file IRremoteInt.h.
#define IR_REC_STATE_STOP 3 |
Definition at line 120 of file IRremoteInt.h.
#define IR_TRACE_PRINT | ( | ... | ) | void() |
Definition at line 198 of file IRremoteInt.h.
#define IR_TRACE_PRINTLN | ( | ... | ) | void() |
Definition at line 199 of file IRremoteInt.h.
#define LTOL (100 - TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT) |
Lower tolerance for comparison of measured data.
Definition at line 486 of file IRremoteInt.h.
#define MARK 1 |
Definition at line 39 of file IRremoteInt.h.
#define NO_REPEATS 0 |
Just for better readability of code.
Definition at line 511 of file IRremoteInt.h.
#define RAW_BUFFER_LENGTH 750 |
The RAW_BUFFER_LENGTH determines the length of the byte buffer where the received IR timing data is stored before decoding.
100 is sufficient for standard protocols up to 48 bits, with 1 bit consisting of one mark and space plus 1 byte for initial gap, 2 bytes for header and 1 byte for stop bit. 48 bit protocols are PANASONIC, KASEIKYO, SAMSUNG48, RC6. 32 bit protocols like NEC, SAMSUNG, WHYNTER, SONY(20), LG(28) requires a buffer length of 68. 16 bit protocols like BOSEWAVE, DENON, FAST, JVC, LEGO_PF, RC5, SONY(12 or 15) requires a buffer length of 36. MAGIQUEST requires a buffer length of 112. Air conditioners often send a longer protocol data stream up to 750 bits.
Definition at line 78 of file IRremoteInt.h.
#define SEND_REPEAT_COMMAND true |
used for e.g. NEC, where a repeat is different from just repeating the data.
Definition at line 512 of file IRremoteInt.h.
#define SPACE 0 |
Definition at line 40 of file IRremoteInt.h.
#define TICKS | ( | us | ) | ((us)/MICROS_PER_TICK) |
Definition at line 479 of file IRremoteInt.h.
#define TICKS_HIGH | ( | us | ) | ((uint16_t ) ((long) (us) * UTOL / (MICROS_PER_TICK * 100) + 1)) |
Definition at line 491 of file IRremoteInt.h.
#define TICKS_LOW | ( | us | ) | ((uint16_t ) ((long) (us) * LTOL / (MICROS_PER_TICK * 100) )) |
Definition at line 490 of file IRremoteInt.h.
#define TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT 25 |
Definition at line 476 of file IRremoteInt.h.
#define USE_DEFAULT_FEEDBACK_LED_PIN 0 |
Main class for receiving IR signals.
Definition at line 226 of file IRremoteInt.h.
#define UTOL (100 + TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT) |
Upper tolerance for comparison of measured data.
Definition at line 489 of file IRremoteInt.h.
typedef uint8_t IRRawbufType |
Definition at line 99 of file IRremoteInt.h.
typedef uint32_t IRRawDataType |
Definition at line 105 of file IRremoteInt.h.
typedef unsigned int IRRawlenType |
Definition at line 87 of file IRremoteInt.h.
void disableLEDFeedbackForSend | ( | ) |
void enableLEDFeedbackForSend | ( | ) |
void printIRResultShort | ( | Print * | aSerial, |
IRData * | aIRDataPtr, | ||
bool | aPrintRepeatGap | ||
) |
|
constexpr |
Definition at line 463 of file IRremoteInt.h.
|
constexpr |
Definition at line 461 of file IRremoteInt.h.
void it is not supported any more |
Definition at line 423 of file IRremoteInt.h.