IRremote
|
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... | |
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) |
void | handleTinyReceivedIRData () |
Declaration of the callback function provided by the user application. More... | |
void | IRPinChangeInterruptHandler (void) |
The ISR (Interrupt Service Routine) of TinyIRRreceiver. More... | |
Variables | |
volatile TinyIRReceiverCallbackDataStruct | TinyIRReceiverData |
TinyIRReceiverStruct | TinyIRReceiverControl |
volatile TinyIRReceiverCallbackDataStruct | TinyIRReceiverData |
#define FAST_BITS (FAST_ADDRESS_BITS + FAST_COMMAND_BITS) |
#define FAST_KHZ 38 |
The FAST protocol is a proprietary modified JVC protocol without address, with parity and with a shorter header.
FAST protocol characteristics:
#define FAST_MAXIMUM_REPEAT_DISTANCE (FAST_REPEAT_DISTANCE + 10000) |
#define FAST_REPEAT_DISTANCE (FAST_REPEAT_PERIOD - (55 * FAST_UNIT)) |
#define IR_RECEIVE_PIN 2 |
Definition at line 128 of file TinyIRReceiver.hpp.
#define IRDATA_FLAGS_PARITY_FAILED 0x04 |
#define lowerValue25Percent | ( | aDuration | ) | (aDuration - (aDuration / 4)) |
#define NEC_ADDRESS_BITS 16 |
Timing for NEC protocol.
see: https://www.sbprojects.net/knowledge/ir/nec.php LSB first, 1 start bit + 16 bit address + 8 bit data + 8 bit inverted data + 1 stop bit.
#define NEC_BITS (NEC_ADDRESS_BITS + NEC_COMMAND_BITS) |
#define NEC_MAXIMUM_REPEAT_DISTANCE (NEC_REPEAT_PERIOD - NEC_MINIMAL_DURATION + 10000) |
#define TINY_RECEIVER_ADDRESS_BITS NEC_ADDRESS_BITS |
#define TINY_RECEIVER_BIT_MARK NEC_BIT_MARK |
#define TINY_RECEIVER_COMMAND_BITS NEC_COMMAND_BITS |
#define TINY_RECEIVER_HEADER_MARK NEC_HEADER_MARK |
#define TINY_RECEIVER_HEADER_SPACE NEC_HEADER_SPACE |
#define TINY_RECEIVER_MAXIMUM_REPEAT_DISTANCE NEC_MAXIMUM_REPEAT_DISTANCE |
#define TINY_RECEIVER_ONE_SPACE NEC_ONE_SPACE |
#define TINY_RECEIVER_USE_ARDUINO_ATTACH_INTERRUPT |
Definition at line 147 of file TinyIRReceiver.hpp.
#define TINY_RECEIVER_ZERO_SPACE NEC_ZERO_SPACE |
#define upperValue25Percent | ( | aDuration | ) | (aDuration + (aDuration / 4)) |
#define upperValue50Percent | ( | aDuration | ) | (aDuration + (aDuration / 2)) |
#define USE_ATTACH_INTERRUPT |
Definition at line 490 of file TinyIRReceiver.hpp.
void disablePCIInterruptForTinyReceiver | ( | ) |
Definition at line 620 of file TinyIRReceiver.hpp.
bool enablePCIInterruptForTinyReceiver | ( | ) |
Initializes hardware interrupt generation according to IR_RECEIVE_PIN or use attachInterrupt() function.
Definition at line 554 of file TinyIRReceiver.hpp.
void handleTinyReceivedIRData | ( | ) |
Declaration of the callback function provided by the user application.
It is called every time a complete IR command or repeat was received.
bool initPCIInterruptForTinyReceiver | ( | ) |
Sets IR_RECEIVE_PIN mode to INPUT, and if IR_FEEDBACK_LED_PIN is defined, sets feedback LED output mode.
Then call enablePCIInterruptForTinyReceiver()
Definition at line 444 of file TinyIRReceiver.hpp.
void IRPinChangeInterruptHandler | ( | void | ) |
The ISR (Interrupt Service Routine) of TinyIRRreceiver.
It handles the NEC protocol decoding and calls the user callback function on complete. 5 us + 3 us for push + pop for a 16MHz ATmega
Definition at line 166 of file TinyIRReceiver.hpp.
bool isIRReceiverAttachedForTinyReceiver | ( | ) |
Definition at line 433 of file TinyIRReceiver.hpp.
bool isTinyReceiverIdle | ( | ) |
Definition at line 425 of file TinyIRReceiver.hpp.
void printTinyReceiverResultMinimal | ( | Print * | aSerial | ) |
Definition at line 453 of file TinyIRReceiver.hpp.
void sendExtendedNEC | ( | uint8_t | aSendPin, |
uint16_t | aAddress, | ||
uint16_t | aCommand, | ||
uint_fast8_t | aNumberOfRepeats = 0 , |
||
bool | aSendNEC2Repeats = false |
||
) |
Definition at line 234 of file TinyIRSender.hpp.
void sendFAST | ( | uint8_t | aSendPin, |
uint16_t | aCommand, | ||
uint_fast8_t | aNumberOfRepeats = 0 |
||
) |
Definition at line 294 of file TinyIRSender.hpp.
void sendFast8BitAndParity | ( | uint8_t | aSendPin, |
uint8_t | aCommand, | ||
uint_fast8_t | aNumberOfRepeats = 0 |
||
) |
Definition at line 287 of file TinyIRSender.hpp.
void sendNEC | ( | uint8_t | aSendPin, |
uint16_t | aAddress, | ||
uint16_t | aCommand, | ||
uint_fast8_t | aNumberOfRepeats = 0 , |
||
bool | aSendNEC2Repeats = false |
||
) |
Definition at line 168 of file TinyIRSender.hpp.
void sendNECMinimal | ( | uint8_t | aSendPin, |
uint16_t | aAddress, | ||
uint16_t | aCommand, | ||
uint_fast8_t | aNumberOfRepeats = 0 |
||
) |
Definition at line 165 of file TinyIRSender.hpp.
void sendONKYO | ( | uint8_t | aSendPin, |
uint16_t | aAddress, | ||
uint16_t | aCommand, | ||
uint_fast8_t | aNumberOfRepeats = 0 , |
||
bool | aSendNEC2Repeats = false |
||
) |
Definition at line 114 of file TinyIRSender.hpp.
TinyIRReceiverStruct TinyIRReceiverControl |
Definition at line 108 of file TinyIRReceiver.hpp.
volatile TinyIRReceiverCallbackDataStruct TinyIRReceiverData |
Definition at line 109 of file TinyIRReceiver.hpp.
volatile TinyIRReceiverCallbackDataStruct TinyIRReceiverData |
Definition at line 109 of file TinyIRReceiver.hpp.