Go to the documentation of this file.
33 #ifndef _IR_REMOTE_INT_H
34 #define _IR_REMOTE_INT_H
42 #define F_CPU 16000000 // definition for a board for which F_CPU is not defined
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)
51 #if defined(SYSCLOCK) // allow for processor specific code to define F_CPU
53 #define F_CPU SYSCLOCK // Clock frequency to be used for timing.
62 #define DISABLE_LED_FEEDBACK false
63 #define ENABLE_LED_FEEDBACK true
64 #define USE_DEFAULT_FEEDBACK_LED_PIN 0
70 #if !defined(RAW_BUFFER_LENGTH)
71 # if defined(DECODE_MAGIQUEST)
72 #define RAW_BUFFER_LENGTH 112 // MagiQuest requires 112 bytes.
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.
78 #if RAW_BUFFER_LENGTH % 2 == 1
79 #error RAW_BUFFER_LENGTH must be even, since the array consists of space / mark pairs.
86 #define IR_REC_STATE_IDLE 0
87 #define IR_REC_STATE_MARK 1
88 #define IR_REC_STATE_SPACE 2
89 #define IR_REC_STATE_STOP 3 // set to IR_REC_STATE_IDLE only by resume()
100 volatile uint8_t *IRReceivePinPortInputRegister;
101 uint8_t IRReceivePinMask;
104 #if !IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK
108 #if RAW_BUFFER_LENGTH <= 254 // saves around 75 bytes program memory and speeds up ISR
116 #if (__INT_WIDTH__ < 32)
126 #if defined(DEBUG) || defined(TRACE)
127 # define IR_DEBUG_PRINT(...) Serial.print(__VA_ARGS__)
128 # define IR_DEBUG_PRINTLN(...) Serial.println(__VA_ARGS__)
133 # define IR_DEBUG_PRINT(...) void()
137 # define IR_DEBUG_PRINTLN(...) void()
141 # define IR_TRACE_PRINT(...) Serial.print(__VA_ARGS__)
142 # define IR_TRACE_PRINTLN(...) Serial.println(__VA_ARGS__)
144 # define IR_TRACE_PRINT(...) void()
145 # define IR_TRACE_PRINTLN(...) void()
176 IRrecv(uint_fast8_t aReceivePin);
177 IRrecv(uint_fast8_t aReceivePin, uint_fast8_t aFeedbackLEDPin);
183 void begin(uint_fast8_t aReceivePin,
bool aEnableLEDFeedback =
false, uint_fast8_t aFeedbackLEDPin =
187 void start(uint32_t aMicrosecondsToAddToGapCounter);
217 bool printIRResultShort(Print *aSerial,
bool aPrintRepeatGap =
true,
bool aCheckForRecordGapsMicros =
true);
239 uint_fast8_t aStartOffset = 3);
242 unsigned int aZeroMarkMicros,
unsigned int aOneSpaceMicros,
unsigned int aZeroSpaceMicros,
bool aMSBfirst);
244 bool decodeBiPhaseData(uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset, uint_fast8_t aStartClockCount,
245 uint_fast8_t aValueOfSpaceToMarkTransition,
unsigned int aBiphaseTimeUnit);
247 void initBiphaselevel(uint_fast8_t aRCDecodeRawbuffOffset,
unsigned int aBiphaseTimeUnit);
290 __attribute__ ((deprecated (
"Please use IrReceiver.decode() without a parameter and IrReceiver.decodedIRData.<fieldname> .")));
293 void blink13(uint8_t aEnableLEDFeedback)
294 __attribute__ ((deprecated (
"Please use setLEDFeedback() or enableLEDFeedback() / disableLEDFeedback().")));
300 uint_fast8_t
compare(
unsigned int oldval,
unsigned int newval);
320 bool matchTicks(
unsigned int aMeasuredTicks,
unsigned int aMatchValueMicros);
321 bool matchMark(
unsigned int aMeasuredTicks,
unsigned int aMatchValueMicros);
322 bool matchSpace(
unsigned int aMeasuredTicks,
unsigned int aMatchValueMicros);
327 bool MATCH(
unsigned int measured,
unsigned int desired);
328 bool MATCH_MARK(
unsigned int measured_ticks,
unsigned int desired_us);
329 bool MATCH_SPACE(
unsigned int measured_ticks,
unsigned int desired_us);
338 #define DO_NOT_ENABLE_LED_FEEDBACK 0x00
339 #define LED_FEEDBACK_DISABLED_COMPLETELY 0x00
340 #define LED_FEEDBACK_ENABLED_FOR_RECEIVE 0x01
341 #define LED_FEEDBACK_ENABLED_FOR_SEND 0x02
343 void setLEDFeedback(uint8_t aFeedbackLEDPin, uint8_t aEnableLEDFeedback);
352 void setBlinkPin(uint8_t aFeedbackLEDPin) __attribute__ ((deprecated (
"Please use setLEDFeedback().")));
359 #if !defined(TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING)
360 #define TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING 25 // Relative tolerance (in percent) for matchTicks(), matchMark() and matchSpace() functions used for protocol decoding.
365 #define LTOL (100 - TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING)
368 #define UTOL (100 + TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING)
372 #if MICROS_PER_TICK == 50 && TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING == 25 // Defaults
373 #define TICKS_LOW(us) ((us)/67 ) // (us) / ((MICROS_PER_TICK:50 / LTOL:75 ) * 100)
374 #define TICKS_HIGH(us) (((us)/40) + 1) // (us) / ((MICROS_PER_TICK:50 / UTOL:125) * 100) + 1
376 #define TICKS_LOW(us) ((unsigned int ) ((long) (us) * LTOL / (MICROS_PER_TICK * 100) ))
377 #define TICKS_HIGH(us) ((unsigned int ) ((long) (us) * UTOL / (MICROS_PER_TICK * 100) + 1))
393 #define SEND_STOP_BIT true
394 #define SEND_NO_STOP_BIT false
395 #define SEND_REPEAT_COMMAND true
407 #if defined(IR_SEND_PIN)
411 void begin(uint_fast8_t aSendPin,
bool aEnableLEDFeedback)
412 # if !defined (DOXYGEN)
413 __attribute__ ((deprecated (
"You must use begin(ENABLE_LED_FEEDBACK) or begin(DISABLE_LED_FEEDBACK) since version 4.0.")));
416 IRsend(uint_fast8_t aSendPin);
417 void begin(uint_fast8_t aSendPin);
420 void begin(uint_fast8_t aSendPin,
bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin);
428 unsigned int aHeaderSpaceMicros,
unsigned int aOneMarkMicros,
unsigned int aOneSpaceMicros,
429 unsigned int aZeroMarkMicros,
unsigned int aZeroSpaceMicros,
IRRawDataType *aDecodedRawDataArray,
430 unsigned int aNumberOfBits,
bool aMSBfirst,
bool aSendStopBit,
unsigned int aRepeatPeriodMillis,
437 uint_fast8_t aNumberOfBits);
438 void sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz,
unsigned int aHeaderMarkMicros,
unsigned int aHeaderSpaceMicros,
439 unsigned int aOneMarkMicros,
unsigned int aOneSpaceMicros,
unsigned int aZeroMarkMicros,
unsigned int aZeroSpaceMicros,
440 IRRawDataType aData, uint_fast8_t aNumberOfBits,
bool aMSBfirst,
bool aSendStopBit,
unsigned int aRepeatPeriodMillis,
443 unsigned int aZeroSpaceMicros,
IRRawDataType aData, uint_fast8_t aNumberOfBits,
bool aMSBfirst,
bool aSendStopBit);
444 void sendBiphaseData(
unsigned int aBiphaseTimeUnit, uint32_t aData, uint_fast8_t aNumberOfBits);
446 void mark(
unsigned int aMarkMicros);
447 static void space(
unsigned int aSpaceMicros);
451 void sendRaw(
const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
452 void sendRaw_P(
const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
455 void sendRaw(
const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
456 void sendRaw_P(
const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz);
462 int8_t aNumberOfHeaderBits = 8);
464 int8_t aNumberOfHeaderBits = 8);
465 void sendBangOlufsenRaw(uint32_t aRawData, int_fast8_t aBits,
bool aBackToBack =
false);
467 bool aUseDatalinkTiming =
false);
471 #if !defined (DOXYGEN)
472 __attribute__ ((deprecated (
"Please use sendDenon(aAddress, aCommand, aNumberOfRepeats).")));
507 void sendLegoPowerFunctions(uint8_t aChannel, uint8_t tCommand, uint8_t aMode,
bool aDoSend5Times =
true);
528 void sendDenon(
unsigned long data,
int nbits);
530 void sendJVC(
unsigned long data,
int nbits,
535 void sendJVCMSB(
unsigned long data,
int nbits,
bool repeat =
false);
537 void sendLG(
unsigned long data,
int nbits);
541 __attribute__ ((deprecated (
"This old function sends MSB first! Please use sendNECMSB() or sendNEC(aAddress, aCommand, aNumberOfRepeats)."))) {
544 void sendNECMSB(uint32_t data, uint8_t nbits,
bool repeat =
false);
545 void sendRC5(uint32_t data, uint8_t nbits);
546 void sendRC5ext(uint8_t addr, uint8_t cmd,
bool toggle);
547 void sendRC6Raw(uint32_t data, uint8_t nbits);
548 void sendRC6(uint32_t data, uint8_t nbits)
__attribute__ ((deprecated (
"Please use sendRC6Raw().")));
549 void sendRC6Raw(uint64_t data, uint8_t nbits);
550 void sendRC6(uint64_t data, uint8_t nbits)
__attribute__ ((deprecated (
"Please use sendRC6Raw().")));;
552 void sendSharp(
unsigned int address,
unsigned int command);
554 __attribute__ ((deprecated (
"This old function sends MSB first! Please use sendSamsung().")));
557 __attribute__ ((deprecated (
"This old function sends MSB first! Please use sendSony(aAddress, aCommand, aNumberOfRepeats).")));
559 void sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend);
561 #if !defined(IR_SEND_PIN)
580 #endif // _IR_REMOTE_INT_H
void sendShuzu(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
void sendLGRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Here you can put your raw data, even one with "wrong" checksum.
Results returned from old decoders !!!deprecated!!!
void sendApple(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
void sendMagiQuest(uint32_t aWandId, uint16_t aMagnitude)
void setFeedbackLED(bool aSwitchLedOn)
Flash LED while receiving or sending IR data.
void sendDish(uint16_t aData)
void sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
void stop()
Disables the timer for IR reception.
decode_type_t lastDecodedProtocol
void uint8_t int_fast8_t aNumberOfRepeats
void disableIRIn()
Alias for stop().
void sendKaseikyo_Sharp(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with SHARP_VENDOR_ID_CODE.
void setBlinkPin(uint8_t aFeedbackLEDPin) __attribute__((deprecated("Please use setLEDFeedback().")))
Old deprecated function name for setLEDFeedback()
void enableIRIn()
Alias for start().
void sendBangOlufsenRaw(uint32_t aRawData, int_fast8_t aBits, bool aBackToBack=false)
void setSendPin(uint_fast8_t aSendPin)
bool checkForRecordGapsMicros(Print *aSerial)
void sendBoseWave(uint8_t aCommand, int_fast8_t aNumberOfRepeats=NO_REPEATS)
uint_fast8_t compare(unsigned int oldval, unsigned int newval)
void sendSony(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t numberOfBits=12)
void disableLEDFeedbackForSend()
void registerReceiveCompleteCallback(void(*aReceiveCompleteCallbackFunction)(void))
Sets the function to call if a protocol message has arrived.
Main class for receiving IR signals.
#define NO_REPEATS
Just for better readability of code.
void mark(unsigned int aMarkMicros)
Sends an IR mark for the specified number of microseconds.
void sendRC6Raw(uint32_t data, uint8_t nbits)
bool decodeDistanceWidth()
void sendSamsungLGRepeat()
Send repeat Repeat commands should be sent in a 110 ms raster.
unsigned int periodTimeMicros
constexpr auto disableLEDFeedbackForReceive
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...
decode_type_t
An enum consisting of all supported formats.
void restartAfterSend()
Restarts receiver after send.
bool MATCH(unsigned int measured, unsigned int desired)
static void customDelayMicroseconds(unsigned long aMicroseconds)
Custom delay function that circumvents Arduino's delayMicroseconds 16 bit limit and is (mostly) not e...
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Sends PulseDistance frames and repeats.
IRrecv()
Instantiate the IRrecv class.
uint_fast8_t sBiphaseDecodeRawbuffOffset
void blink13(uint8_t aEnableLEDFeedback) __attribute__((deprecated("Please use setLEDFeedback() or enableLEDFeedback() / disableLEDFeedback().")))
Old deprecated function name for setLEDFeedback() or enableLEDFeedback() / disableLEDFeedback()
void printIRResultAsCVariables(Print *aSerial)
Print results as C variables to be used for sendXXX()
void sendNEC(uint32_t aRawData, uint8_t nbits) __attribute__((deprecated("This old function sends MSB first! Please use sendNECMSB() or sendNEC(aAddress
bool MATCH_SPACE(unsigned int measured_ticks, unsigned int desired_us)
void sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend)
__attribute__((deprecated("This old function sends MSB first! Please use sendSamsung().")))
void initBiphaselevel(uint_fast8_t aRCDecodeRawbuffOffset, unsigned int aBiphaseTimeUnit)
decode_type_t decode_type
void(* ReceiveCompleteCallbackFunction)(void)
The function to call if a protocol message has arrived, i.e. StateForISR changed to IR_REC_STATE_STOP...
void begin(uint_fast8_t aReceivePin, bool aEnableLEDFeedback=false, uint_fast8_t aFeedbackLEDPin=USE_DEFAULT_FEEDBACK_LED_PIN)
Initializes the receive and feedback pin.
void sendRaw_P(const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz)
New function using an 8 byte tick timing array in FLASH to save program memory Raw data starts with a...
bool decodeSonyMSB(decode_results *aResults)
unsigned int getPulseCorrectionNanos()
void sendBiphaseData(unsigned int 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...
size_t compensateAndStorePronto(String *aString, unsigned int frequency=38000U)
Main class for sending IR signals.
This struct contains the data and control used for receiver static functions and the ISR (interrupt s...
void sendLG2SpecialRepeat()
Static function for sending special repeat frame.
IRData * read()
If IR receiver data is available, returns pointer to IrReceiver.decodedIRData, else NULL.
uint_fast8_t getBiphaselevel()
Gets the level of one time interval (aBiphaseTimeUnit) at a time from the raw buffer.
uint_fast8_t rawlen
counter of entries in rawbuf
bool decodeHashOld(decode_results *aResults)
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
bool decodeLGMSB(decode_results *aResults)
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.
void sendNEC2(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
bool decodeSAMSUNG(decode_results *aResults)
bool decodeLegoPowerFunctions()
bool OverflowFlag
Raw buffer OverflowFlag occurred.
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.
void sendJVC(unsigned long data, int nbits, bool repeat) __attribute__((deprecated("This old function sends MSB first! Please use sendJVC(aAddress
The JVC protocol repeats by skipping the header mark and space -> this leads to a poor repeat detecti...
bool decodePanasonicMSB(decode_results *aResults)
Data structure for the user application, available as decodedIRData.
bool matchSpace(unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, unsigned int aHeaderMarkMicros, unsigned int aHeaderSpaceMicros, unsigned int aOneMarkMicros, unsigned int aOneSpaceMicros, unsigned int aZeroMarkMicros, unsigned int aZeroSpaceMicros, IRRawDataType *aDecodedRawDataArray, unsigned int aNumberOfBits, bool aMSBfirst, bool aSendStopBit, unsigned int aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats)
Sends PulseDistance data from array For LSB First the LSB of array[0] is sent first then all bits unt...
void sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
void sendRC5ext(uint8_t addr, uint8_t cmd, bool toggle)
bool MATCH_MARK(unsigned int measured_ticks, unsigned int desired_us)
void sendSamsungLGSpecialRepeat()
Static function for sending special repeat frame.
void disableLEDFeedback()
bool printIRResultShort(Print *aSerial, bool aPrintRepeatGap=true, bool aCheckForRecordGapsMicros=true)
Function to print values and flags of IrReceiver.decodedIRData in one line.
void sendBangOlufsenDataLink(uint32_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats=NO_REPEATS, int8_t aNumberOfHeaderBits=8)
void checkForRepeatSpaceAndSetFlag(unsigned int aMediumRepeatSpaceMicros)
void sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants)
void sendKaseikyo(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode)
Address can be interpreted as sub-device << 8 + device.
unsigned int rawbuf[RAW_BUFFER_LENGTH]
raw data / tick counts per mark/space, first entry is the length of the gap between previous and curr...
void begin(uint_fast8_t aSendPin)
Initializes the send pin and enable LED feedback with board specific FEEDBACK_LED_ON() and FEEDBACK_L...
void sendNECMSB(uint32_t data, uint8_t nbits, bool repeat=false)
With Send sendNECMSB() you can send your old 32 bit codes.
void sendKaseikyo_JVC(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with JVC_VENDOR_ID_CODE.
static void printActiveIRProtocols(Print *aSerial)
void printActiveIRProtocols(Print *aSerial)
uint32_t computeLGRawDataAndChecksum(uint8_t aAddress, uint16_t aCommand)
bool isIdle()
Returns status of reception.
void sendPanasonic(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with PANASONIC_VENDOR_ID_CODE.
int getMarkExcessMicros()
Getter function for MARK_EXCESS_MICROS.
void compensateAndPrintIRResultAsCArray(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks=true)
Dump out the IrReceiver.decodedIRData.rawDataPtr->rawbuf[] to be used as C definition for sendRaw().
bool matchTicks(unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
Match function without compensating for marks exceeded or spaces shortened by demodulator hardware Cu...
void compensateAndPrintIRResultAsPronto(Print *aSerial, unsigned int frequency=38000U)
Print the result (second argument) as Pronto Hex on the Print supplied as argument.
size_t write(IRData *aIRSendData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Interprets and sends a IRData structure.
volatile uint_fast16_t TickCounterForISR
Counts 50uS ticks. The value is copied into the rawbuf array on every transition.
void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp=false)
volatile uint8_t StateForISR
State Machine state.
void setReceivePin(uint_fast8_t aReceivePinNumber)
Sets / changes the receiver pin number.
bool decodeDenonOld(decode_results *aResults)
void start()
Start the receiving process.
void compensateAndStoreIRResultInArray(uint8_t *aArrayPtr)
Store the decodedIRData to be used for sendRaw().
void enableLEDFeedbackForSend()
uint32_t computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand)
void printIRResultMinimal(Print *aSerial)
Function to print protocol number, address, command, raw data and repeat flag of IrReceiver....
void initDecodedIRData()
Is internally called by decode before calling decoders.
void sendPronto(const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Common declarations for receiving and sending.
void sendJVCMSB(unsigned long data, int nbits, bool repeat=false)
With Send sendJVCMSB() you can send your old 32 bit codes.
uint32_t lastDecodedCommand
static void space(unsigned int aSpaceMicros)
Sends an IR space for the specified number of microseconds.
bool decodeRC5()
Try to decode data as RC5 protocol.
bool decodeBiPhaseData(uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset, uint_fast8_t aStartClockCount, uint_fast8_t aValueOfSpaceToMarkTransition, unsigned int aBiphaseTimeUnit)
bool available()
Returns true if IR receiver data is available.
void sendSamsung48(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Here we send Samsung48 We send 2 x (8 bit command and then ~command)
void sendDenonRaw(uint16_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS) void sendJVC(uint8_t aAddress
void sendRC5(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle=true)
constexpr auto enableLEDFeedbackForReceive
unsigned int periodOnTimeMicros
void end()
Alias for stop().
void sendKaseikyo_Mitsubishi(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with MITSUBISHI_VENDOR_ID_CODE.
bool decodeNECMSB(decode_results *aResults)
void sendBangOlufsenRawDataLink(uint64_t aRawData, int_fast8_t aBits, bool aBackToBack=false, bool aUseDatalinkTiming=false)
bool decodeNEC()
Decodes also Onkyo and Apple.
void sendNECRepeat()
Send special NEC repeat frame Repeat commands should be sent in a 110 ms raster.
void printIRSendUsage(Print *aSerial)
Function to print values and flags of IrReceiver.decodedIRData in one line.
void sendSAMSUNG(unsigned long data, int nbits)
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...
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...
bool decode()
The main decode function, attempts to decode the recently receive IR signal.
void sendSharpRaw(unsigned long data, int nbits)
#define RAW_BUFFER_LENGTH
The length of the buffer where the IR timing data is stored before decoding 100 is sufficient for mos...
uint32_t lastDecodedAddress
void sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
void sendLegoPowerFunctions(uint8_t aChannel, uint8_t tCommand, uint8_t aMode, bool aDoSend5Times=true)
bool matchMark(unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
#define USE_DEFAULT_FEEDBACK_LED_PIN
bool decodeRC6()
Try to decode data as RC6 protocol.
const char * getProtocolString()
void sendLG(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
LG uses the NEC repeat.
void sendBangOlufsen(uint16_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats=NO_REPEATS, int8_t aNumberOfHeaderBits=8)
void resume()
Restart the ISR (Interrupt Service Routine) state machine, to enable receiving of the next IR frame.
void startWithTicksToAdd(uint16_t aTicksToAddToGapCounter)
IRrecv IrReceiver
The receiver instance.
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
void sendKaseikyo_Denon(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with DENON_VENDOR_ID_CODE.
void printIRResultRawFormatted(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks=true)
Dump out the timings in IrReceiver.decodedIRData.rawDataPtr->rawbuf[] array 8 values per line.
void sendLG2(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
LG2 uses a special repeat.
bool decodeJVCMSB(decode_results *aResults)
void sendNECSpecialRepeat()
Static function for sending special repeat frame.
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 ...
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!
uint_fast8_t IRReceivePin
Pin connected to IR data from detector.