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) {
149 #if !defined(DISABLE_CODE_FOR_RECEIVER)
172 #if defined(LOCAL_DEBUG)
173 Serial.print(F(
"Denon: "));
174 Serial.println(F(
"Decode failed"));
181 #if defined(LOCAL_DEBUG)
182 Serial.print(F(
"Denon: "));
183 Serial.println(F(
"Stop bit mark length is wrong"));
201 if (tFrameBits & 0x01) {
205 #if defined(LOCAL_DEBUG)
206 Serial.print(F(
"Denon: "));
207 Serial.println(F(
"Autorepeat received="));
213 #if defined(LOCAL_DEBUG)
214 Serial.print(F(
"Denon: "));
215 Serial.print(F(
"Parity check for repeat failed last command="));
217 Serial.print(F(
" current="));
226 if (tFrameBits == 1 || tFrameBits == 2 ) {
234 if (tFrameBits == 2) {
262 #if !(defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__))
264 "The function sendDenon(data, nbits) is deprecated and may not work as expected! Use sendDenonRaw(data, NumberOfRepeats) or better sendDenon(Address, Command, NumberOfRepeats).");
274 #if !defined(DISABLE_CODE_FOR_RECEIVER)
316 #if defined(LOCAL_DEBUG)
319 #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 uint8_t int_fast8_t aNumberOfRepeats
#define MICROS_IN_ONE_MILLI
struct PulseDistanceWidthProtocolConstants DenonProtocolConstants
void mark(unsigned int aMarkMicros)
Sends an IR mark for the specified number of microseconds.
#define IRDATA_FLAGS_IS_REPEAT
void restartAfterSend()
Restarts receiver after send.
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
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.
#define DENON_REPEAT_PERIOD
uint_fast8_t rawlen
counter of entries in rawbuf
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
#define DENON_HEADER_SPACE
#define IRDATA_FLAGS_PARITY_FAILED
the current (autorepeat) frame violated parity check
bool matchSpace(unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
uint8_t flags
See IRDATA_FLAGS_* definitions above.
#define PROTOCOL_IS_LSB_FIRST
void sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
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...
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp=false)
bool decodeDenonOld(decode_results *aResults)
uint32_t lastDecodedCommand
static void space(unsigned int aSpaceMicros)
Sends an IR space for the specified number of microseconds.
#define DENON_AUTO_REPEAT_DISTANCE
void sendDenonRaw(uint16_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS) void sendJVC(uint8_t aAddress
#define DENON_ADDRESS_BITS
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...
#define IR_DEBUG_PRINTLN(...)
If DEBUG, print the arguments as a line, otherwise do nothing.
bool matchMark(unsigned int aMeasuredTicks, unsigned int aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
IRrecv IrReceiver
The receiver instance.
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.