📄 f28xcap.h
字号:
/* ==================================================================================
File name: F28XCAP.H
Originator: Digital Control Systems Group
Texas Instruments
Description:
Header file containing data type and object definitions and
initializers. Also contains prototypes for the functions in F28XCAP.C.
=====================================================================================
History:
-------------------------------------------------------------------------------------
05-15-2002 Release Rev 1.0
---------------------------------------------------------------------------------- */
#ifndef __F28X_CAP_H__
#define __F28X_CAP_H__
//#include "IQmathLib.h"
#include "f28xbmsk.h"
/*-----------------------------------------------------------------------------
Initialization states for T2CON,T4CON and CAPCONA,CAPCONB
------------------------------------------------------------------------------*/
#define CAP_INIT_STATE 0xA0F0//0xA050//
#define CAP_TIMER_INIT_STATE (FREE_RUN_FLAG+TIMER_CONT_UP+TIMER_CLK_PRESCALE_X_128+ \
TIMER_ENABLE_BY_OWN+TIMER_ENABLE+ \
TIMER_CLOCK_SRC_INTERNAL+ TIMER_COMPARE_LD_ON_ZERO)
/*-----------------------------------------------------------------------------
Define the structure of the Capture Driver Object
------------------------------------------------------------------------------*/
typedef struct { unsigned int time_stamp; /* Output: Timer value when capture is detected (Q0) */
unsigned int time_stamp_old;
unsigned long time_stamp_idx;
int wait;
int skip_time;//本次计算跨过的计数周期
int FIFO_state;
int FIFO_state_last;
_iq Tc;
_iq wc;
_iq speed;
void (*init)(); /* Pointer to the init function */
int (*read)(); /* Pointer to the read function */
void (*calc)(); /* Pointer to the calc funtion */
void (*ISR)();
} CAPTURE;
/*-----------------------------------------------------------------------------
Define a handle for the CAPTURE object
------------------------------------------------------------------------------*/
typedef CAPTURE *CAPTURE_handle;
/*------------------------------------------------------------------------------
Default Initializer for the F28X_EV1 CAPTURE Object
------------------------------------------------------------------------------*/
#define F28XEV1CAP1 {0, 0,0, 0,1,0,0,0,0,0, \
(void (*)(long))F28X_EV1_CAP_Init, \
(int (*)(long))F28X_EV1_CAP_Read, \
(void (*)(long))F28X_EV1_CAP_Calc, \
(void (*)(long))F28X_EV1_CAP_ISR }
/*------------------------------------------------------------------------------
Target Independent Default Initializer CAPTURE Object
------------------------------------------------------------------------------*/
#define CAPTURE_DEFAULTS F28XEV1CAP1
/*------------------------------------------------------------------------------
Prototypes for the functions in F28XCAP.C
------------------------------------------------------------------------------*/
void F28X_EV1_CAP_Init(CAPTURE_handle);
int F28X_EV1_CAP_Read(CAPTURE_handle);
void F28X_EV1_CAP_Calc(CAPTURE_handle);
void F28X_EV1_CAP_ISR(CAPTURE_handle);
#endif /* __F28X_CAP_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -