⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ir.h

📁 This is IR (Infra-Red) learn module for home automation system. It can learn IR codes from different
💻 H
字号:
#ifndef __IR_H__
#define __IR_H__

/*
 *  FILE:
 *     ir.h (rev. 1.0 - 21.04.2006)
 *
 *  PROJECT:
 *     IR Learn System 
 *  
 *  DESCRIPTION:
 *     Provides functions for IR control
 *     (uses Timer 1 and Ext.Interrupt 0)
*/  

#include "types.h"
#include "timer.h"

// Define Timer reload values for ~20 ms delay
#define IR_TMR_Val (65536 - (unsigned int)(OSC_FREQ / (OSC_PER_INST * 50)))
#define IR_TMR_Hi  (IR_TMR_Val/256)
#define IR_TMR_Lo  (IR_TMR_Val%256)

extern volatile BOOL IR_StartCatch;     // Start IR catch flag
extern volatile U8   IR_CodeLen;        // Length of captured sequence (bits)
extern volatile U8   IR_KeyLen;         // Length of key sequence
extern volatile U8   IR_KeyPtr;         // Pointer to current key

extern xdata U8 IR_CodeSeq[8];          // Captured code
extern xdata U8 IR_KeySeq[16];          // Keyboard sequence

void IR_Init();     // Initialize IR data and EXT0 interrupt
void IR_Assign();   // Right-click Menu->IR Assign
void IR_Learn();    // Right-click Menu->IR Learn
void IR_Check();    // Check current captured IR code with learned codes

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -