Skip to content
Snippets Groups Projects
Select Git revision
  • 62366312fc2ea3746bc8d17b4b8f922d4fc48dda
  • 5.4 default protected
  • 5.5
  • dev/5.5
  • dev/5.4
  • dev/5.6
  • dev/5.3_downgrade
  • feature/experimenttime_hack
  • 5.3 protected
  • _IntenSelect5.3
  • IntenSelect5.3
  • 4.27 protected
  • 4.26 protected
  • 5.0 protected
  • 4.22 protected
  • 4.21 protected
  • UE5.4-2024.1
  • UE5.5-1
  • UE5.4-2024.1-rc1
  • UE5.3-2023.1-rc3
  • UE5.3-2023.1-rc2
  • UE5.3-2023.1-rc
22 results

DemoConfig.h

Blame
  • ir_Aiwa.cpp 3.40 KiB
    #include "IRremote.h"
    #include "IRremoteInt.h"
    
    //==============================================================================
    //                         AAA   IIIII  W   W   AAA
    //                        A   A    I    W   W  A   A
    //                        AAAAA    I    W W W  AAAAA
    //                        A   A    I    W W W  A   A
    //                        A   A  IIIII   WWW   A   A
    //==============================================================================
    
    // Based off the RC-T501 RCU
    // Lirc file http://lirc.sourceforge.net/remotes/aiwa/RC-T501
    
    #define AIWA_RC_T501_HZ            38
    #define AIWA_RC_T501_BITS          15
    #define AIWA_RC_T501_PRE_BITS      26
    #define AIWA_RC_T501_POST_BITS      1
    #define AIWA_RC_T501_SUM_BITS    (AIWA_RC_T501_PRE_BITS + AIWA_RC_T501_BITS + AIWA_RC_T501_POST_BITS)
    #define AIWA_RC_T501_HDR_MARK    8800
    #define AIWA_RC_T501_HDR_SPACE   4500
    #define AIWA_RC_T501_BIT_MARK     500
    #define AIWA_RC_T501_ONE_SPACE    600
    #define AIWA_RC_T501_ZERO_SPACE  1700
    
    //+=============================================================================
    #if SEND_AIWA_RC_T501
    void  IRsend::sendAiwaRCT501 (int code)
    {
    	unsigned long  pre = 0x0227EEC0;  // 26-bits
    
    	// Set IR carrier frequency
    	enableIROut(AIWA_RC_T501_HZ);
    
    	// Header
    	mark(AIWA_RC_T501_HDR_MARK);
    	space(AIWA_RC_T501_HDR_SPACE);
    
    	// Send "pre" data
    	for (unsigned long  mask = 1UL << (26 - 1);  mask;  mask >>= 1) {
    		mark(AIWA_RC_T501_BIT_MARK);
    		if (pre & mask)  space(AIWA_RC_T501_ONE_SPACE) ;
    		else             space(AIWA_RC_T501_ZERO_SPACE) ;
    	}
    
    //-v- THIS CODE LOOKS LIKE IT MIGHT BE WRONG - CHECK!
    //    it only send 15bits and ignores the top bit
    //    then uses TOPBIT which is 0x80000000 to check the bit code
    //    I suspect TOPBIT should be changed to 0x00008000
    
    	// Skip first code bit
    	code <<= 1;
    	// Send code
    	for (int  i = 0;  i < 15;  i++) {
    		mark(AIWA_RC_T501_BIT_MARK);
    		if (code & 0x80000000)  space(AIWA_RC_T501_ONE_SPACE) ;
    		else                    space(AIWA_RC_T501_ZERO_SPACE) ;
    		code <<= 1;
    	}
    
    //-^- THIS CODE LOOKS LIKE IT MIGHT BE WRONG - CHECK!
    
    	// POST-DATA, 1 bit, 0x0
    	mark(AIWA_RC_T501_BIT_MARK);
    	space(AIWA_RC_T501_ZERO_SPACE);
    
    	mark(AIWA_RC_T501_BIT_MARK);
    	space(0);
    }
    #endif