33 #if defined(ARDUINO) && ARDUINO >= 100 35 #elif defined(ENERGIA) // LaunchPad, FraunchPad and StellarPad specific 37 #elif defined(RPI) // Raspberry Pi 42 #define memcpy_P(dest, src, num) memcpy((dest), (src), (num)) 55 typedef uint8_t boolean;
68 #if defined( __AVR_ATtinyX5__ ) or defined ( __AVR_ATtinyX4__ ) 69 #define RCSwitchDisableReceiving 74 #define RCSWITCH_MAX_CHANGES 67 81 void switchOn(
int nGroupNumber,
int nSwitchNumber);
82 void switchOff(
int nGroupNumber,
int nSwitchNumber);
83 void switchOn(
const char* sGroup,
int nSwitchNumber);
84 void switchOff(
const char* sGroup,
int nSwitchNumber);
85 void switchOn(
char sFamily,
int nGroup,
int nDevice);
86 void switchOff(
char sFamily,
int nGroup,
int nDevice);
87 void switchOn(
const char* sGroup,
const char* sDevice);
88 void switchOff(
const char* sGroup,
const char* sDevice);
89 void switchOn(
char sGroup,
int nDevice);
90 void switchOff(
char sGroup,
int nDevice);
92 void sendTriState(
const char* Code);
93 void send(
unsigned long Code,
unsigned int length);
94 void send(
const char* Code);
96 #if not defined( RCSwitchDisableReceiving ) 97 void enableReceive(
int pinNumber);
99 void disableReceive();
101 void resetAvailable();
103 unsigned long getReceivedValue();
104 unsigned int getReceivedBitlength();
105 unsigned int getReceivedDelay();
106 unsigned int getReceivedProtocol();
107 unsigned int* getReceivedRawdata();
110 void enableTransmit(
int nTransmitterPin);
111 void disableTransmit();
112 void setPulseLength(
int nPulseLength);
113 void setRepeatTransmit(
int nRepeatTransmit);
114 #if not defined( RCSwitchDisableReceiving ) 115 void setReceiveTolerance(
int nPercent);
130 void setProtocol(
Protocol protocol);
131 void setProtocol(
int nProtocol);
132 void setProtocol(
int nProtocol,
int nPulseLength);
135 char* getCodeWordB(
int nGroupNumber,
int nSwitchNumber,
boolean bStatus);
136 char* getCodeWordA(
const char* sGroup,
int nSwitchNumber,
boolean bStatus);
137 char* getCodeWordA(
const char* sGroup,
const char* sDevice,
boolean bStatus);
138 char* getCodeWordC(
char sFamily,
int nGroup,
int nDevice,
boolean bStatus);
139 char* getCodeWordD(
char group,
int nDevice,
boolean bStatus);
146 void transmit(
int nHighPulses,
int nLowPulses);
149 static char* dec2binWcharfill(
unsigned long dec,
unsigned int length,
char fill);
151 #if not defined( RCSwitchDisableReceiving ) 152 static IRAM_ATTR
void handleInterrupt();
153 static IRAM_ATTR
bool receiveProtocol(
const int p,
unsigned int changeCount);
154 int nReceiverInterrupt;
161 #if not defined( RCSwitchDisableReceiving ) 162 static int nReceiveTolerance;
163 static unsigned long nReceivedValue;
164 static unsigned int nReceivedBitlength;
165 static unsigned int nReceivedDelay;
166 static unsigned int nReceivedProtocol;
167 const static unsigned int nSeparationLimit;
171 static unsigned int timings[RCSWITCH_MAX_CHANGES];
Definition: RCSwitch.h:123
Definition: RCSwitch.h:118
Definition: RCSwitch.h:76