Go to the documentation of this file.
35 #if defined(DEBUG) && !defined(LOCAL_DEBUG)
66 #define JVC_ADDRESS_BITS 8 // 8 bit address
67 #define JVC_COMMAND_BITS 8 // Command
69 #define JVC_BITS (JVC_ADDRESS_BITS + JVC_COMMAND_BITS) // 16 - The number of bits in the protocol
70 #define JVC_UNIT 526 // 20 periods of 38 kHz (526.315789)
72 #define JVC_HEADER_MARK (16 * JVC_UNIT) // 8400
73 #define JVC_HEADER_SPACE (8 * JVC_UNIT) // 4200
75 #define JVC_BIT_MARK JVC_UNIT // The length of a Bit:Mark
76 #define JVC_ONE_SPACE (3 * JVC_UNIT) // 1578 - The length of a Bit:Space for 1's
77 #define JVC_ZERO_SPACE JVC_UNIT // The length of a Bit:Space for 0's
79 #define JVC_REPEAT_DISTANCE (uint16_t)(45 * JVC_UNIT) // 23625 - Commands are repeated with a distance of 23 ms for as long as the key on the remote control is held down.
80 #define JVC_REPEAT_PERIOD 65000 // assume around 40 ms for a JVC frame. JVC IR Remotes: RM-SA911U, RM-SX463U have 45 ms period
92 void IRsend::sendJVC(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
105 while (tNumberOfCommands > 0) {
112 if (tNumberOfCommands > 0) {
156 #if defined(LOCAL_DEBUG)
157 Serial.print(F(
"JVC: "));
158 Serial.println(F(
"Decode failed"));
178 unsigned int offset = 1;
184 aResults->
value = 0xFFFFFFFF;
216 #if defined(LOCAL_DEBUG)
217 Serial.println(F(
"Stop bit mark length is wrong"));
257 #if defined(LOCAL_DEBUG)
260 #endif // _IR_JVC_HPP
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
#define MICROS_PER_TICK
microseconds per clock interrupt tick
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
void sendJVC(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
The JVC protocol repeats by skipping the header mark and space -> this leads to a poor repeat detecti...
#define MICROS_IN_ONE_MILLI
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....
irparams_struct * rawDataPtr
Pointer of the raw timing data to be decoded. Mainly the OverflowFlag and the data buffer filled by r...
decode_type_t decode_type
IRRawDataType decodedRawData
Up to 32/64 bit decoded raw data, to be used for send functions.
#define IR_DEBUG_PRINT(...)
If DEBUG, print the arguments, otherwise do nothing.
#define JVC_REPEAT_PERIOD
struct PulseDistanceWidthProtocolConstants JVCProtocolConstants
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
#define PROTOCOL_IS_LSB_FIRST
bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants)
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.
#define JVC_REPEAT_DISTANCE
IRRawbufType rawbuf[RAW_BUFFER_LENGTH]
raw data / tick counts per mark/space. With 8 bit we can only store up to 12.7 ms....
void sendJVCMSB(unsigned long data, int nbits, bool repeat=false)
With Send sendJVCMSB() you can send your old 32 bit codes.
uint32_t lastDecodedCommand
#define IRDATA_FLAGS_IS_LSB_FIRST
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.
void sendPulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits)
Sends PulseDistance from data contained in parameter using ProtocolConstants structure for timing etc...
uint32_t lastDecodedAddress
#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.
bool decodeJVCMSB(decode_results *aResults)