infrared.c

来自「在2410开发板上进行红外通讯实验」· C语言 代码 · 共 18 行

C
18
字号
#include "inc/lib.h"
#define ULCON2	(*(volatile unsigned char *)0x50008000)
#define UCON2	(*(volatile unsigned char *)0x50008004)
 void infraredT(void)   
   {  UCON2=UCON2&0x7fc;         //禁止接收
      UCON2=UCON2&0x7f3;         //禁止发送
      ULCON2=ULCON2|(1<<6);      //红外模式
      hudelay(100);
      UCON2=UCON2|(0x01<<2);     //允许发送
    }
    
 void infraredR(void) 
   { UCON2=UCON2&0x7f3;        //禁止发送
	 UCON2=UCON2&0x7fc;        //禁止接收
	 ULCON2=ULCON2|(1<<6);     //红外模式
	 hudelay(1000);
	 UCON2=UCON2|0x01;        //允许接收 
	}   

⌨️ 快捷键说明

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