Go to the documentation of this file.
32 #ifndef _IR_KASEIKYO_HPP
33 #define _IR_KASEIKYO_HPP
35 #if defined(DEBUG) && !defined(LOCAL_DEBUG)
88 #define KASEIKYO_VENDOR_ID_BITS 16
89 #define KASEIKYO_VENDOR_ID_PARITY_BITS 4
90 #define KASEIKYO_ADDRESS_BITS 12
91 #define KASEIKYO_COMMAND_BITS 8
92 #define KASEIKYO_PARITY_BITS 8
93 #define KASEIKYO_BITS (KASEIKYO_VENDOR_ID_BITS + KASEIKYO_VENDOR_ID_PARITY_BITS + KASEIKYO_ADDRESS_BITS + KASEIKYO_COMMAND_BITS + KASEIKYO_PARITY_BITS) // 48
94 #define KASEIKYO_UNIT 432 // 16 pulses of 37 kHz (432,432432) - Pronto 0x70 | 0x10
96 #define KASEIKYO_HEADER_MARK (8 * KASEIKYO_UNIT) // 3456
97 #define KASEIKYO_HEADER_SPACE (4 * KASEIKYO_UNIT) // 1728
99 #define KASEIKYO_BIT_MARK KASEIKYO_UNIT
100 #define KASEIKYO_ONE_SPACE (3 * KASEIKYO_UNIT) // 1296
101 #define KASEIKYO_ZERO_SPACE KASEIKYO_UNIT
103 #define KASEIKYO_AVERAGE_DURATION 56000
104 #define KASEIKYO_REPEAT_PERIOD 130000
105 #define KASEIKYO_REPEAT_DISTANCE (KASEIKYO_REPEAT_PERIOD - KASEIKYO_AVERAGE_DURATION) // 74 ms
107 #define PANASONIC_VENDOR_ID_CODE 0x2002
108 #define DENON_VENDOR_ID_CODE 0x3254
109 #define MITSUBISHI_VENDOR_ID_CODE 0xCB23
110 #define SHARP_VENDOR_ID_CODE 0x5AAA
111 #define JVC_VENDOR_ID_CODE 0x0103
124 void IRsend::sendKaseikyo(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode) {
129 uint8_t tVendorParity = aVendorCode ^ (aVendorCode >> 8);
130 tVendorParity = (tVendorParity ^ (tVendorParity >> 4)) & 0xF;
132 #if __INT_WIDTH__ < 32
139 tRawKaseikyoData[0] = (uint32_t) tSendValue.
UWord.
LowWord << 16 | aVendorCode;
144 tSendValue.
UWords[0] = aVendorCode;
209 #if defined(LOCAL_DEBUG)
210 Serial.print(F(
"Kaseikyo: "));
211 Serial.println(F(
"Vendor ID decode failed"));
232 uint8_t tVendorParity = tVendorId ^ (tVendorId >> 8);
233 tVendorParity = (tVendorParity ^ (tVendorParity >> 4)) & 0xF;
241 #if defined(LOCAL_DEBUG)
242 Serial.print(F(
"Kaseikyo: "));
243 Serial.println(F(
"VendorID parity, address, command + parity decode failed"));
252 #if __INT_WIDTH__ >= 32
263 #if defined(LOCAL_DEBUG)
264 Serial.print(F(
"Kaseikyo: "));
265 Serial.print(F(
"4 bit VendorID parity is not correct. expected=0x"));
266 Serial.print(tVendorParity, HEX);
267 Serial.print(F(
" received=0x"));
269 Serial.print(F(
" VendorID=0x"));
270 Serial.println(tVendorId, HEX);
282 #if defined(LOCAL_DEBUG)
283 Serial.print(F(
"Kaseikyo: "));
284 Serial.print(F(
"8 bit Parity is not correct. expected=0x"));
285 Serial.print(tParity, HEX);
286 Serial.print(F(
" received=0x"));
288 Serial.print(F(
" address=0x"));
290 Serial.print(F(
" command=0x"));
311 #if defined(LOCAL_DEBUG)
314 #endif // _IR_KASEIKYO_HPP
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
Union to specify parts / manifestations of a 32 bit Long without casts and shifts.
#define KASEIKYO_PARITY_BITS
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 MITSUBISHI_VENDOR_ID_CODE
void sendKaseikyo_Sharp(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with SHARP_VENDOR_ID_CODE.
#define KASEIKYO_ADDRESS_BITS
#define MICROS_IN_ONE_MILLI
struct LongUnion::@4 UByte
decode_type_t
An enum consisting of all supported formats.
#define KASEIKYO_BIT_MARK
#define KASEIKYO_REPEAT_PERIOD
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Sends PulseDistance frames and repeats.
irparams_struct * rawDataPtr
Pointer of the raw timing data to be decoded. Mainly the OverflowFlag and the data buffer filled by r...
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 KASEIKYO_VENDOR_ID_BITS
uint_fast8_t rawlen
counter of entries in rawbuf
Union to specify parts / manifestations of a 64 bit LongLong without casts and shifts.
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
#define PANASONIC_VENDOR_ID_CODE
#define IRDATA_FLAGS_PARITY_FAILED
the current (autorepeat) frame violated parity check
#define IRDATA_FLAGS_EXTRA_INFO
There is extra info not contained in address and data (e.g. Kaseikyo unknown vendor ID,...
void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, unsigned int aHeaderMarkMicros, unsigned int aHeaderSpaceMicros, unsigned int aOneMarkMicros, unsigned int aOneSpaceMicros, unsigned int aZeroMarkMicros, unsigned int aZeroSpaceMicros, IRRawDataType *aDecodedRawDataArray, unsigned int aNumberOfBits, bool aMSBfirst, bool aSendStopBit, unsigned int aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats)
Sends PulseDistance data from array For LSB First the LSB of array[0] is sent first then all bits unt...
uint8_t flags
See IRDATA_FLAGS_* definitions above.
#define JVC_VENDOR_ID_CODE
#define PROTOCOL_IS_LSB_FIRST
void checkForRepeatSpaceAndSetFlag(unsigned int aMediumRepeatSpaceMicros)
bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants)
void sendKaseikyo(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode)
Address can be interpreted as sub-device << 8 + device.
void sendKaseikyo_JVC(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with JVC_VENDOR_ID_CODE.
#define SHARP_VENDOR_ID_CODE
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
#define KASEIKYO_HEADER_SPACE
#define KASEIKYO_COMMAND_BITS
void sendPanasonic(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with PANASONIC_VENDOR_ID_CODE.
#define KASEIKYO_REPEAT_DISTANCE
#define KASEIKYO_VENDOR_ID_PARITY_BITS
#define IRDATA_FLAGS_IS_LSB_FIRST
uint16_t extra
Contains upper 16 bit of Magiquest WandID, Kaseikyo unknown vendor ID and Distance protocol (HeaderMa...
struct PulseDistanceWidthProtocolConstants KaseikyoProtocolConstants
#define KASEIKYO_ONE_SPACE
void sendKaseikyo_Mitsubishi(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with MITSUBISHI_VENDOR_ID_CODE.
#define KASEIKYO_HEADER_MARK
struct LongUnion::@6 UWord
#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, ...
#define KASEIKYO_ZERO_SPACE
void enableIROut(uint_fast8_t aFrequencyKHz)
Enables IR output.
void sendKaseikyo_Denon(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
Stub using Kaseikyo with DENON_VENDOR_ID_CODE.
#define DENON_VENDOR_ID_CODE