📄 example_freqcal.h
字号:
// TI File $Revision: /main/1 $
// Checkin $Date: December 1, 2004 11:30:48 $
//###########################################################################
//
// FILE: Example_freqcal.h
//
// TITLE: Frequency measurement using EQEP peripheral
//
// DESCRIPTION:
//
// Header file containing data type and object definitions and
// initializers.
//
//###########################################################################
// Original Author: SD
//
// $TI Release: DSP280x, DSP2801x Header Files V1.41 $
// $Release Date: August 7th, 2006 $
//###########################################################################
#ifndef __FREQCAL__
#define __FREQCAL__
#include "IQmathLib.h" // Include header for IQmath library
/*-----------------------------------------------------------------------------
Define the structure of the FREQCAL Object
-----------------------------------------------------------------------------*/
typedef struct {
Uint32 freqScaler_pr; // Parameter : Scaler converting 1/N cycles to a GLOBAL_Q freq (Q0) - independently with global Q
Uint32 freqScaler_fr; // Parameter : Scaler converting 1/N cycles to a GLOBAL_Q freq (Q0) - independently with global Q
Uint32 BaseFreq; // Parameter : Maximum Freq
_iq freq_pr; // Output : Freq in per-unit using capture unit
int32 freqhz_pr; // Output: Freq in Hz, measured using Capture unit
Uint32 oldpos;
_iq freq_fr; // Output : Freq in per-unit using position counter
int32 freqhz_fr; // Output: Freq in Hz, measured using Capture unit
void (*init)(); // Pointer to the init funcion
void (*calc)(); // Pointer to the calc funtion
} FREQCAL;
/*-----------------------------------------------------------------------------
Define a QEP_handle
-----------------------------------------------------------------------------*/
typedef FREQCAL *FREQCAL_handle;
/*-----------------------------------------------------------------------------
Default initializer for the FREQCAL Object.
-----------------------------------------------------------------------------*/
#define FREQCAL_DEFAULTS {\
313,200,10000,0,0,\
0,0,0,\
(void (*)(long))FREQCAL_Init,\
(void (*)(long))FREQCAL_Calc }
/*-----------------------------------------------------------------------------
Prototypes for the functions in F28XQEP.C
-----------------------------------------------------------------------------*/
void FREQCAL_Init(void);
void FREQCAL_Calc(FREQCAL_handle);
#endif /* __FREQCAL__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -