Go to the documentation of this file.
32 #ifndef _IR_PROTOCOL_H
33 #define _IR_PROTOCOL_H
93 #define IRDATA_FLAGS_EMPTY 0x00
94 #define IRDATA_FLAGS_IS_REPEAT 0x01
95 #define IRDATA_FLAGS_IS_AUTO_REPEAT 0x02
96 #define IRDATA_FLAGS_PARITY_FAILED 0x04
97 #define IRDATA_FLAGS_TOGGLE_BIT 0x08
98 #define IRDATA_FLAGS_EXTRA_INFO 0x10
99 #define IRDATA_FLAGS_WAS_OVERFLOW 0x40
100 #define IRDATA_FLAGS_IS_MSB_FIRST 0x80
101 #define IRDATA_FLAGS_IS_LSB_FIRST 0x00
104 #define IRDATA_TOGGLE_BIT_MASK 0x08
106 #if __INT_WIDTH__ < 32
107 #define RAW_DATA_ARRAY_SIZE ((((RAW_BUFFER_LENGTH - 2) - 1) / 64) + 1) // The -2 is for initial gap + stop bit mark, 64 mark + spaces for 32 bit.
109 #define RAW_DATA_ARRAY_SIZE ((((RAW_BUFFER_LENGTH - 2) - 1) / 128) + 1) // The -2 is for initial gap + stop bit mark, 128 mark + spaces for 64 bit.
123 #if defined(DECODE_DISTANCE_WIDTH)
129 #define PROTOCOL_IS_LSB_FIRST false
130 #define PROTOCOL_IS_MSB_FIRST true
135 #if !defined(BEO_KHZ) // guard used for unit test, which sends and receive Bang&Olufsen with 38 kHz.
139 #define BOSEWAVE_KHZ 38
144 #define SAMSUNG_KHZ 38
145 #define KASEIKYO_KHZ 37
146 #define RC5_RC6_KHZ 36
161 #endif // _IR_PROTOCOL_H
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
uint32_t bitreverse32Bit(uint32_t aInput)
void(* SpecialSendRepeatFunction)()
decode_type_t
An enum consisting of all supported formats.
decode_type_t ProtocolIndex
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.
This struct contains the data and control used for receiver static functions and the ISR (interrupt s...
void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintGap)
Function to print decoded result and flags in one line.
Data structure for the user application, available as decodedIRData.
unsigned int ZeroMarkMicros
#define RAW_DATA_ARRAY_SIZE
uint8_t flags
See IRDATA_FLAGS_* definitions above.
uint8_t bitreverseOneByte(uint8_t aValue)
unsigned int HeaderSpaceMicros
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
unsigned int OneMarkMicros
uint16_t extra
Contains upper 16 bit of Magiquest WandID, Kaseikyo unknown vendor ID and Distance protocol (HeaderMa...
unsigned int HeaderMarkMicros
unsigned int OneSpaceMicros
unsigned int RepeatPeriodMillis
unsigned int ZeroSpaceMicros
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
uint_fast8_t FrequencyKHz
const char * getProtocolString(decode_type_t aProtocol)