Go to the documentation of this file.
35 #if defined(DEBUG) && !defined(LOCAL_DEBUG)
90 #define DENON_ADDRESS_BITS 5
91 #define DENON_COMMAND_BITS 8
92 #define DENON_FRAME_BITS 2 // 00/10 for 1. frame Denon/Sharp, inverted for autorepeat frame
94 #define DENON_BITS (DENON_ADDRESS_BITS + DENON_COMMAND_BITS + DENON_FRAME_BITS) // 15 - The number of bits in the command
95 #define DENON_UNIT 260
97 #define DENON_BIT_MARK DENON_UNIT // The length of a Bit:Mark
98 #define DENON_ONE_SPACE (7 * DENON_UNIT) // 1820 // The length of a Bit:Space for 1's
99 #define DENON_ZERO_SPACE (3 * DENON_UNIT) // 780 // The length of a Bit:Space for 0's
101 #define DENON_AUTO_REPEAT_DISTANCE 45000 // Every frame is auto repeated with a space period of 45 ms and the command and frame inverted.
102 #define DENON_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.
105 #define DENON_HEADER_MARK DENON_UNIT // The length of the Header:Mark
106 #define DENON_HEADER_SPACE (3 * DENON_UNIT) // 780 // The length of the Header:Space
120 void IRsend::sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats,
bool aSendSharp) {
130 uint16_t tInvertedData = (tData ^ 0x7FE0);
133 while (tNumberOfCommands > 0) {
144 if (tNumberOfCommands > 0) {
169 #if defined(LOCAL_DEBUG)
170 Serial.print(F(
"Denon: "));
171 Serial.println(F(
"Decode failed"));
178 #if defined(LOCAL_DEBUG)
179 Serial.print(F(
"Denon: "));
180 Serial.println(F(
"Stop bit mark length is wrong"));
198 if (tFrameBits & 0x01) {
202 #if defined(LOCAL_DEBUG)
203 Serial.print(F(
"Denon: "));
204 Serial.println(F(
"Autorepeat received="));
210 #if defined(LOCAL_DEBUG)
211 Serial.print(F(
"Denon: "));
212 Serial.print(F(
"Parity check for repeat failed. Last command="));
214 Serial.print(F(
" current="));
223 if (tFrameBits == 1 || tFrameBits == 2) {
231 if (tFrameBits == 2) {
259 #if !(defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__))
310 #if defined(LOCAL_DEBUG)
313 #endif // _IR_DENON_HPP
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
#define MICROS_PER_TICK
microseconds per clock interrupt tick
#define DENON_COMMAND_BITS
Results returned from old decoders !!!deprecated!!!
#define PROTOCOL_IS_MSB_FIRST
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
void int_fast8_t aNumberOfRepeats
#define MICROS_IN_ONE_MILLI
struct PulseDistanceWidthProtocolConstants DenonProtocolConstants
void mark(uint16_t aMarkMicros)
Sends an IR mark for the specified number of microseconds.
#define IRDATA_FLAGS_IS_REPEAT
The gap between the preceding frame is as smaller than the maximum gap expected for a repeat....
void sendDenonRaw(uint16_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS) void sendFAST(uint8_t aCommand
irparams_struct * rawDataPtr
Pointer of the raw timing data to be decoded. Mainly the OverflowFlag and the data buffer filled by r...
#define IRDATA_FLAGS_IS_AUTO_REPEAT
The current repeat frame is a repeat, that is always sent after a regular frame and cannot be avoided...
decode_type_t decode_type
IRRawDataType decodedRawData
Up to 32/64 bit decoded raw data, to be used for send functions.
#define DENON_HEADER_MARK
#define IR_DEBUG_PRINT(...)
If DEBUG, print the arguments, otherwise do nothing.
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
#define DENON_REPEAT_PERIOD
#define DENON_HEADER_SPACE
#define IRDATA_FLAGS_PARITY_FAILED
The current (autorepeat) frame violated parity check.
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
#define PROTOCOL_IS_LSB_FIRST
void sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp=false)
IRRawbufType rawbuf[RAW_BUFFER_LENGTH]
raw data / tick counts per mark/space. With 8 bit we can only store up to 12.7 ms....
bool decodeDenonOld(decode_results *aResults)
uint32_t lastDecodedCommand
#define DENON_AUTO_REPEAT_DISTANCE
static void space(uint16_t aSpaceMicros)
Sends an IR space for the specified number of microseconds.
IRRawlenType rawlen
counter of entries in rawbuf of last received frame.
#define DENON_ADDRESS_BITS
void sendPulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits)
Sends PulseDistance from data contained in parameter using ProtocolConstants structure for timing etc...
#define IR_DEBUG_PRINTLN(...)
If DEBUG, print the arguments as a line, otherwise do nothing.
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
uint16_t initialGapTicks
contains the initial gap (pre 4.4: the value in rawbuf[0]) of the last received frame.
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.