1 Commits

Author SHA1 Message Date
Rafi Khan
13ac290b3b working on restructuring and renaming. Change IRremote.h to AIRremote.h
If there are other ideas for a better name then we can use that, A =
Arduino in case it wasnt obvious.
2016-12-11 20:28:43 -06:00
41 changed files with 49 additions and 222 deletions

View File

@@ -15,8 +15,8 @@
// Whynter A/C ARC-110WD added by Francesco Meschia
//******************************************************************************
#ifndef IRremote_h
#define IRremote_h
#ifndef AIRremote_h
#define AIRremote_h
//------------------------------------------------------------------------------
// The ISR header contains several useful macros the user may wish to use
@@ -79,9 +79,6 @@
#define DECODE_LEGO_PF 0 // NOT WRITTEN
#define SEND_LEGO_PF 1
#define DECODE_CDTV 1
#define SEND_CDTV 1
//------------------------------------------------------------------------------
// When sending a Pronto code we request to send either the "once" code
// or the "repeat" code
@@ -122,7 +119,6 @@ typedef
DENON,
PRONTO,
LEGO_PF,
CDTV,
}
decode_type_t;
@@ -251,13 +247,9 @@ class IRrecv
# if DECODE_DENON
bool decodeDenon (decode_results *results) ;
# endif
//......................................................................
//......................................................................
# if DECODE_LEGO_PF
bool decodeLegoPowerFunctions (decode_results *results) ;
# endif
//......................................................................
# if DECODE_CDTV
bool decodeCDTV (decode_results *results) ;
# endif
} ;
@@ -343,13 +335,9 @@ class IRsend
# if SEND_PRONTO
void sendPronto (char* code, bool repeat, bool fallback) ;
# endif
//......................................................................
//......................................................................
# if SEND_LEGO_PF
void sendLegoPowerFunctions (uint16_t data, bool repeat = true) ;
# endif
//......................................................................
# if SEND_CDTV
void sendCDTV (unsigned long data, int nbits) ;
# endif
} ;

View File

@@ -15,9 +15,8 @@ These are the active contributors of this project that you may contact if there
- [csBlueChip](https://github.com/csbluechip) : Active contributor, who contributed major and vital changes to the code base.
- [Sebazzz](https://github.com/sebazz): Contributor
- [lumbric](https://github.com/lumbric): Contributor
- [ElectricRCAircraftGuy](https://github.com/electricrcaircraftguy): Contributor
- [ElectricRCAircraftGuy](https://github.com/electricrcaircraftguy): Active Contributor
- [henkel](https://github.com/henkel): Contributor
- [MCUdude](https://github.com/MCUdude): Contributor
- [salocinx](https://github.com/salocinx): Contributor
Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed.

View File

@@ -22,7 +22,7 @@
// Defining IR_GLOBAL here allows us to declare the instantiation of global variables
#define IR_GLOBAL
# include "IRremote.h"
# include "AIRremote.h"
# include "IRremoteInt.h"
#undef IR_GLOBAL

View File

@@ -108,6 +108,6 @@ EXTERN volatile irparams_t irparams;
#define SPACE 1
// All board specific stuff has been moved to its own file, included here.
#include "IRremoteBoardDefs.h"
#include "boarddefs.h"
#endif

View File

@@ -5,7 +5,7 @@
**Code Block:**
```c
#include <IRremote.h>
#include <AIRremote.h>
.....

View File

@@ -17,8 +17,8 @@
// Whynter A/C ARC-110WD added by Francesco Meschia
//******************************************************************************
#ifndef IRremoteBoardDefs_h
#define IRremoteBoardDefs_h
#ifndef boarddefs_h
#define boarddefs_h
//------------------------------------------------------------------------------
// Defines for blinking the LED
@@ -545,4 +545,4 @@
# error "Internal code configuration error, no known IR_USE_TIMER# defined\n"
#endif
#endif // ! IRremoteBoardDefs_h
#endif // ! boarddefs_h

View File

@@ -1,10 +1,3 @@
## 2.3.0 - 2017/02/06
- Added Commodore Amiga CDTV Support [ISSUE #407](https://github.com/z3t0/Arduino-IRremote/issues/407) [PR #413](https://github.com/z3t0/Arduino-IRremote/pull/413)
## 2.2.2 - 2017/01/20
- Renamed "boarddefs.h" [ISSUE #375](https://github.com/z3t0/Arduino-IRremote/issues/375)
- Fixed naming bug [PR #398](https://github.com/z3t0/Arduino-IRremote/pull/398)
## 2.2.1 - 2016/07/27
- Added tests for Lego Power Functions Protocol [PR #336](https://github.com/z3t0/Arduino-IRremote/pull/336)

View File

@@ -6,7 +6,7 @@
* http://arcfn.com
*/
#include "IRremote.h"
#include "AIRremote.h"
#define POWER 0x7F80
#define AIWA_RC_T501

View File

@@ -15,7 +15,7 @@
* http://arcfn.com
*/
#include <IRremote.h>
#include <AIRremote.h>
int RECV_PIN = 11;
int BUTTON_PIN = 12;
@@ -126,7 +126,7 @@ void sendCode(int repeat) {
Serial.println(codeValue, HEX);
}
else if (codeType == JVC) {
irsend.sendJVC(codeValue, codeLen, false);
irsend.sendPanasonic(codeValue, codeLen);
Serial.print("Sent JVC");
Serial.println(codeValue, HEX);
}

View File

@@ -6,7 +6,7 @@
* http://arcfn.com
*/
#include <IRremote.h>
#include <AIRremote.h>
int RECV_PIN = 11;

View File

@@ -8,7 +8,7 @@
* LG added by Darryl Smith (based on the JVC protocol)
*/
#include <IRremote.h>
#include <AIRremote.h>
/*
* Default is Arduino pin D11.

View File

@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// Include the IRremote library header
//
#include <IRremote.h>
#include <AIRremote.h>
//------------------------------------------------------------------------------
// Tell IRremote which Arduino pin is connected to the IR Receiver (TSOP4838)
@@ -66,7 +66,7 @@ void dumpInfo (decode_results *results)
{
// Check if the buffer overflowed
if (results->overflow) {
Serial.println("IR code too long. Edit IRremoteInt.h and increase RAWBUF");
Serial.println("IR code too long. Edit IRremoteInt.h and increase RAWLEN");
return;
}

View File

@@ -6,7 +6,7 @@
* http://arcfn.com
*/
#include <IRremote.h>
#include <AIRremote.h>
int RECV_PIN = 11;
int RELAY_PIN = 4;

View File

@@ -11,7 +11,7 @@
*/
#include <IRremote.h>
#include <AIRremote.h>
void setup()
{
@@ -224,7 +224,7 @@ void dumpFooter() {
Serial.println(F("Notes: "));
Serial.println(F(" - Most of the seetings above can be configured in the following files included as part of the library"));
Serial.println(F(" - IRremteInt.h"));
Serial.println(F(" - IRremote.h"));
Serial.println(F(" - AIRremote.h"));
Serial.println(F(" - You can save SRAM by disabling the Decode or Send features for any protocol (Near the top of IRremoteInt.h)"));
Serial.println(F(" - Some Timer conflicts, with other libraries, can be easily resolved by configuring a differnt Timer for your platform"));
}

View File

@@ -7,7 +7,7 @@
*/
#include <IRremote.h>
#include <AIRremote.h>
IRsend irsend;

View File

@@ -18,7 +18,7 @@
*/
#include <IRremote.h>
#include <AIRremote.h>
IRsend irsend;

View File

@@ -4,12 +4,12 @@
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*
* Note: to run these tests, edit IRremote/IRremote.h to add "#define TEST"
* Note: to run these tests, edit IRremote/AIRremote.h to add "#define TEST"
* You must then recompile the library by removing IRremote.o and restarting
* the arduino IDE.
*/
#include <IRremote.h>
#include <AIRremote.h>
#include <IRremoteInt.h>
// Dumps out the decode_results structure.

View File

@@ -25,7 +25,7 @@
* http://arcfn.com
*/
#include <IRremote.h>
#include <AIRremote.h>
int RECV_PIN = 11;
int LED_PIN = 3;

View File

@@ -6,7 +6,7 @@
* http://arcfn.com
* JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
*/
#include <IRremote.h>
#include <AIRremote.h>
#define PanasonicAddress 0x4004 // Panasonic address (Pre data)
#define PanasonicPower 0x100BCBD // Panasonic Power button

View File

@@ -1,4 +1,4 @@
#include <IRremote.h>
#include <AIRremote.h>
#include <Wire.h>

View File

@@ -3,7 +3,7 @@
* Copyright (c) 2016 Philipp Henkel
*/
#include <IRremote.h>
#include <AIRremote.h>
#include <IRremoteInt.h>
IRsend irsend;

View File

@@ -17,7 +17,7 @@
void mark (int t) { printf("+%d," , t); }
void space (int t) { printf("-%d, ", t); }
#else
# include "IRremote.h"
# include "AIRremote.h"
#endif // TEST
//+=============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//+=============================================================================
@@ -84,11 +84,6 @@ int IRrecv::decode (decode_results *results)
DBG_PRINTLN("Attempting Lego Power Functions");
if (decodeLegoPowerFunctions(results)) return true ;
#endif
#if DECODE_CDTV
DBG_PRINTLN("Attempting Commodore Amiga CDTV decode");
if (decodeCDTV(results)) return true;
#endif
// decodeHash returns a hash on any input.
// Thus, it needs to be last in the list.

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//+=============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,148 +0,0 @@
#include "IRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// COMMODORE AMIGA CD-TV
//==============================================================================
//==============================================================================
// CCCC DDDD TTTTT V V
// C D D T V V
// C D D T V V
// C D D T V V
// CCCC DDDD T V
//==============================================================================
//==============================================================================
// MEASUREMENTS
//==============================================================================
/*Encoding: UNKNOWN
Code : 72A03D6B(32 bits)
Timing[51] :
+8900, -4450 + 400, -1200 + 350, -400 + 400, -400
+ 400, -400 + 400, -1200 + 400, -400 + 350, -450
+ 350, -400 + 400, -400 + 400, -350 + 450, -400
+ 350, -450 + 350, -400 + 400, -1200 + 400, -1200
+ 350, -1200 + 400, -450 + 350, -1200 + 400, -1200
+ 350, -1200 + 400, -1200 + 350, -1250 + 350, -1200
+ 400, -1200 + 350
unsigned int rawData[51] = { 8900,4450, 400,1200, 350,400, 400,400, 400,400, 400,1200, 400,400, 350,450, 350,400, 400,400, 400,350, 450,400, 350,450, 350,400, 400,1200, 400,1200, 350,1200, 400,450, 350,1200, 400,1200, 350,1200, 400,1200, 350,1250, 350,1200, 400,1200, 350 }; // UNKNOWN 72A03D6B
*/
// NOTE: The array dump above begins at index = 1; therefore offset = 1 in the code below
//==============================================================================
#define CDTV_BITS 24
// timing intervals in usec
#define CDTV_HDR_MARK 8850 // start burst
#define CDTV_HDR_SPACE 4450 // pause after start
#define CDTV_BIT_MARK 350 // pulse
#define CDTV_ONE_SPACE 1250 // receive a '1'
#define CDTV_ZERO_SPACE 450 // receive a '0'
#define CDTV_RPT_SPACE 2250 // repeat signal
// message sizes measured in raw pulses
#define CDTV_RAW_REPEAT_LENGTH 4 // CDTV_HDR_MARK + CDTV_HDR_SPACE + CDTV_BIT_MARK
#define CDTV_RAW_SIGNAL_LENGTH 52 // CDTV_HDR_MARK + CDTV_HDR_SPACE + CDTV_BITS * (CDTV_BIT_MARK + CDTV_ZERO_SPACE | CDTV_ONE_SPACE)
//+=============================================================================
#if SEND_CDTV
void IRsend::sendCDTV(unsigned long data, int nbits) {
// set IR carrier frequency
enableIROut(40);
// send header
mark(CDTV_HDR_MARK);
space(CDTV_HDR_SPACE);
// send data
for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) {
if (data & mask) {
mark(CDTV_BIT_MARK);
space(CDTV_ONE_SPACE);
} else {
mark(CDTV_BIT_MARK);
space(CDTV_ZERO_SPACE);
}
}
// send footer
mark(CDTV_BIT_MARK);
// always end with the LED off
space(0);
}
#endif
//+=============================================================================
// CDTV have a repeat signal that is 4-bits long [#FFFFFF]
//
#if DECODE_CDTV
bool IRrecv::decodeCDTV(decode_results *results) {
unsigned long data = 0; // we decode into this field; start with empty placeholder
int offset = 1; // skip first entry since it has not a lot of meaning
// check if header mark is within range
if (!MATCH_MARK(results->rawbuf[offset], CDTV_HDR_MARK)) {
return false;
}
offset++; // -> offset[2]
// check for 4-bit repeat signal
if ((irparams.rawlen == CDTV_RAW_REPEAT_LENGTH)
&& MATCH_SPACE(results->rawbuf[offset], CDTV_RPT_SPACE)
&& MATCH_MARK(results->rawbuf[offset+1], CDTV_BIT_MARK)) {
results->bits = 4;
results->value = 0xFFFFFF;
results->decode_type = CDTV;
return true;
}
// check on minimal raw length for decoding the 24-bit signal correctly
if (irparams.rawlen < CDTV_RAW_SIGNAL_LENGTH) {
return false;
}
// check header space
if (!MATCH_SPACE(results->rawbuf[offset], CDTV_HDR_SPACE)) {
return false;
}
offset++; // -> offset[3]
// build the data
for (int i = 0; i < CDTV_BITS; i++) {
// check if data mark is available; otherwise break
if (!MATCH_MARK(results->rawbuf[offset], CDTV_BIT_MARK)) {
return false;
}
offset++; // -> offset[4->28]
// append this bit
if (MATCH_SPACE(results->rawbuf[offset], CDTV_ONE_SPACE)) {
data = (data << 1) | 1;
} else if (MATCH_SPACE(results->rawbuf[offset], CDTV_ZERO_SPACE)) {
data = (data << 1) | 0;
} else {
return false;
}
offset++;
}
// validate checksum by comparing lower 12-bits with inverted higher 12-bits
unsigned long lo = data & 0xFFF; // extract lower 12-bit
unsigned long hi = data >> 12; // extract higher 12-bit
// success if (low XOR high == 0xFFF)
if (lo^hi == 0xFFF) {
results->bits = CDTV_BITS;
results->value = data;
results->decode_type = CDTV;
return true;
}
return false;
}
#endif

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
// Reverse Engineered by looking at RAW dumps generated by IRremote

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
#include "ir_Lego_PF_BitStreamEncoder.h"

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//+=============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -31,7 +31,7 @@ You have written the code to support your new protocol!
Now you must do a few things to add it to the IRremote system:
1. Open IRremote.h and make the following changes:
1. Open AIRremote.h and make the following changes:
REMEMEBER to change occurences of "SHUZU" with the name of your protocol
A. At the top, in the section "Supported Protocols", add:
@@ -91,7 +91,7 @@ Regards,
BlueChip
*/
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================

View File

@@ -1,4 +1,4 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================