📄 ir_api.h
字号:
/******************************************************************************
* Filename : Ir_api.h *
* Start date : *
* By : S.C.Kwon *
* Contact : *
* Description : low level api headers.(for only high level api) *
* *
******************************************************************************
*/
#ifndef _IR_API_H_
#define _IR_API_H_
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************
* Data types
*********************************************/
typedef enum {
TimerA=0,
TimerB,
TimerC,
TimerD
}Timer_Select_t;
extern volatile BYTE4 gIr_dev_type;
/*********************************************
* Define
*********************************************/
#define REMOCONMSG_NORMAL 0x0001
#define REMOCONMSG_POINTING 0x0002
#define REMOCON_DEBUG 1
#define IR_CLOCK_DEV_1024 1024
#define IR_CLOCK_DEV_2048 2048
#define IR_CLOCK_DEV_4096 4096
#define IR_CLOCK_DEV_8192 8192
//#define IR_CYCLE (DOUBLE)(S5H_PCLK/gIr_dev_type)
#define IR_CYCLE (DOUBLE)(108000000/8192)
#define IR_READ_PULSE (USHORT)(IR_CYCLE/(1000.0/13.5)) /* 13.50ms */
#define IR_DATA_ZERO (USHORT)(IR_CYCLE/(1000.0/1.125)) /* 1.125ms */
#define IR_DATA_ONE (USHORT)(IR_CYCLE/(1000.0/2.25)) /* 2.250ms */
//victor.li for repeat key
//#define IR_DATA_REPEAT (USHORT)(IR_CYCLE/(1000.0/4.5)) /* 4.50ms */
#define IR_DATA_REPEAT (USHORT)(IR_CYCLE/(1000.0/97))
#define IR_READ_PULSE_MIN (IR_READ_PULSE - 6)
#define IR_READ_PULSE_MAX (IR_READ_PULSE + 6)
#define IR_DATA_ZERO_MIN (IR_DATA_ZERO - 4)
#define IR_DATA_ZERO_MAX (IR_DATA_ZERO + 4)
#define IR_DATA_ONE_MIN (IR_DATA_ONE - 4)
#define IR_DATA_ONE_MAX (IR_DATA_ONE + 4)
//victor.li for repeat key
#define IR_DATA_REPEAT_MIN (IR_DATA_REPEAT-60)
#define IR_DATA_REPEAT_MAX (IR_DATA_REPEAT+60)
#ifndef SAMSUNG_REMOTE //VCD_REMOTE
#define CustomCode 0x000000ff
#define IR_CUSTOM_NUM 16
#define IR_RECEIVE_OK 24
#else
#define CustomCode 0x198133f //0x6620f3
#define IR_CUSTOM_NUM 26 //24 //26
#define IR_RECEIVE_OK 34 //32 //34 // (42-bit) - user_bar(8-bit)
#endif
#define IR_COMMAND 0x0004
#define IR_COMMAND_BAR 0x0008
#define IR_TOTLE_NUM 42
//#define IrInt_Clr(n) rIRCON = ((rIRCON & 0x7ff) | 01<<(n)) /* IR Pending bit clear */
#define Ir_full_int 14
#define Ir_cap_int 13
#define Ir_ovf_int 12
#define IR_FULL_STATE 01<<7
#define IR_EMPTY_STATE 01<<6
/* K_H to merge ADC_KEY input */
#define INPUT_IS_NONE 0x0
#define INPUT_ON_IR (0x1)
#define INPUT_ON_KEY (0x1<<1)
/*********************************************
* Functions Define
*********************************************/
void IR_Init( BYTE4 ir_dev_type );
void IR_Reset( BYTE4 ir_dev_type );
//void Timer_Set(Timer_Select_t timer_select, UINT time_usec);
void IrInt_Clr(unsigned long x);
#ifdef __cplusplus
}
#endif
#endif /* _IR_API_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -