IRremote
ir_Whynter.hpp
Go to the documentation of this file.
1 #ifndef _IR_WHYNTER_HPP
2 #define _IR_WHYNTER_HPP
3 
4 #include <Arduino.h>
5 
6 //#define DEBUG // Activate this for lots of lovely debug output from this decoder.
7 #include "IRremoteInt.h" // evaluates the DEBUG for IR_DEBUG_PRINT
8 
12 //==============================================================================
13 // W W H H Y Y N N TTTTT EEEEE RRRRR
14 // W W H H Y Y NN N T E R R
15 // W W W HHHHH Y N N N T EEE RRRR
16 // W W W H H Y N NN T E R R
17 // WWW H H Y N N T EEEEE R R
18 //==============================================================================
19 // Whynter A/C ARC-110WD added by Francesco Meschia
20 // see https://docs.google.com/spreadsheets/d/1dsr4Jh-nzC6xvSKGpLlPBF0NRwvlpyw-ozg8eZU813w/edit#gid=0
21 #define WHYNTER_BITS 32
22 #define WHYNTER_HEADER_MARK 2850
23 #define WHYNTER_HEADER_SPACE 2850
24 #define WHYNTER_BIT_MARK 750
25 #define WHYNTER_ONE_SPACE 2150
26 #define WHYNTER_ZERO_SPACE 750
27 
28 //+=============================================================================
29 void IRsend::sendWhynter(unsigned long data, int nbits) {
30  // Set IR carrier frequency
31  enableIROut(38);
32 
33  // Start
36 
37  // Header
40 
41  // Data + stop bit
46 }
47 
48 //+=============================================================================
50 
51  // Check we have the right amount of data (68). The +4 is for initial gap, start bit mark and space + stop bit mark.
52  if (decodedIRData.rawDataPtr->rawlen != (2 * WHYNTER_BITS) + 4) {
53  return false;
54  }
55 
56  // Sequence begins with a bit mark and a zero space
59  IR_DEBUG_PRINT(F("Whynter: "));
60  IR_DEBUG_PRINTLN(F("Header mark or space length is wrong"));
61  return false;
62  }
63 
65  return false;
66  }
67 
68  // trailing mark / stop bit
70  IR_DEBUG_PRINTLN(F("Stop bit mark length is wrong"));
71  return false;
72  }
73 
74  // Success
78  return true;
79 }
80 
82 #endif // _IR_WHYNTER_HPP
PROTOCOL_IS_MSB_FIRST
#define PROTOCOL_IS_MSB_FIRST
Definition: IRProtocol.h:75
WHYNTER_ONE_SPACE
#define WHYNTER_ONE_SPACE
Definition: ir_Whynter.hpp:25
IRData::numberOfBits
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
Definition: IRremoteInt.h:155
WHYNTER_HEADER_SPACE
#define WHYNTER_HEADER_SPACE
Definition: ir_Whynter.hpp:23
IRsend::mark
void mark(unsigned int aMarkMicros)
Sends an IR mark for the specified number of microseconds.
Definition: IRSend.hpp:433
IRrecv::restartAfterSend
void restartAfterSend()
Restarts receiver after send.
Definition: IRReceive.hpp:161
IRDATA_FLAGS_IS_MSB_FIRST
#define IRDATA_FLAGS_IS_MSB_FIRST
Just for info. Value is mainly determined by the protocol.
Definition: IRremoteInt.h:140
IRData::rawDataPtr
irparams_struct * rawDataPtr
Pointer of the raw timing data to be decoded. Mainly the data buffer filled by receiving ISR.
Definition: IRremoteInt.h:161
WHYNTER_HEADER_MARK
#define WHYNTER_HEADER_MARK
Definition: ir_Whynter.hpp:22
IR_DEBUG_PRINT
#define IR_DEBUG_PRINT(...)
If DEBUG, print the arguments, otherwise do nothing.
Definition: IRremoteInt.h:110
IRrecv::decodePulseDistanceData
bool decodePulseDistanceData(uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset, unsigned int aBitMarkMicros, unsigned int aOneSpaceMicros, unsigned int aZeroSpaceMicros, bool aMSBfirst)
Decode pulse distance protocols.
Definition: IRReceive.hpp:514
irparams_struct::rawlen
uint_fast8_t rawlen
counter of entries in rawbuf
Definition: IRremoteInt.h:93
WHYNTER_ZERO_SPACE
#define WHYNTER_ZERO_SPACE
Definition: ir_Whynter.hpp:26
IRrecv::decodedIRData
IRData decodedIRData
Definition: IRremoteInt.h:308
matchSpace
bool matchSpace(unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
Definition: IRReceive.hpp:819
SEND_STOP_BIT
#define SEND_STOP_BIT
Definition: IRremoteInt.h:401
IRData::flags
uint8_t flags
See IRDATA_FLAGS_* definitions above.
Definition: IRremoteInt.h:156
WHYNTER_BIT_MARK
#define WHYNTER_BIT_MARK
Definition: ir_Whynter.hpp:24
irparams_struct::rawbuf
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...
Definition: IRremoteInt.h:97
IRsend::sendWhynter
void sendWhynter(unsigned long data, int nbits)
Definition: ir_Whynter.hpp:29
IRsend::space
void space(unsigned int aSpaceMicros)
Sends an IR space for the specified number of microseconds.
Definition: IRSend.hpp:593
WHYNTER
@ WHYNTER
Definition: IRProtocol.h:68
IR_DEBUG_PRINTLN
#define IR_DEBUG_PRINTLN(...)
If DEBUG, print the arguments as a line, otherwise do nothing.
Definition: IRremoteInt.h:114
WHYNTER_BITS
#define WHYNTER_BITS
Definition: ir_Whynter.hpp:21
matchMark
bool matchMark(unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
Definition: IRReceive.hpp:786
IRData::protocol
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, ...
Definition: IRremoteInt.h:151
IRsend::sendPulseDistanceWidthData
void sendPulseDistanceWidthData(unsigned int aOneMarkMicros, unsigned int aOneSpaceMicros, unsigned int aZeroMarkMicros, unsigned int aZeroSpaceMicros, uint32_t aData, uint_fast8_t aNumberOfBits, bool aMSBfirst, bool aSendStopBit=false)
Sends PulseDistance data The output always ends with a space.
Definition: IRSend.hpp:345
IRremoteInt.h
Contains all declarations required for the interface to IRremote. Could not be named IRremote....
IrReceiver
IRrecv IrReceiver
The receiver instance.
Definition: IRReceive.hpp:42
IRsend::enableIROut
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
Definition: IRSend.hpp:617
IRrecv::decodeWhynter
bool decodeWhynter()
Definition: ir_Whynter.hpp:49