📄 f280xcap.h
字号:
/* ==================================================================================
File name: F280XCAP.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 F280XCAP.C.
Target: TMS320F280x family
=====================================================================================
History:
-------------------------------------------------------------------------------------
04-15-2005 Version 3.20: Using DSP280x v. 1.10 or higher
------------------------------------------------------------------------------------*/
#ifndef __F280X_CAP_H__
#define __F280X_CAP_H__
#include "f280xbmsk.h"
/*-----------------------------------------------------------------------------
Initialization states for ECAP Control Registers 1 and 2 for ECAP1
------------------------------------------------------------------------------*/
#define ECCTL1_INIT_STATE ( CAP1POL_RISING_EDGE + \
CAPLDEN_ENABLE + \
CTRRST1_DIFFERENCE_TS + \
EVTFLTPS_X_1 + \
EMULATION_FREE )
#define ECCTL2_INIT_STATE ( CONTINUOUS_MODE + \
TSCNTSTP_FREE + \
SYNCI_DISABLE + \
SYNCO_DISABLE + \
CAPTURE_MODE )
/*-----------------------------------------------------------------------------
Define the structure of the Capture Driver Object
------------------------------------------------------------------------------*/
typedef struct { int32 EventPeriod; // Output: Timer value difference between two edges detected (Q0)
void (*init)(); // Pointer to the init function
Uint16 (*read)(); // Pointer to the read function
} CAPTURE;
/*-----------------------------------------------------------------------------
Define a handle for the CAPTURE object
------------------------------------------------------------------------------*/
typedef CAPTURE *CAPTURE_handle;
/*------------------------------------------------------------------------------
Default Initializer for the F280X CAPTURE Object
------------------------------------------------------------------------------*/
#define F280XCAP1 {1, \
(void (*)(Uint32))F280X_CAP_Init, \
(Uint16 (*)(Uint32))F280X_CAP_Read \
}
/*------------------------------------------------------------------------------
Target Independent Default Initializer CAPTURE Object
------------------------------------------------------------------------------*/
#define CAPTURE_DEFAULTS F280XCAP1
/*------------------------------------------------------------------------------
Prototypes for the functions in F280XCAP.C
------------------------------------------------------------------------------*/
void F280X_CAP_Init(CAPTURE_handle);
Uint16 F280X_CAP_Read(CAPTURE_handle);
#endif // __F280X_CAP_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -