IRremote
TinyIR.h File Reference
#include <Arduino.h>
#include "LongUnion.h"
Include dependency graph for TinyIR.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TinyIRReceiverStruct
 Control and data variables of the state machine for TinyReceiver. More...
 
struct  TinyIRReceiverCallbackDataStruct
 Is filled before calling the user callback to transfer received data to main loop for further processing. More...
 

Macros

#define VERSION_TINYIR   "2.1.0"
 
#define VERSION_TINYIR_MAJOR   2
 
#define VERSION_TINYIR_MINOR   1
 
#define VERSION_TINYIR_PATCH   0
 
#define NEC_ADDRESS_BITS   16
 Timing for NEC protocol. More...
 
#define NEC_COMMAND_BITS   16
 
#define NEC_BITS   (NEC_ADDRESS_BITS + NEC_COMMAND_BITS)
 
#define NEC_UNIT   560
 
#define NEC_HEADER_MARK   (16 * NEC_UNIT)
 
#define NEC_HEADER_SPACE   (8 * NEC_UNIT)
 
#define NEC_BIT_MARK   NEC_UNIT
 
#define NEC_ONE_SPACE   (3 * NEC_UNIT)
 
#define NEC_ZERO_SPACE   NEC_UNIT
 
#define NEC_REPEAT_HEADER_SPACE   (4 * NEC_UNIT)
 
#define NEC_REPEAT_PERIOD   110000
 
#define NEC_MINIMAL_DURATION   49900
 
#define NEC_MAXIMUM_REPEAT_DISTANCE   (NEC_REPEAT_PERIOD - NEC_MINIMAL_DURATION + 10000)
 
#define FAST_KHZ   38
 The FAST protocol is a proprietary modified JVC protocol without address, with parity and with a shorter header. More...
 
#define FAST_ADDRESS_BITS   0
 
#define FAST_COMMAND_BITS   16
 
#define FAST_BITS   (FAST_ADDRESS_BITS + FAST_COMMAND_BITS)
 
#define FAST_UNIT   526
 
#define FAST_BIT_MARK   FAST_UNIT
 
#define FAST_ONE_SPACE   (3 * FAST_UNIT)
 
#define FAST_ZERO_SPACE   FAST_UNIT
 
#define FAST_HEADER_MARK   (4 * FAST_UNIT)
 
#define FAST_HEADER_SPACE   (2 * FAST_UNIT)
 
#define FAST_REPEAT_PERIOD   50000
 
#define FAST_REPEAT_DISTANCE   (FAST_REPEAT_PERIOD - (55 * FAST_UNIT))
 
#define FAST_MAXIMUM_REPEAT_DISTANCE   (FAST_REPEAT_DISTANCE + 10000)
 
#define TINY_RECEIVER_ADDRESS_BITS   NEC_ADDRESS_BITS
 
#define TINY_RECEIVER_ADDRESS_HAS_8_BIT_PARITY   true
 
#define TINY_RECEIVER_COMMAND_BITS   NEC_COMMAND_BITS
 
#define TINY_RECEIVER_COMMAND_HAS_8_BIT_PARITY   true
 
#define TINY_RECEIVER_BITS   NEC_BITS
 
#define TINY_RECEIVER_UNIT   NEC_UNIT
 
#define TINY_RECEIVER_HEADER_MARK   NEC_HEADER_MARK
 
#define TINY_RECEIVER_HEADER_SPACE   NEC_HEADER_SPACE
 
#define TINY_RECEIVER_BIT_MARK   NEC_BIT_MARK
 
#define TINY_RECEIVER_ONE_SPACE   NEC_ONE_SPACE
 
#define TINY_RECEIVER_ZERO_SPACE   NEC_ZERO_SPACE
 
#define TINY_RECEIVER_MAXIMUM_REPEAT_DISTANCE   NEC_MAXIMUM_REPEAT_DISTANCE
 
#define MICROS_IN_ONE_SECOND   1000000L
 
#define MICROS_IN_ONE_MILLI   1000L
 
#define lowerValue25Percent(aDuration)   (aDuration - (aDuration / 4))
 
#define upperValue25Percent(aDuration)   (aDuration + (aDuration / 4))
 
#define lowerValue50Percent(aDuration)   (aDuration / 2)
 
#define upperValue50Percent(aDuration)   (aDuration + (aDuration / 2))
 
#define IR_RECEIVER_STATE_WAITING_FOR_START_MARK   0
 
#define IR_RECEIVER_STATE_WAITING_FOR_START_SPACE   1
 
#define IR_RECEIVER_STATE_WAITING_FOR_FIRST_DATA_MARK   2
 
#define IR_RECEIVER_STATE_WAITING_FOR_DATA_SPACE   3
 
#define IR_RECEIVER_STATE_WAITING_FOR_DATA_MARK   4
 
#define IR_RECEIVER_STATE_WAITING_FOR_STOP_MARK   5
 
#define IRDATA_FLAGS_EMPTY   0x00
 
#define IRDATA_FLAGS_IS_REPEAT   0x01
 
#define IRDATA_FLAGS_IS_AUTO_REPEAT   0x02
 
#define IRDATA_FLAGS_PARITY_FAILED   0x04
 the current (autorepeat) frame violated parity check More...
 

Functions

bool isIRReceiverAttachedForTinyReceiver ()
 
bool initPCIInterruptForTinyReceiver ()
 Sets IR_RECEIVE_PIN mode to INPUT, and if IR_FEEDBACK_LED_PIN is defined, sets feedback LED output mode. More...
 
bool enablePCIInterruptForTinyReceiver ()
 Initializes hardware interrupt generation according to IR_RECEIVE_PIN or use attachInterrupt() function. More...
 
void disablePCIInterruptForTinyReceiver ()
 
bool isTinyReceiverIdle ()
 
void printTinyReceiverResultMinimal (Print *aSerial)
 
void sendFAST (uint8_t aSendPin, uint16_t aCommand, uint_fast8_t aNumberOfRepeats=0)
 
void sendFast8BitAndParity (uint8_t aSendPin, uint8_t aCommand, uint_fast8_t aNumberOfRepeats=0)
 
void sendONKYO (uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats=0, bool aSendNEC2Repeats=false)
 
void sendNECMinimal (uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats=0) __attribute__((deprecated("Renamed to sendNEC().")))
 
void sendNEC (uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats=0, bool aSendNEC2Repeats=false)
 
void sendExtendedNEC (uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats=0, bool aSendNEC2Repeats=false)
 

Variables

volatile TinyIRReceiverCallbackDataStruct TinyIRReceiverData