Go to the documentation of this file.
32 #ifndef _IR_KASEIKYO_HPP
33 #define _IR_KASEIKYO_HPP
93 #define KASEIKYO_VENDOR_ID_BITS 16
94 #define KASEIKYO_VENDOR_ID_PARITY_BITS 4
95 #define KASEIKYO_ADDRESS_BITS 12
96 #define KASEIKYO_COMMAND_BITS 8
97 #define KASEIKYO_PARITY_BITS 8
98 #define KASEIKYO_BITS (KASEIKYO_VENDOR_ID_BITS + KASEIKYO_VENDOR_ID_PARITY_BITS + KASEIKYO_ADDRESS_BITS + KASEIKYO_COMMAND_BITS + KASEIKYO_PARITY_BITS) // 48
99 #define KASEIKYO_UNIT 432 // 16 pulses of 37 kHz (432,432432) - Pronto 0x70 | 0x10
101 #define KASEIKYO_HEADER_MARK (8 * KASEIKYO_UNIT) // 3456
102 #define KASEIKYO_HEADER_SPACE (4 * KASEIKYO_UNIT) // 1728
104 #define KASEIKYO_BIT_MARK KASEIKYO_UNIT
105 #define KASEIKYO_ONE_SPACE (3 * KASEIKYO_UNIT) // 1296
106 #define KASEIKYO_ZERO_SPACE KASEIKYO_UNIT
108 #define KASEIKYO_AVERAGE_DURATION 56000
109 #define KASEIKYO_REPEAT_PERIOD 130000
110 #define KASEIKYO_REPEAT_DISTANCE (KASEIKYO_REPEAT_PERIOD - KASEIKYO_AVERAGE_DURATION) // 74 ms
111 #define KASEIKYO_MAXIMUM_REPEAT_DISTANCE (KASEIKYO_REPEAT_DISTANCE + (KASEIKYO_REPEAT_DISTANCE / 4)) // Just a guess
113 #define PANASONIC_VENDOR_ID_CODE 0x2002
114 #define DENON_VENDOR_ID_CODE 0x3254
115 #define MITSUBISHI_VENDOR_ID_CODE 0xCB23
116 #define SHARP_VENDOR_ID_CODE 0x5AAA
117 #define JVC_VENDOR_ID_CODE 0x0103
130 void IRsend::sendKaseikyo(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode) {
135 uint8_t tVendorParity = aVendorCode ^ (aVendorCode >> 8);
136 tVendorParity = (tVendorParity ^ (tVendorParity >> 4)) & 0xF;
138 #if __INT_WIDTH__ < 32
145 tRawKaseikyoData[0] = (uint32_t) tSendValue.
UWord.
LowWord << 16 | aVendorCode;
150 tSendValue.
UWords[0] = aVendorCode;
231 uint8_t tVendorParity = tVendorId ^ (tVendorId >> 8);
232 tVendorParity = (tVendorParity ^ (tVendorParity >> 4)) & 0xF;
245 #if __INT_WIDTH__ >= 32
256 DEBUG_PRINT(F(
"Kaseikyo: 4 bit VendorID parity is not correct. Expected=0x"));
272 DEBUG_PRINT(F(
"Kaseikyo: 8 bit parity is not correct. Expected=0x"));
300 #endif // _IR_KASEIKYO_HPP
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
#define MICROS_PER_TICK
microseconds per clock interrupt tick
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 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
void decodePulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
#define MICROS_IN_ONE_MILLI
bool checkHeader_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM)
struct LongUnion::@4 UByte
#define PROTOCOL_IS_PULSE_DISTANCE
decode_type_t
An enum consisting of all supported formats.
#define KASEIKYO_BIT_MARK
#define KASEIKYO_REPEAT_PERIOD
void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks)
#define KASEIKYO_VENDOR_ID_BITS
Union to specify parts / manifestations of a 64 bit LongLong without casts and shifts.
#define PANASONIC_VENDOR_ID_CODE
#define IRDATA_FLAGS_PARITY_FAILED
The current (autorepeat) frame violated parity check.
uint32_t IRDecodedRawDataType
void sendPulseDistanceWidth_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRDecodedRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
#define IRDATA_FLAGS_EXTRA_INFO
There is extra info not contained in address and data (e.g. Kaseikyo unknown vendor ID,...
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
#define JVC_VENDOR_ID_CODE
#define PROTOCOL_IS_LSB_FIRST
void sendKaseikyo(uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode)
Address can be interpreted as sub-device << 4 + 4 bit 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.
IRDecodedRawDataType decodedRawData
Up to 32/64 bit decoded raw data, to be used for send<protocol>Raw functions.
#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.
void sendPulseDistanceWidthFromArray_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRDecodedRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
#define KASEIKYO_VENDOR_ID_PARITY_BITS
#define DEBUG_PRINTLN(...)
#define KASEIKYO_MAXIMUM_REPEAT_DISTANCE
#define IRDATA_FLAGS_IS_LSB_FIRST
uint16_t extra
Contains upper 16 bit of Magiquest WandID, Kaseikyo unknown vendor ID and Distance protocol (HeaderMa...
#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.
IRRawlenType rawlen
Counter of entries in rawbuf of last received frame.
#define KASEIKYO_HEADER_MARK
struct PulseDistanceWidthProtocolConstants const KaseikyoProtocolConstants PROGMEM
struct LongUnion::@6 UWord
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