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

📄 irtbl.c

📁 ESS 公司VCD软件关于IR的编程!
💻 C
字号:
/* SCCSID @(#)irtbl.c	1.14 01/09/04 */

/************************************************************************
 * For IR.								*
 ************************************************************************/

#define IRERR 20

/*
 * When DSC_IRQ is defined, we use internal 3881 counters to keep
 * track of time.
 *
 * The counter increments at .1517ms interval (2048/13.5MHz). It only
 * triggers on one edge (default is falling) as oppose to the old
 * style where we triggers on both edge.
 */

/* Timer values when CPU is running at full speed */
#if !defined(SF_BASECODE) || defined(BC_WITH_TBL)
unsigned int IR_rom_tbl[] = {
#else
unsigned int IR_rom_table[] = {
#endif
#ifdef DSC_IRQ
    #ifdef IR_PHILIPS		/* For Philips format		*/
	#ifdef DSC_IRQ_USETIMER2
	    50,		/* minimum length of half bit	*/
	    130,	/* maximum length of half bit	*/
	    140,	/* minimum length of one bit	*/
	    240,	/* maximum length of one bit	*/
	#else	/* Use 3881's internal counter to keep track of time	*/
	    3,
	    8,
	    9,
	    16,
	#endif /* else of DSC_IRQ_USETIMER2 */
    #else			/* For NEC and SANYO formats	*/
	#ifdef DSC_IRQ_USETIMER2
	    1330,	/* Leader minimum		*/
	    1370,	/* Leader maximum		*/
	    205,	/* Data 1 minimum		*/
	    245,	/* Data 1 maximum		*/
	    92,		/* Data 0 minimum		*/
	    132,        /* Data 0 maximum       	*/
	    #ifdef IRREP
		1100,  		/* Repeat low+high min      	*/
		1150,		/* Repeat low+high max		*/
	    #endif
            #ifdef DANCER
                380,           /* Leader minimum               */
                420,           /* Leader maximum               */
                64,            /* Data 1 minimum               */
                104,           /* Data 1 maximum               */
                110,           /* Data 0 minimum               */
                150,           /* Data 0 maximum               */
            #endif
	#else	/* Use 3881's internal counter to keep track of time	*/
	    85,			/* Leader low+high min (12.89ms)*/
	    93,			/* Leader low+high max (14.10ms)*/
	    12,			/* Gap+data 1 minimum (1.82ms)	*/
	    19,			/* Gap+data 1 maximum (2.88ms)	*/
	    4,			/* Gap+data 0 minimum (0.61ms)	*/
	    11,			/* Gap+data 0 maximum (1.67ms)	*/
	    #ifdef IRREP
		70,		/* Rep low+high min (10.62ms)	*/
		78,		/* Rep low+high max (11.83ms)	*/
	    #endif /* IRREP */
	#endif /* else of DSC_IRQ_USETIMER2 (for NEC) */
    #endif /* else IR_PHILIPS */
#else
#ifdef EAUX_IR
    #ifdef IR_PHILIPS		/* For Philips format		*/
       	/* Use 3881's internal counter to keep track of time	*/
	    3,
	    8,
	    9,
	    16,
    #else				/* For NEC and SANYO formats	*/
       	/* Use 3881's internal counter to keep track of time	*/
	    85,				/* Leader low+high min (12.89ms)*/
	    93,				/* Leader low+high max (14.10ms)*/
	    12,				/* Gap+data 1 minimum (1.82ms)	*/
	    19,				/* Gap+data 1 maximum (2.88ms)	*/
	    4,				/* Gap+data 0 minimum (0.61ms)	*/
	    11,				/* Gap+data 0 maximum (1.67ms)	*/
	    #ifdef IRREP
		70,			/* Rep low+high min (10.62ms)	*/
		78,			/* Rep low+high max (11.83ms)	*/
	    #endif /* IRREP */
    #endif /* else IR_PHILIPS */
#else
    /* Use CPU's timer2 to keep track of time				*/
    #ifdef IR_PHILIPS		/* For Philips format		*/
	50,			/* minimum length of half bit	*/
	130,			/* maximum length of half bit	*/
	140,			/* minimum length of one bit	*/
	240,			/* maximum length of one bit	*/
    #else			/* For NEC and SANYO formats	*/
	(900-IRERR),		/* Leader low minimum		*/
	(900+IRERR),		/* Leader low maximum		*/
	(450-IRERR),		/* Leader high minimum		*/
	(450+IRERR),		/* Leader high maximum		*/
	(225-IRERR),		/* Data 1 minimum		*/
	(225+IRERR),		/* Data 1 maximum		*/
	(112-IRERR),		/* Data 0 minimum		*/
	(112+IRERR),		/* Data 0 maximum       	*/
	#ifdef IRREP
	    205,		/* Repeat high minimum		*/
	    245,		/* Repeat high mazimum		*/
	    36,		/* Repeat data minimum		*/
	    76			/* Repeat data maximum       	*/
	#endif /* IRREP */
    #endif /* else of IR_PHILIPS */
#endif /* else of EAUX_IR */
#endif /* else of DSC_IRQ */
};

#if defined(SF_BASECODE) && !defined(BC_WITH_TBL)
int * IR_rom_tbl = IR_rom_table;
int   T_IR_rom_tbl_SZ = sizeof(IR_rom_table)/4;
#endif

⌨️ 快捷键说明

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