Go to the documentation of this file.
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
131 void IRsend::sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t aSendSharpFrameMarker) {
138 tCommand |= aSendSharpFrameMarker << 8;
141 uint16_t tInvertedData = (tData ^ 0x7FE0);
144 while (tNumberOfCommands > 0) {
183 #if defined(LOCAL_DEBUG)
184 Serial.print(F(
"Denon: "));
185 Serial.println(F(
"Decode failed"));
192 #if defined(LOCAL_DEBUG)
193 Serial.print(F(
"Denon: "));
194 Serial.println(F(
"Stop bit mark length is wrong"));
212 if (tFrameBits & 0x01) {
216 #if defined(LOCAL_DEBUG)
217 Serial.print(F(
"Denon: "));
218 Serial.println(F(
"Autorepeat received="));
224 #if defined(LOCAL_DEBUG)
225 Serial.print(F(
"Denon: "));
226 Serial.print(F(
"Parity check for repeat failed. Last command="));
228 Serial.print(F(
" current="));
237 if (tFrameBits == 1 || tFrameBits == 2) {
245 if (tFrameBits == 2) {
273 #if !(defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__))
324 #if defined(LOCAL_DEBUG)
327 #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
void sendSharp2(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
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
void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t aSendSharpFrameMarker=0)
#define IRDATA_FLAGS_PARITY_FAILED
The current (autorepeat) frame violated parity check.
void sendPulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRRawDataType aData, uint_fast8_t aNumberOfBits)
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.
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)
uint16_t lastDecodedCommand
struct PulseDistanceWidthProtocolConstants const DenonProtocolConstants PROGMEM
bool decodePulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
#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.