IRremote
ir_NEC.hpp
Go to the documentation of this file.
1 /*
2  * ir_NEC.hpp
3  *
4  * Contains functions for receiving and sending NEC IR Protocol in "raw" and standard format with 16 or 8 bit address and 8 bit command
5  *
6  * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
7  *
8  ************************************************************************************
9  * MIT License
10  *
11  * Copyright (c) 2020-2023 Armin Joachimsmeyer
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a copy
14  * of this software and associated documentation files (the "Software"), to deal
15  * in the Software without restriction, including without limitation the rights
16  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17  * copies of the Software, and to permit persons to whom the Software is furnished
18  * to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in all
21  * copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
24  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
25  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
27  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
28  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29  *
30  ************************************************************************************
31  */
32 #ifndef _IR_NEC_HPP
33 #define _IR_NEC_HPP
34 
35 #if defined(DEBUG) && !defined(LOCAL_DEBUG)
36 #define LOCAL_DEBUG // IR_DEBUG_PRINT is a real print function here. Add local debug output.
37 #else
38 //#define LOCAL_DEBUG // This enables debug output only for this file. IR_DEBUG_PRINT is still a void function here.
39 #endif
40 
44 //==============================================================================
45 // N N EEEEE CCCC
46 // NN N E C
47 // N N N EEE C
48 // N NN E C
49 // N N EEEEE CCCC
50 //==============================================================================
51 /*
52  Protocol=NEC Address=0x4 Command=0x8 Raw-Data=0xF708FB04 32 bits LSB first
53  +8950,-4450
54  + 600,- 500 + 650,- 500 + 600,-1650 + 600,- 550
55  + 600,- 500 + 600,- 500 + 650,- 500 + 600,- 500
56  + 650,-1650 + 600,-1600 + 650,- 500 + 600,-1650
57  + 600,-1650 + 600,-1650 + 600,-1600 + 650,-1600
58  + 650,- 500 + 600,- 550 + 600,- 500 + 600,-1650
59  + 600,- 550 + 600,- 500 + 600,- 550 + 600,- 500
60  + 600,-1650 + 600,-1650 + 600,-1650 + 600,- 550
61  + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1600
62  + 650
63  Sum: 68000
64 
65  Protocol=NEC Address=0x8 Command=0x7 Repeat gap=40900us
66  rawData[4]:
67  -40900
68  +10450,-2250
69  + 700
70  Sum: 13400
71  */
72 // http://www.hifi-remote.com/wiki/index.php/NEC
73 // https://www.sbprojects.net/knowledge/ir/nec.php
74 // NEC: LSB first, <start bit><address:16> (or <address:8><inverted address:8>) <command:8><inverted command:8><stop bit>.
75 // ONKYO like NEC but 16 independent address and command bits: <start bit><address:16><command:16><stop bit>
76 // Standard NEC sends a special fixed repeat frame.
77 // NEC2 sends the same full frame after the 110 ms. I have a DVD remote with NEC2.
78 // NEC and NEC 2 only differ in the repeat frames, so the protocol can only be detected correctly after the first repeat.
79 // PIONEER (not implemented) is NEC2 with 40 kHz
80 //
81 // For Apple see https://en.wikipedia.org/wiki/Apple_Remote - <start bit><0x87EE:16><device ID:8><command:7><parity><stop bit> - not implemented!
82 // The parity is not implemented, so we get: <start bit><0x87EE:16><device ID:8><command:8><stop bit>
83 //
84 // IRP notation:
85 // IRP: NEC {38.0k,564}<1,-1|1,-3>(16,-8,D:8,S:8,F:8,~F:8,1,^108m,(16,-4,1,^108m)*) ==> "*" means send special repeat frames o ore more times
86 // IRP: NEC2 {38.0k,564}<1,-1|1,-3>(16,-8,D:8,S:8,F:8,~F:8,1,^108m)+ ==> "+" means send frame 1 or more times (special repeat is missing here!)
87 // Interpretation of IRP notation:
88 // {38.0k,564} ==> 38.0k -> Frequency , 564 -> unit in microseconds (we use 560), no "msb", so "lsb" is assumed
89 // <1,-1|1,-3> ==> Zero is 1 unit mark and space | One is 1 unit mark and 3 units space
90 // 16,-8 ==> Start bit durations
91 // D:8,S:8,F:8,~F:8 ==> D:8 -> 8 bit bitfield for Device, S:8 -> 8 bit bitfield for Subdevice, F:8 -> 8 bit bitfield for Function, ~F:8 -> 8 bit inverted bitfield for Function
92 // 1,^108m ==> 1 -> unit mark Stop bit, ^108m -> wait until 108 milliseconds after start of protocol (we use 110)
93 //
94 #define NEC_ADDRESS_BITS 16 // 16 bit address or 8 bit address and 8 bit inverted address
95 #define NEC_COMMAND_BITS 16 // Command and inverted command
96 
97 #define NEC_BITS (NEC_ADDRESS_BITS + NEC_COMMAND_BITS)
98 #define NEC_UNIT 560 // 21.28 periods of 38 kHz, 11.2 ticks TICKS_LOW = 8.358 TICKS_HIGH = 15.0
99 
100 #define NEC_HEADER_MARK (16 * NEC_UNIT) // 9000 | 180
101 #define NEC_HEADER_SPACE (8 * NEC_UNIT) // 4500 | 90
102 
103 #define NEC_BIT_MARK NEC_UNIT
104 #define NEC_ONE_SPACE (3 * NEC_UNIT) // 1690 | 33.8 TICKS_LOW = 25.07 TICKS_HIGH = 45.0
105 #define NEC_ZERO_SPACE NEC_UNIT
106 
107 #define NEC_REPEAT_HEADER_SPACE (4 * NEC_UNIT) // 2250
108 
109 #define NEC_AVERAGE_DURATION 62000 // NEC_HEADER_MARK + NEC_HEADER_SPACE + 32 * 2,5 * NEC_UNIT + NEC_UNIT // 2.5 because we assume more zeros than ones
110 #define NEC_MINIMAL_DURATION 49900 // NEC_HEADER_MARK + NEC_HEADER_SPACE + 32 * 2 * NEC_UNIT + NEC_UNIT // 2.5 because we assume more zeros than ones
111 #define NEC_REPEAT_DURATION (NEC_HEADER_MARK + NEC_REPEAT_HEADER_SPACE + NEC_BIT_MARK) // 12 ms
112 #define NEC_REPEAT_PERIOD 110000 // Commands are repeated every 110 ms (measured from start to start) for as long as the key on the remote control is held down.
113 #define NEC_REPEAT_DISTANCE (NEC_REPEAT_PERIOD - NEC_AVERAGE_DURATION) // 48 ms
114 #define NEC_MAXIMUM_REPEAT_DISTANCE (NEC_REPEAT_PERIOD - NEC_MINIMAL_DURATION + 10000) // 70 ms
115 
116 #define APPLE_ADDRESS 0x87EE
117 
122 
123 // Like NEC but repeats are full frames instead of special NEC repeats
126 
127 /************************************
128  * Start of send and decode functions
129  ************************************/
130 
136  enableIROut (NEC_KHZ); // 38 kHz
137  mark(NEC_HEADER_MARK); // + 9000
138  space(NEC_REPEAT_HEADER_SPACE); // - 2250
139  mark(NEC_BIT_MARK); // + 560
140 }
141 
147  IrSender.enableIROut(NEC_KHZ); // 38 kHz
148  IrSender.mark(NEC_HEADER_MARK); // + 9000
150  IrSender.mark(NEC_BIT_MARK); // + 560
151 }
152 
153 uint32_t IRsend::computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand) {
154  LongUnion tRawData;
155 
156  // Address 16 bit LSB first
157  if ((aAddress & 0xFF00) == 0) {
158  // assume 8 bit address -> send 8 address bits and then 8 inverted address bits LSB first
159  tRawData.UByte.LowByte = aAddress;
160  tRawData.UByte.MidLowByte = ~tRawData.UByte.LowByte;
161  } else {
162  tRawData.UWord.LowWord = aAddress;
163  }
164 
165  // send 8 command bits and then 8 inverted command bits LSB first
166  tRawData.UByte.MidHighByte = aCommand;
167  tRawData.UByte.HighByte = ~aCommand;
168  return tRawData.ULong;
169 }
170 
176 void IRsend::sendNEC(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
178 }
179 
180 /*
181  * NEC2 Send frame and repeat the frame for each requested repeat
182  * There is NO delay after the last sent repeat!
183  * @param aNumberOfRepeats If < 0 then nothing is sent.
184  */
185 void IRsend::sendNEC2(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
187 }
188 
189 /*
190  * Repeat commands should be sent in a 110 ms raster.
191  * There is NO delay after the last sent repeat!
192  * @param aNumberOfRepeats If < 0 then only a special repeat frame without leading and trailing space
193  * will be sent by calling NECProtocolConstants.SpecialSendRepeatFunction().
194  */
195 void IRsend::sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
197 }
198 
199 /*
200  * Repeat commands should be sent in a 110 ms raster.
201  * There is NO delay after the last sent repeat!
202  * https://en.wikipedia.org/wiki/Apple_Remote
203  * https://gist.github.com/darconeous/4437f79a34e3b6441628
204  * @param aNumberOfRepeats If < 0 then only a special repeat frame without leading and trailing space
205  * will be sent by calling NECProtocolConstants.SpecialSendRepeatFunction().
206  */
207 void IRsend::sendApple(uint8_t aDeviceId, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
208  LongUnion tRawData;
209 
210  // Address 16 bit LSB first fixed value of 0x87EE
211  tRawData.UWord.LowWord = APPLE_ADDRESS;
212 
213  // send Apple code and then 8 command bits LSB first
214  tRawData.UByte.MidHighByte = aCommand;
215  tRawData.UByte.HighByte = aDeviceId; // e.g. 0xD7
216 
218 }
219 
220 /*
221  * Sends NEC protocol
222  * @param aNumberOfRepeats If < 0 then only a special repeat frame without leading and trailing space
223  * will be sent by calling NECProtocolConstants.SpecialSendRepeatFunction().
224  */
225 void IRsend::sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats) {
227 }
228 
233  /*
234  * First check for right data length
235  * Next check start bit
236  * Next try the decode
237  */
238  // Check we have the right amount of data (68). The +4 is for initial gap, start bit mark and space + stop bit mark.
239  if (decodedIRData.rawlen != ((2 * NEC_BITS) + 4) && (decodedIRData.rawlen != 4)) {
240  IR_DEBUG_PRINT(F("NEC: "));
241  IR_DEBUG_PRINT(F("Data length="));
243  IR_DEBUG_PRINTLN(F(" is not 68 or 4"));
244  return false;
245  }
246 
247  // Check header "mark" this must be done for repeat and data
249  return false;
250  }
251 
252  // Check for repeat - here we have another header space length
253  if (decodedIRData.rawlen == 4) {
260  return true;
261  }
262  return false;
263  }
264 
265  // Check command header space
267 #if defined(LOCAL_DEBUG)
268  Serial.print(F("NEC: "));
269  Serial.println(F("Header space length is wrong"));
270 #endif
271  return false;
272  }
273 
274  // Try to decode as NEC protocol
276 #if defined(LOCAL_DEBUG)
277  Serial.print(F("NEC: "));
278  Serial.println(F("Decode failed"));
279 #endif
280  return false;
281  }
282 
283  // Success
284 // decodedIRData.flags = IRDATA_FLAGS_IS_LSB_FIRST; // Not required, since this is the start value
285  LongUnion tValue;
287  decodedIRData.command = tValue.UByte.MidHighByte; // 8 bit
288 
289 #if defined(DECODE_ONKYO)
290  // Here only Onkyo protocol is supported -> force 16 bit address and command decoding
291  decodedIRData.address = tValue.UWord.LowWord; // first 16 bit
293  decodedIRData.command = tValue.UWord.HighWord; // 16 bit command
294 #else
295  // Address
296  if (tValue.UWord.LowWord == APPLE_ADDRESS) {
297  /*
298  * Apple
299  */
302 
303  } else {
304  /*
305  * NEC LSB first, so first sent bit is also LSB of decodedIRData.decodedRawData
306  */
307  if (tValue.UByte.LowByte == (uint8_t)(~tValue.UByte.MidLowByte)) {
308  // standard 8 bit address NEC protocol
309  decodedIRData.address = tValue.UByte.LowByte; // first 8 bit
310  } else {
311  // extended NEC protocol
312  decodedIRData.address = tValue.UWord.LowWord; // first 16 bit
313  }
314  // Check for command if it is 8 bit NEC or 16 bit ONKYO
315  if (tValue.UByte.MidHighByte == (uint8_t)(~tValue.UByte.HighByte)) {
317  } else {
319  decodedIRData.command = tValue.UWord.HighWord; // 16 bit command
320  }
321  }
322 #endif
323 
325 
326  // check for NEC2 repeat, do not check for same content ;-)
331  }
332  return true;
333 }
334 
335 /*********************************************************************************
336  * Old deprecated functions, kept for backward compatibility to old 2.0 tutorials
337  *********************************************************************************/
338 
340  unsigned int offset = 1; // Index in to results; Skip first space.
341 
342 // Check header "mark"
343  if (!matchMark(aResults->rawbuf[offset], NEC_HEADER_MARK)) {
344  return false;
345  }
346  offset++;
347 
348 // Check for repeat
349  if ((aResults->rawlen == 4) && matchSpace(aResults->rawbuf[offset], NEC_REPEAT_HEADER_SPACE)
350  && matchMark(aResults->rawbuf[offset + 1], NEC_BIT_MARK)) {
351  aResults->bits = 0;
352  aResults->value = 0xFFFFFFFF;
355  return true;
356  }
357 
358  // Check we have the right amount of data (32). +4 for initial gap, start bit mark and space + stop bit mark
359  if (aResults->rawlen != (2 * NEC_BITS) + 4) {
360  IR_DEBUG_PRINT(F("NEC MSB: "));
361  IR_DEBUG_PRINT(F("Data length="));
362  IR_DEBUG_PRINT(aResults->rawlen);
363  IR_DEBUG_PRINTLN(F(" is not 68"));
364  return false;
365  }
366 
367 // Check header "space"
368  if (!matchSpace(aResults->rawbuf[offset], NEC_HEADER_SPACE)) {
369 #if defined(LOCAL_DEBUG)
370  Serial.print(F("NEC MSB: "));
371  Serial.println(F("Header space length is wrong"));
372 #endif
373  return false;
374  }
375  offset++;
376 
378 #if defined(LOCAL_DEBUG)
379  Serial.print(F("NEC MSB: "));
380  Serial.println(F("Decode failed"));
381 #endif
382  return false;
383  }
384 
385  // Stop bit
386  if (!matchMark(aResults->rawbuf[offset + (2 * NEC_BITS)], NEC_BIT_MARK)) {
387 #if defined(LOCAL_DEBUG)
388  Serial.print(F("NEC MSB: "));
389  Serial.println(F("Stop bit mark length is wrong"));
390 #endif
391  return false;
392  }
393 
394 // Success
395  aResults->value = decodedIRData.decodedRawData;
396  aResults->bits = NEC_BITS;
397  aResults->decode_type = NEC;
399 
400  return true;
401 }
402 
414 void IRsend::sendNECMSB(uint32_t data, uint8_t nbits, bool repeat) {
415  // Set IR carrier frequency
417 
418  if (data == 0xFFFFFFFF || repeat) {
419  sendNECRepeat();
420  return;
421  }
422 
423  // Header
426 
427  // Old version with MSB first Data + stop bit
429 }
430 
432 #if defined(LOCAL_DEBUG)
433 #undef LOCAL_DEBUG
434 #endif
435 #endif // _IR_NEC_HPP
IRData::address
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
Definition: IRProtocol.h:109
MICROS_PER_TICK
#define MICROS_PER_TICK
microseconds per clock interrupt tick
Definition: IRremote.hpp:249
NEC_BITS
#define NEC_BITS
Definition: ir_NEC.hpp:97
LongUnion
Union to specify parts / manifestations of a 32 bit Long without casts and shifts.
Definition: LongUnion.h:59
decode_results
Results returned from old decoders !!!deprecated!!!
Definition: IRremoteInt.h:159
ONKYO
@ ONKYO
Definition: IRProtocol.h:51
decode_results::rawbuf
uint16_t * rawbuf
Definition: IRremoteInt.h:170
IRsend::sendApple
void sendApple(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_NEC.hpp:207
PROTOCOL_IS_MSB_FIRST
#define PROTOCOL_IS_MSB_FIRST
Definition: IRProtocol.h:145
IRsend::sendNECRaw
void sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Definition: ir_NEC.hpp:225
IRrecv::lastDecodedProtocol
decode_type_t lastDecodedProtocol
Definition: IRremoteInt.h:324
IRData::numberOfBits
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
Definition: IRProtocol.h:118
IRsend::aNumberOfRepeats
void int_fast8_t aNumberOfRepeats
Definition: IRremoteInt.h:520
MICROS_IN_ONE_MILLI
#define MICROS_IN_ONE_MILLI
Definition: IRremote.hpp:254
LongUnion::UByte
struct LongUnion::@4 UByte
NEC2ProtocolConstants
struct PulseDistanceWidthProtocolConstants NEC2ProtocolConstants
Definition: ir_NEC.hpp:124
NEC_BIT_MARK
#define NEC_BIT_MARK
Definition: ir_NEC.hpp:103
IRsend::mark
void mark(uint16_t aMarkMicros)
Sends an IR mark for the specified number of microseconds.
Definition: IRSend.hpp:969
IRData::rawlen
uint_fast8_t rawlen
counter of entries in rawbuf
Definition: IRProtocol.h:123
IRDATA_FLAGS_IS_REPEAT
#define IRDATA_FLAGS_IS_REPEAT
The gap between the preceding frame is as smaller than the maximum gap expected for a repeat....
Definition: IRProtocol.h:91
IRsend::sendPulseDistanceWidth
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Sends PulseDistance frames and repeats and enables receiver again.
Definition: IRSend.hpp:702
LongUnion::LowByte
uint8_t LowByte
Definition: LongUnion.h:61
LongUnion::HighByte
uint8_t HighByte
Definition: LongUnion.h:64
irparams_struct::rawbuf
uint16_t rawbuf[RAW_BUFFER_LENGTH]
raw data / tick counts per mark/space, first entry is the length of the gap between previous and curr...
Definition: IRremoteInt.h:113
IRData::rawDataPtr
irparams_struct * rawDataPtr
Pointer of the raw timing data to be decoded. Mainly the OverflowFlag and the data buffer filled by r...
Definition: IRProtocol.h:129
decode_results::bits
uint8_t bits
Definition: IRremoteInt.h:165
decode_results::decode_type
decode_type_t decode_type
Definition: IRremoteInt.h:162
IRData::decodedRawData
IRRawDataType decodedRawData
Up to 32/64 bit decoded raw data, to be used for send functions.
Definition: IRProtocol.h:112
IRrecv::checkForRepeatSpaceTicksAndSetFlag
void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks)
Definition: IRReceive.hpp:1042
IR_DEBUG_PRINT
#define IR_DEBUG_PRINT(...)
If DEBUG, print the arguments, otherwise do nothing.
Definition: IRremoteInt.h:137
LongUnion::LowWord
uint16_t LowWord
Definition: LongUnion.h:80
matchSpace
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
Definition: IRReceive.hpp:1116
NEC2
@ NEC2
Definition: IRProtocol.h:50
IRrecv::decodePulseDistanceWidthData
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
Definition: IRReceive.hpp:845
decode_results::value
uint32_t value
Definition: IRremoteInt.h:164
IRsend::sendNEC2
void sendNEC2(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_NEC.hpp:185
LongUnion::MidLowByte
uint8_t MidLowByte
Definition: LongUnion.h:62
PulseDistanceWidthProtocolConstants
Definition: IRProtocol.h:132
LongUnion::HighWord
uint16_t HighWord
Definition: LongUnion.h:81
NEC_ONE_SPACE
#define NEC_ONE_SPACE
Definition: ir_NEC.hpp:104
IRrecv::decodedIRData
IRData decodedIRData
Definition: IRremoteInt.h:321
IRData::flags
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
Definition: IRProtocol.h:119
PROTOCOL_IS_LSB_FIRST
#define PROTOCOL_IS_LSB_FIRST
Definition: IRProtocol.h:146
IRDATA_FLAGS_IS_PROTOCOL_WITH_DIFFERENT_REPEAT
#define IRDATA_FLAGS_IS_PROTOCOL_WITH_DIFFERENT_REPEAT
Here we have a repeat of type NEC2 or SamsungLG.
Definition: IRProtocol.h:97
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:414
IRData::command
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
Definition: IRProtocol.h:110
NEC
@ NEC
Definition: IRProtocol.h:49
APPLE
@ APPLE
Definition: IRProtocol.h:44
matchMark
bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
Definition: IRReceive.hpp:1083
NEC_KHZ
#define NEC_KHZ
Definition: IRProtocol.h:162
IRsend::computeNECRawDataAndChecksum
uint32_t computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aCommand)
Definition: ir_NEC.hpp:153
LongUnion::ULong
uint32_t ULong
Definition: LongUnion.h:95
APPLE_ADDRESS
#define APPLE_ADDRESS
Definition: ir_NEC.hpp:116
IrSender
IRsend IrSender
Definition: IRSend.hpp:65
IRrecv::lastDecodedCommand
uint32_t lastDecodedCommand
Definition: IRremoteInt.h:326
IRDATA_FLAGS_IS_LSB_FIRST
#define IRDATA_FLAGS_IS_LSB_FIRST
Definition: IRProtocol.h:100
NEC_ZERO_SPACE
#define NEC_ZERO_SPACE
Definition: ir_NEC.hpp:105
NEC_HEADER_SPACE
#define NEC_HEADER_SPACE
Definition: ir_NEC.hpp:101
IRsend::space
static void space(uint16_t aSpaceMicros)
Sends an IR space for the specified number of microseconds.
Definition: IRSend.hpp:1165
NEC_REPEAT_HEADER_SPACE
#define NEC_REPEAT_HEADER_SPACE
Definition: ir_NEC.hpp:107
IRrecv::decodeNECMSB
bool decodeNECMSB(decode_results *aResults)
Definition: ir_NEC.hpp:339
IRrecv::decodeNEC
bool decodeNEC()
Decodes also Onkyo and Apple.
Definition: ir_NEC.hpp:232
LongUnion::MidHighByte
uint8_t MidHighByte
Definition: LongUnion.h:63
IRsend::sendNECRepeat
void sendNECRepeat()
Send special NEC repeat frame Repeat commands should be sent in a 110 ms raster.
Definition: ir_NEC.hpp:135
NEC_REPEAT_PERIOD
#define NEC_REPEAT_PERIOD
Definition: ir_NEC.hpp:112
LongUnion::UWord
struct LongUnion::@6 UWord
IRsend::sendPulseDistanceWidthData
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...
Definition: IRSend.hpp:832
IRrecv::lastDecodedAddress
uint32_t lastDecodedAddress
Definition: IRremoteInt.h:325
NEC_HEADER_MARK
#define NEC_HEADER_MARK
Definition: ir_NEC.hpp:100
IRsend::sendOnkyo
void sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_NEC.hpp:195
NECProtocolConstants
struct PulseDistanceWidthProtocolConstants NECProtocolConstants
Definition: ir_NEC.hpp:118
IR_DEBUG_PRINTLN
#define IR_DEBUG_PRINTLN(...)
If DEBUG, print the arguments as a line, otherwise do nothing.
Definition: IRremoteInt.h:141
decode_results::rawlen
uint_fast8_t rawlen
Definition: IRremoteInt.h:171
IRData::protocol
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
Definition: IRProtocol.h:108
IRsend::aCommand
void aCommand
Definition: IRremoteInt.h:582
IRsend::enableIROut
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
Definition: IRSend.hpp:1205
sendNECSpecialRepeat
void sendNECSpecialRepeat()
Static function variant of IRsend::sendNECRepeat For use in ProtocolConstants.
Definition: ir_NEC.hpp:146
NEC_MAXIMUM_REPEAT_DISTANCE
#define NEC_MAXIMUM_REPEAT_DISTANCE
Definition: ir_NEC.hpp:114
IRsend::sendNEC
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!
Definition: ir_NEC.hpp:176