📄 tvpirrf.h
字号:
#ifndef TVPIRRF_DOT_H_IS_DEFINED
#define TVPIRRF_DOT_H_IS_DEFINED
/*********************************************************************
* Property of Texas Instruments Incorporated, Copyright 2004
* All rights reserved
**********************************************************************/
/*********************************************************************
*
* Description:
* public include file for module
* It includes only the definitions that are needed for the API
*
**********************************************************************/
/*********************************************************************
*
* $Revision: $
*
* $History: TvpIrrf.h $
*
*********************************************************************/
#define TVP_IR_FRAME_RECEIVED 0x01
#define TVP_IR_REC_TIMEOUT 0x02
#define TVP_IR_FRAME_ENCODED 0x04
#define TVP_IR_ENC_NOTRDY 0x08
// IRRF Number
typedef enum {
TVP_IRRF_0 = 0,
TVP_IRRF_1 = 1,
TVP_NUM_IRRF = 2
} TvpIrrfNum;
typedef unsigned long TvpIrrfData;
typedef unsigned char TvpIrrfStatusOut;
typedef unsigned long TvpIrrfIntNum;
/* IR decoding patterns */
typedef struct {
unsigned long preamble[19]; /* pattern of preamble, up to 17 words */
unsigned long repeat[11]; /* pattern of repeat, up to 11 words */
unsigned long stop[7]; /* pattern of stop entry, up to 7 words */
unsigned long data_zero[9]; /* pattern of '0' entry, up to 9 words */
unsigned long data_one[9]; /* pattern of '1' entry, up to 9 words */
unsigned long data_two[9]; /* pattern of '2' entry, up to 9 words */
unsigned long data_three[9]; /* pattern of '3' entry, up to 9 words */
}TvpIRDecPattern;
/* IR decoder configuration structure */
typedef struct {
unsigned int reserved: 21; /* unused bits */
unsigned int rcmm_format: 1; /* '1'= RCMM format, '0'=non_RCMM format */
unsigned int irin_inverted: 1; /* '1'=if IR receiver inverts the incoming stream,
'0'=otherwise */
unsigned int frame_length: 5; /* set as n-1 for non_rcmm format, (n/2 - 1) for rcmm format,
where n is the length of the data
portion of the frame. Max. can be 32 bits */
unsigned int compare_en: 1; /* '1'=if data is required to be written to DOUT
only when it is different from the previous one
'0'=if data s required to be written to DOUT and
generate IRQ for every frame during key press */
unsigned int stop_en: 1; /* '1'=if a stop pattern is expected after the data
stream.
'0'=otherwise. */
unsigned int repeat_en: 1; /* '1'=if a repeat pattern is expected after the first
frame as long as the key is pressed.
'0'=otherwise. */
unsigned int lsb_first: 1; /* '1'=if the MSB is received first and the data is
right justified when written to DOUT.
'0'=if the LSB is received first and the data is
left justified when written to DOUT. */
unsigned short max_frame_int; /* Max. time between start of one header and the start
of next header when the key is pressed.*/
unsigned short count_en_period; /* this count gives the required sampling rate. */
TvpIRDecPattern *pattern; /* definition for each decoding pattern */
}TvpIRDecType;
/* IR encoding patterns */
typedef struct {
unsigned long preamble[9]; /* pattern of preamble, up to 9 words */
unsigned long misc1[9]; /* pattern of X entry, up to 9 words */
unsigned long misc2[9]; /* pattern of Y entry, up to 9 words */
unsigned long stop[9]; /* pattern of stop(Z) entry , up to 9 words */
unsigned long data_zero[5]; /* pattern of data '0', up to 5 words */
unsigned long data_one[5]; /* pattern of data '1', up to 5 words */
unsigned long data_two[5]; /* pattern of data '2', up to 5 words */
unsigned long data_three[5]; /* pattern of data '3', up to 5 words */
}TvpIREncPattern;
/* IR encoder configuration structure */
typedef struct {
unsigned int reserved0: 21; /* unused bits */
unsigned int rcmm_format: 1; /* '1'=RCMM format, '0'=non_RCMM format */
unsigned int irout_inverted: 1; /* '1'=if the IROUT should be inverted,'0'=otherwise*/
unsigned int frame_length: 5; /* set as n-1 for non_rcmm format, (n/2 - 1) for rcmm format,
where n is the length of the data
portion of the frame. Max. can be 32 bits */
unsigned int relay: 1; /* '1'=routes IRIN to IROUT.
'0'=routes commands generated by user to IROUT. */
unsigned int modulated: 1; /* '1'=if the IR output is modulated.
'0'=if not modulated.*/
unsigned int interval_cnt_mode:1; /* this bit selects counting modes for Interval0 and
Interval1 */
unsigned int lsb_first: 1; /* '1'=if the MSB of A and D entries are sent first
on IROUT.
'0'=if the LSB of A and D entires are sent first
on IROUT. */
unsigned int reserved1: 2; /* unused bits*/
unsigned int interval1: 15; /* when interval_cnt_mode='0', it represents time
interval between start of successive repeat portions.
when interval_cnt_mode='1', it represents time
interval between end of the entry pointed by
RPT_POSITION_END and start of the entry pointed by
RPT_POSITION_START.*/
unsigned int interval0: 15; /* when interval_cnt_mode='0', it represents time
interval between start of frame and the start of the
entry pointed by RPT_POSITION_START.
when interval_cnt_mode='1', it represents time
interval between end of the entry before the entry
pointed by RPT_POSITION_START and start of first
repeat protion. */
unsigned long count_en_period; /* it gives the required sampling rate. */
unsigned long frame_code; /* codes for each entry. */
unsigned int reserved2: 22; /* unused bits*/
unsigned int rpt_pos_end: 5; /* pointer to an entry in format register,
in range 0--29 */
unsigned int rpt_pos_start: 5; /* pointer to an entry in format register,
in range 0--29*/
unsigned long rpt_stop; /* Repeat stop. Must be 0 when writing
D_entry. IROUT quits repeating when
set to 1 */
unsigned int reserved3: 10; /* unused bits */
unsigned int carrier_hi: 11; /* it represents the width of the HI part of the carrier. */
unsigned int carrier_lo: 11; /* it represents the width of the LO part of the carrier.*/
TvpIREncPattern *pattern; /* definition for each encoding pattern */
}TvpIREncType;
/* IR encoder words */
typedef struct {
unsigned long A_entry; /* A entry defined by user */
unsigned long D_entry; /* D entry defined by user */
}TvpIREncWord;
/*****************************************************************************
API functions
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
TVP_FERROR tvpIrrfDecodeDrvrInit( TvpIrrfNum irrfNum, TvpIntNum dec_int,
TvpIrrfStatusOut *dec_sts, TvpIrrfData *dec_data);
TVP_FERROR tvpIrrfEncodeDrvrInit( TvpIrrfNum irrfNum, TvpIntNum enc_int,
TvpIrrfStatusOut *enc_sts);
void tvpIrrfDecodeConfigure(TvpIrrfNum irrfNum, TvpIRDecType *irConfigure);
TVP_FERROR tvpIrrfEncodeConfigure(TvpIrrfNum irrfNum, TvpIREncType *irConfigure);
TVP_FERROR tvpIrrfEncodeStart(TvpIrrfNum irrfNum, TvpIREncWord *irWord);
TVP_FERROR tvpIrrfEncodeStop(TvpIrrfNum irrfNum);
#ifdef __cplusplus
};
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -