IRremote
ir_Samsung.hpp
Go to the documentation of this file.
1 /*
2  * ir_Samsung.hpp
3  *
4  * Contains functions for receiving and sending Samsung IR Protocol in "raw" and standard format with 16 bit address and 16 or 32 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) 2017-2024 Darryl Smith, 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 CONSAMSUNGTION WITH THE SOFTWARE
28  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29  *
30  ************************************************************************************
31  */
32 #ifndef _IR_SAMSUNG_HPP
33 #define _IR_SAMSUNG_HPP
34 
35 #if defined(DEBUG) && !defined(LOCAL_DEBUG)
36 #define LOCAL_DEBUG
37 #else
38 //#define LOCAL_DEBUG // This enables debug output only for this file
39 #endif
40 
44 //==============================================================================
45 // SSSS AAA MMM SSSS U U N N GGGG
46 // S A A M M M S U U NN N G
47 // SSS AAAAA M M M SSS U U N N N G GG
48 // S A A M M S U U N NN G G
49 // SSSS A A M M SSSS UUU N N GGG
50 //==============================================================================
51 /*
52  * Address=0xFFF1 Command=0x76 Raw-Data=0x8976FFF1
53  +4500,-4400
54  + 600,-1600 + 650,- 500 + 600,- 500 + 650,- 500
55  + 600,-1650 + 600,-1600 + 650,-1600 + 600,-1650
56  + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1600
57  + 600,-1650 + 600,-1650 + 600,-1600 + 600,-1650
58  + 600,- 500 + 650,-1600 + 600,-1650 + 600,- 500
59  + 650,-1600 + 600,-1650 + 600,-1650 + 600,- 500
60  + 600,-1650 + 600,- 500 + 600,- 550 + 600,-1600
61  + 600,- 550 + 600,- 550 + 550,- 550 + 600,-1650
62  + 550
63  Sum: 68750
64  */
65 /*
66  * Samsung repeat frame can be the original frame again or a special short repeat frame,
67  * then we call the protocol SamsungLG. They differ only in the handling of repeat,
68  * so we can not decide for the first frame which protocol is used.
69  */
70 // see http://www.hifi-remote.com/wiki/index.php?title=DecodeIR#Samsung
71 // https://www.mikrocontroller.net/articles/IRMP_-_english#SAMSUNG32
72 // https://www.mikrocontroller.net/articles/IRMP_-_english#SAMSUNG48
73 // LSB first, 1 start bit + 16 bit address + 16 or 32 bit data + 1 stop bit.
74 // Here https://forum.arduino.cc/t/klimaanlage-per-ir-steuern/1051381/10 the address (0xB24D) is also 8 bits and then 8 inverted bits
75 //
76 // Here https://github.com/flipperdevices/flipperzero-firmware/blob/master/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c#L18
77 // Address is 8 bit + same 8 bit if command is 8 bit and ~8 bit.
78 //
79 // So we assume 8 bit address, if command is 8 bit and ~8 bit!
80 //
81 // IRP notation: {38k,5553}<1,-1|1,-3>(8,-8,D:8,S:8,F:8,~F:8,1,^110)+ ==> 8 bit + 8 bit inverted data - Samsung32
82 // IRP notation: {38k,5553}<1,-1|1,-3>(8,-8,D:8,S:8,F:16,1,^110)+ ==> 16 bit data - still Samsung32
83 // IRP notation: {38k,5553}<1,-1|1,-3>(8,-8,D:8,S:8,F:8,~F:8,G:8,~G:8,1,^110)+ ==> 2 x (8 bit + 8 bit inverted data) - Samsung48
84 //
85 #define SAMSUNG_ADDRESS_BITS 16
86 #define SAMSUNG_COMMAND16_BITS 16
87 #define SAMSUNG_COMMAND32_BITS 32
88 #define SAMSUNG_BITS (SAMSUNG_ADDRESS_BITS + SAMSUNG_COMMAND16_BITS)
89 #define SAMSUNG48_BITS (SAMSUNG_ADDRESS_BITS + SAMSUNG_COMMAND32_BITS)
90 
91 // except SAMSUNG_HEADER_MARK, values are like NEC
92 #define SAMSUNG_UNIT 560 // 21.28 periods of 38 kHz, 11.2 ticks TICKS_LOW = 8.358 TICKS_HIGH = 15.0
93 #define SAMSUNG_HEADER_MARK (8 * SAMSUNG_UNIT) // 4500 | 180 periods
94 #define SAMSUNG_HEADER_SPACE (8 * SAMSUNG_UNIT) // 4500
95 #define SAMSUNG_BIT_MARK SAMSUNG_UNIT
96 #define SAMSUNG_ONE_SPACE (3 * SAMSUNG_UNIT) // 1690 | 33.8 TICKS_LOW = 25.07 TICKS_HIGH = 45.0
97 #define SAMSUNG_ZERO_SPACE SAMSUNG_UNIT
98 
99 #define SAMSUNG_AVERAGE_DURATION 55000 // SAMSUNG_HEADER_MARK + SAMSUNG_HEADER_SPACE + 32 * 2,5 * SAMSUNG_UNIT + SAMSUNG_UNIT // 2.5 because we assume more zeros than ones
100 #define SAMSUNG_REPEAT_DURATION (SAMSUNG_HEADER_MARK + SAMSUNG_HEADER_SPACE + SAMSUNG_BIT_MARK + SAMSUNG_ZERO_SPACE + SAMSUNG_BIT_MARK)
101 #define SAMSUNG_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.
102 #define SAMSUNG_MAXIMUM_REPEAT_DISTANCE (SAMSUNG_REPEAT_PERIOD + (SAMSUNG_REPEAT_PERIOD / 4)) // 137000 - Just a guess
103 
104 // 19 byte RAM
108 
112 /************************************
113  * Start of send and decode functions
114  ************************************/
115 
122  enableIROut (SAMSUNG_KHZ); // 38 kHz
123  mark(SAMSUNG_HEADER_MARK); // + 4500
124  space(SAMSUNG_HEADER_SPACE); // - 4500
125  mark(SAMSUNG_BIT_MARK); // + 560
126  space(SAMSUNG_ZERO_SPACE); // - 560
127  mark(SAMSUNG_BIT_MARK); // + 560
128 }
129 
136  IrSender.enableIROut(SAMSUNG_KHZ); // 38 kHz
137  IrSender.mark(SAMSUNG_HEADER_MARK); // + 4500
139  IrSender.mark(SAMSUNG_BIT_MARK); // + 560
141  IrSender.mark(SAMSUNG_BIT_MARK); // + 560
142 }
143 
144 /*
145  * Sent e.g. by an LG 6711R1P071A remote
146  * @param aNumberOfRepeats If < 0 then only a special repeat frame will be sent
147  */
148 void IRsend::sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
149  if (aNumberOfRepeats < 0) {
151  return;
152  }
153 
154  // send 16 bit address and 8 command bits and then 8 inverted command bits LSB first
155  LongUnion tRawData;
156  tRawData.UWord.LowWord = aAddress;
157  tRawData.UByte.MidHighByte = aCommand;
158  tRawData.UByte.HighByte = ~aCommand;
159 
161 }
162 
171 void IRsend::sendSamsung(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
172 
173  LongUnion tSendValue;
174  if (aAddress < 0x100) {
175  // This makes it flipper IRDB compatible:
176  // https://github.com/flipperdevices/flipperzero-firmware/blob/master/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c#L18
177  // Duplicate address byte, if address is only 8 bit
178  tSendValue.UBytes[1] = aAddress;
179  tSendValue.UBytes[0] = aAddress;
180  } else {
181  tSendValue.UWords[0] = aAddress;
182  }
183 
184  if (aCommand < 0x100) {
185  // Send 8 command bits and then 8 inverted command bits LSB first
186  tSendValue.UBytes[2] = aCommand;
187  tSendValue.UBytes[3] = ~aCommand;
188 
189  } else {
190  // Send 16 command bits
191  tSendValue.UWords[1] = aCommand;
192  }
193 
195 }
196 
202 void IRsend::sendSamsung16BitAddressAnd8BitCommand(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
203 
204  LongUnion tSendValue;
205  // send 16 bit address
206  tSendValue.UWords[0] = aAddress;
207  // Send 8 command bits and then 8 inverted command bits LSB first
208  tSendValue.UBytes[2] = aCommand;
209  tSendValue.UBytes[3] = ~aCommand;
210 
212 }
213 
219 void IRsend::sendSamsung16BitAddressAndCommand(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
220 
221  LongUnion tSendValue;
222  // send 16 bit address
223  tSendValue.UWords[0] = aAddress;
224  // Send 16 command bits
225  tSendValue.UWords[1] = aCommand;
226 
228 }
233 void IRsend::sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats) {
234 
235  // send 16 bit address and 2 x ( 8 command bits and then 8 inverted command bits) LSB first
236 #if __INT_WIDTH__ < 32
237  uint32_t tRawSamsungData[2]; // prepare 2 long for Samsung48
238 
239  LongUnion tSendValue;
240  tSendValue.UWords[0] = aAddress;
241  tSendValue.UBytes[2] = aCommand;
242  tSendValue.UBytes[3] = ~aCommand;
243  uint8_t tUpper8BitsOfCommand = aCommand >> 8;
244  tRawSamsungData[1] = tUpper8BitsOfCommand | (~tUpper8BitsOfCommand) << 8;
245  tRawSamsungData[0] = tSendValue.ULong;
246 
248 #else
249  LongLongUnion tSendValue;
250  tSendValue.UWords[0] = aAddress;
251  if (aCommand < 0x10000) {
252  tSendValue.UBytes[2] = aCommand;
253  tSendValue.UBytes[3] = ~aCommand;
254  uint8_t tUpper8BitsOfCommand = aCommand >> 8;
255  tSendValue.UBytes[4] = tUpper8BitsOfCommand;
256  tSendValue.UBytes[5] = ~tUpper8BitsOfCommand;
257  } else {
258  tSendValue.ULongLong = aAddress | aCommand << 16;
259  }
261 #endif
262 }
263 
264 /*
265  * We cannot decode frames with 8 command bits and then 8 inverted command bits LSB and 16 bit address,
266  * because in this case we always assume 8 bit address.
267  * This is, because we did not see 8 bit command and real 16 bit address in the wild.
268  */
270 
271  // Check we have enough data (68). The +4 is for initial gap, start bit mark and space + stop bit mark
272  if (decodedIRData.rawlen != ((2 * SAMSUNG_BITS) + 4) && decodedIRData.rawlen != ((2 * SAMSUNG48_BITS) + 4)
273  && (decodedIRData.rawlen != 6)) {
274  IR_DEBUG_PRINT(F("Samsung: "));
275  IR_DEBUG_PRINT(F("Data length="));
277  IR_DEBUG_PRINTLN(F(" is not 6 or 68 or 100"));
278  return false;
279  }
280 
282  return false;
283  }
284 
285  // Check for SansungLG style repeat
286  if (decodedIRData.rawlen == 6) {
291  return true;
292  }
293 
294  /*
295  * Decode first 32 bits
296  */
298 #if defined(LOCAL_DEBUG)
299  Serial.print(F("Samsung: "));
300  Serial.println(F("Decode failed"));
301 #endif
302  return false;
303  }
304  LongUnion tValue;
307 
308  if (decodedIRData.rawlen == (2 * SAMSUNG48_BITS) + 4) {
309  /*
310  * Samsung48
311  */
312  // decode additional 16 bit
314  3 + (2 * SAMSUNG_BITS))) {
315 #if defined(LOCAL_DEBUG)
316  Serial.print(F("Samsung: "));
317  Serial.println(F("Decode failed"));
318 #endif
319  return false;
320  }
321 
322  /*
323  * LSB data is already in tValue.UWord.HighWord!
324  * Put latest (MSB) bits in LowWord, LSB first would have them expect in HighWord so keep this in mind for decoding below
325  */
326  tValue.UWord.LowWord = decodedIRData.decodedRawData; // We have only 16 bit in decodedRawData here
327 #if __INT_WIDTH__ >= 32
328  // workaround until complete refactoring for 64 bit
329  decodedIRData.decodedRawData = (decodedIRData.decodedRawData << 32)| tValue.UWord.HighWord << 16 | decodedIRData.address; // store all 48 bits in decodedRawData
330 #endif
331 
332  /*
333  * Check parity of 32 bit command
334  */
335  // receive 2 * (8 bits then 8 inverted bits) LSB first
336  if (tValue.UByte.MidHighByte != (uint8_t)(~tValue.UByte.HighByte)
337  && tValue.UByte.LowByte != (uint8_t)(~tValue.UByte.MidLowByte)) {
339  }
340 
341  decodedIRData.command = tValue.UByte.LowByte << 8 | tValue.UByte.MidHighByte; // low and high word are swapped here, so fetch it this way
344 
345  } else {
346  /*
347  * Samsung32
348  */
349  if (tValue.UByte.MidHighByte == (uint8_t)(~tValue.UByte.HighByte)) {
350  // 8 bit command protocol -> assume 8 bit address
351  decodedIRData.command = tValue.UByte.MidHighByte; // first 8 bit
352  decodedIRData.address = tValue.UByte.LowByte; // assume LowByte == MidLowByte
353  } else {
354  // 16 bit command protocol, address is filled above with the 16 bit value
355  decodedIRData.command = tValue.UWord.HighWord; // first 16 bit
356  }
359  }
360 
361  // check for repeat
363 
364  return true;
365 }
366 
367 // Old version with MSB first
369  unsigned int offset = 1; // Skip first space
370 
371  // Initial mark
372  if (!matchMark(aResults->rawbuf[offset], SAMSUNG_HEADER_MARK)) {
373  return false;
374  }
375  offset++;
376 
377  // Check for repeat -- like a NEC repeat
378  if ((aResults->rawlen == 4) && matchSpace(aResults->rawbuf[offset], 2250)
379  && matchMark(aResults->rawbuf[offset + 1], SAMSUNG_BIT_MARK)) {
380  aResults->bits = 0;
381  aResults->value = 0xFFFFFFFF;
384  return true;
385  }
386  if (aResults->rawlen < (2 * SAMSUNG_BITS) + 4) {
387  return false;
388  }
389 
390  // Initial space
391  if (!matchSpace(aResults->rawbuf[offset], SAMSUNG_HEADER_SPACE)) {
392  return false;
393  }
394  offset++;
395 
397  return false;
398  }
399 
400  // Success
401  aResults->value = decodedIRData.decodedRawData;
402  aResults->bits = SAMSUNG_BITS;
403  aResults->decode_type = SAMSUNG;
405  return true;
406 }
407 
408 // Old version with MSB first
409 void IRsend::sendSamsungMSB(unsigned long data, int nbits) {
410  // Set IR carrier frequency
412 
413  // Header
416 
417  // Old version with MSB first Data + stop bit
420 }
421 void IRsend::sendSAMSUNG(unsigned long data, int nbits) {
422  sendSamsungMSB(data, nbits);
423 }
424 
426 #if defined(LOCAL_DEBUG)
427 #undef LOCAL_DEBUG
428 #endif
429 #endif // _IR_SAMSUNG_HPP
IRData::address
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
Definition: IRProtocol.h:110
LongLongUnion::UBytes
uint8_t UBytes[8]
Definition: LongUnion.h:138
MICROS_PER_TICK
#define MICROS_PER_TICK
microseconds per clock interrupt tick
Definition: IRremote.hpp:250
LongUnion
Union to specify parts / manifestations of a 32 bit Long without casts and shifts.
Definition: LongUnion.h:59
SAMSUNG_HEADER_SPACE
#define SAMSUNG_HEADER_SPACE
Definition: ir_Samsung.hpp:94
decode_results
Results returned from old decoders !!!deprecated!!!
Definition: IRremoteInt.h:183
decode_results::rawbuf
uint16_t * rawbuf
Definition: IRremoteInt.h:194
IRsend::sendSamsungMSB
void sendSamsungMSB(unsigned long data, int nbits)
Definition: ir_Samsung.hpp:409
PROTOCOL_IS_MSB_FIRST
#define PROTOCOL_IS_MSB_FIRST
Definition: IRProtocol.h:147
IRData::numberOfBits
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
Definition: IRProtocol.h:119
IRsend::aNumberOfRepeats
void int_fast8_t aNumberOfRepeats
Definition: IRremoteInt.h:547
MICROS_IN_ONE_MILLI
#define MICROS_IN_ONE_MILLI
Definition: IRremote.hpp:255
LongUnion::UByte
struct LongUnion::@4 UByte
SamsungProtocolConstants
struct PulseDistanceWidthProtocolConstants SamsungProtocolConstants
Definition: ir_Samsung.hpp:105
IRsend::mark
void mark(uint16_t aMarkMicros)
Sends an IR mark for the specified number of microseconds.
Definition: IRSend.hpp:947
IRsend::sendSamsungLGRepeat
void sendSamsungLGRepeat()
Send repeat Repeat commands should be sent in a 110 ms raster.
Definition: ir_Samsung.hpp:121
IRsend::sendSamsung48
void sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats)
Here we send Samsung48 We send 2 x (8 bit command and then ~command)
Definition: ir_Samsung.hpp:233
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:92
LongUnion::UBytes
uint8_t UBytes[4]
Definition: LongUnion.h:91
IRsend::sendPulseDistanceWidth
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Sends PulseDistance frames and repeats.
Definition: IRSend.hpp:691
SAMSUNG
@ SAMSUNG
Definition: IRProtocol.h:60
LongUnion::LowByte
uint8_t LowByte
Definition: LongUnion.h:61
LongUnion::HighByte
uint8_t HighByte
Definition: LongUnion.h:64
decode_results::bits
uint8_t bits
Definition: IRremoteInt.h:189
decode_results::decode_type
decode_type_t decode_type
Definition: IRremoteInt.h:186
IRData::decodedRawData
IRRawDataType decodedRawData
Up to 32/64 bit decoded raw data, to be used for send functions.
Definition: IRProtocol.h:113
IRrecv::checkForRepeatSpaceTicksAndSetFlag
void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks)
Definition: IRReceive.hpp:1150
IR_DEBUG_PRINT
#define IR_DEBUG_PRINT(...)
If DEBUG, print the arguments, otherwise do nothing.
Definition: IRremoteInt.h:161
LongUnion::LowWord
uint16_t LowWord
Definition: LongUnion.h:80
SAMSUNG_BITS
#define SAMSUNG_BITS
Definition: ir_Samsung.hpp:88
matchSpace
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
Definition: IRReceive.hpp:1227
LongLongUnion
Union to specify parts / manifestations of a 64 bit LongLong without casts and shifts.
Definition: LongUnion.h:107
IRsend::sendSamsung
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 If we get an ad...
Definition: ir_Samsung.hpp:171
IRDATA_FLAGS_PARITY_FAILED
#define IRDATA_FLAGS_PARITY_FAILED
The current (autorepeat) frame violated parity check.
Definition: IRProtocol.h:94
decode_results::value
uint32_t value
Definition: IRremoteInt.h:188
LongUnion::MidLowByte
uint8_t MidLowByte
Definition: LongUnion.h:62
IRrecv::decodeSAMSUNG
bool decodeSAMSUNG(decode_results *aResults)
Definition: ir_Samsung.hpp:368
PulseDistanceWidthProtocolConstants
Definition: IRProtocol.h:134
LongUnion::HighWord
uint16_t HighWord
Definition: LongUnion.h:81
IRrecv::decodedIRData
IRData decodedIRData
Definition: IRremoteInt.h:358
SAMSUNG_KHZ
#define SAMSUNG_KHZ
Definition: IRProtocol.h:162
IRsend::sendSamsung16BitAddressAndCommand
void sendSamsung16BitAddressAndCommand(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Maybe no one needs it in the wild...
Definition: ir_Samsung.hpp:219
IRrecv::decodeSamsung
bool decodeSamsung()
Definition: ir_Samsung.hpp:269
IRData::flags
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
Definition: IRProtocol.h:120
IRsend::sendSamsungLG
void sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Definition: ir_Samsung.hpp:148
PROTOCOL_IS_LSB_FIRST
#define PROTOCOL_IS_LSB_FIRST
Definition: IRProtocol.h:148
SAMSUNG_BIT_MARK
#define SAMSUNG_BIT_MARK
Definition: ir_Samsung.hpp:95
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:98
sendSamsungLGSpecialRepeat
void sendSamsungLGSpecialRepeat()
Like above, but implemented as a static function Used for sending special repeat frame.
Definition: ir_Samsung.hpp:135
IRrecv::checkHeader
bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants)
Definition: IRReceive.hpp:1126
IRrecv::decodePulseDistanceWidthData
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
Definition: IRReceive.hpp:954
IRData::command
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
Definition: IRProtocol.h:111
SAMSUNG_MAXIMUM_REPEAT_DISTANCE
#define SAMSUNG_MAXIMUM_REPEAT_DISTANCE
Definition: ir_Samsung.hpp:102
SAMSUNG_COMMAND16_BITS
#define SAMSUNG_COMMAND16_BITS
Definition: ir_Samsung.hpp:86
SAMSUNG_ZERO_SPACE
#define SAMSUNG_ZERO_SPACE
Definition: ir_Samsung.hpp:97
matchMark
bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
Definition: IRReceive.hpp:1193
LongUnion::ULong
uint32_t ULong
Definition: LongUnion.h:95
IrSender
IRsend IrSender
Definition: IRSend.hpp:65
SAMSUNG48_BITS
#define SAMSUNG48_BITS
Definition: ir_Samsung.hpp:89
IRsend::sendSamsung16BitAddressAnd8BitCommand
void sendSamsung16BitAddressAnd8BitCommand(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
Maybe no one needs it in the wild...
Definition: ir_Samsung.hpp:202
IRrecv::lastDecodedCommand
uint32_t lastDecodedCommand
Definition: IRremoteInt.h:363
IRDATA_FLAGS_IS_LSB_FIRST
#define IRDATA_FLAGS_IS_LSB_FIRST
Definition: IRProtocol.h:101
LongLongUnion::UWords
uint16_t UWords[4]
Definition: LongUnion.h:140
LongLongUnion::ULongLong
uint64_t ULongLong
Definition: LongUnion.h:142
SAMSUNG_REPEAT_PERIOD
#define SAMSUNG_REPEAT_PERIOD
Definition: ir_Samsung.hpp:101
SAMSUNG_HEADER_MARK
#define SAMSUNG_HEADER_MARK
Definition: ir_Samsung.hpp:93
IRsend::space
static void space(uint16_t aSpaceMicros)
Sends an IR space for the specified number of microseconds.
Definition: IRSend.hpp:1148
SAMSUNG_COMMAND32_BITS
#define SAMSUNG_COMMAND32_BITS
Definition: ir_Samsung.hpp:87
SAMSUNG_ONE_SPACE
#define SAMSUNG_ONE_SPACE
Definition: ir_Samsung.hpp:96
IRData::rawlen
IRRawlenType rawlen
counter of entries in rawbuf of last received frame.
Definition: IRProtocol.h:128
LongUnion::MidHighByte
uint8_t MidHighByte
Definition: LongUnion.h:63
LongUnion::UWords
uint16_t UWords[2]
Definition: LongUnion.h:93
IRsend::sendSAMSUNG
void sendSAMSUNG(unsigned long data, int nbits)
Definition: ir_Samsung.hpp:421
LongUnion::UWord
struct LongUnion::@6 UWord
IRsend::sendPulseDistanceWidthFromArray
void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros, uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats)
Definition: IRSend.hpp:535
SamsungLGProtocolConstants
struct PulseDistanceWidthProtocolConstants SamsungLGProtocolConstants
Definition: ir_Samsung.hpp:109
IRsend::sendPulseDistanceWidthData
void sendPulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits)
Sends PulseDistance from data contained in parameter using ProtocolConstants structure for timing etc...
Definition: IRSend.hpp:812
IRrecv::lastDecodedAddress
uint32_t lastDecodedAddress
Definition: IRremoteInt.h:362
IR_DEBUG_PRINTLN
#define IR_DEBUG_PRINTLN(...)
If DEBUG, print the arguments as a line, otherwise do nothing.
Definition: IRremoteInt.h:165
SAMSUNGLG
@ SAMSUNGLG
Definition: IRProtocol.h:61
decode_results::rawlen
uint_fast8_t rawlen
Definition: IRremoteInt.h:195
IRData::protocol
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
Definition: IRProtocol.h:109
SAMSUNG48
@ SAMSUNG48
Definition: IRProtocol.h:62
IRsend::aCommand
void aCommand
Definition: IRremoteInt.h:610
IRsend::enableIROut
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
Definition: IRSend.hpp:1188