static void irda_set_int_mask(UINT8 int_en_bits)
{
UINT32 value;
value = REG_READ(IRDA_INT_MASK);
value &= ~INT_MASK_EN;
value |= int_en_bits;
REG_WRITE(IRDA_INT_MASK, value);
}
UINT32 Recv_IR_Code = 0xffffffff;
void irda_isr(void)
static UINT16 ValidFlag = 0;
UINT32 irda_int;
UINT32 end_int, right_int, repeat_int;
irda_int = REG_READ(IRDA_INT);
end_int = irda_int&IRDA_END_INT;
right_int = irda_int&IRDA_RIGHT_INT;
repeat_int = irda_int&IRDA_REPEAT_INT;
if(end_int)
if (ValidFlag)
ValidFlag = 0x0;
Recv_IR_Code = REG_READ(RX_FIFO_DOUT);
//打印出解码的内容,实际上只需要cmd部分,即第2字节
//PR_NOTICE("Recv_IR_Code:%08X",(Recv_IR_Code>>16)&0xff);
else
Recv_IR_Code=0xFFFFFFFF;
irda_int |= IRDA_END_INT;
if(right_int)
ValidFlag = 1 ;
irda_int |= IRDA_RIGHT_INT;
if(repeat_int)
irda_int |= IRDA_REPEAT_INT;
REG_WRITE(IRDA_INT, irda_int);
查看更多
回到 顶部
发布 问题
分享 好友
手机 浏览
投诉 建议
回到 底部