📄 tpu_fqm.h
字号:
/**************************************************************************/
/* FILE NAME: tpu_fqm.h COPYRIGHT (c) MOTOROLA 2002 */
/* VERSION: 0.1 All Rights Reserved */
/* */
//* DESCRIPTION: */
/* This file defines all of the registers and bit fields on the TPU3 */
/* Frequency Measurement (FQM) function. */
/*========================================================================*/
/* AUTHOR: Randy Dees */
/* COMPILER: Diab Data VERSION: 4.3g */
/* */
/* HISTORY */
/* REV AUTHOR DATE DESCRIPTION OF CHANGE */
/* --- ----------- ---------- --------------------- */
/* 0.1 R. Dees 07/Sept/02 Initial version for FQM */
/* */
/**************************************************************************/
#include "m_tpu3.h"
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************/
/* Definition of terms and initial settings */
/*************************************************************/
/* Define HSQ values (mode) */
#define TPU_FQM_FALL_EDGE_SING 0x0 /* Begin with Falling Edge, Single-Shot Mode */
#define TPU_FQM_FALL_EDGE_CONT 0x1 /* Begin with Falling Edge, Continuous Mode */
#define TPU_FQM_RISE_EDGE_SING 0x2 /* Begin with Rising Edge, Single-Shot Mode */
#define TPU_FQM_RISE_EDGE_CONT 0x3 /* Begin with Rising Edge, Continuous Mode */
/* Define the Mode values */
#define TPU_FQM_SINGLE 0x0 /* Single-Shot Mode */
#define TPU_FQM_CONT 0x1 /* Continuous Mode */
#define TPU_FQM_MODE_MASK 0x1 /* MASK for illegal values */
/* Define HSR values */
#define TPU_FQM_NO_HOST 0x0 /* No Host Service (Reset Condition) */
#define TPU_FQM_NOT_USED_1 0x1 /* Not Used */
#define TPU_FQM_INIT 0x2 /* Initialize */
#define TPU_FQM_NOT_USED_3 0x3 /* Not Used */
/* Define test result values */
#define TPU_FQM_TRUE 1
#define TPU_FQM_FALSE 0
/* Define TPU_Channel Control. PSC is always 0b11 */
#define TPU_FQM_PSC 3
#define TPU_FQM_RISE 1 /* Detect Rising Edge */
#define TPU_FQM_FALL 2 /* Detect Falling Edge */
#define TPU_FQM_PAC_MASK 0x7
#define TPU_FQM_TCR1 0 /* Capture TCR1, Match TCR1 */
#define TPU_FQM_TCR2 3 /* Capture TCR2, Match TCR2 */
#define TPU_FQM_TBS_MASK 0xF
/* Define parameter RAM locations */
#define TPU_FQM_PRM_0 0 /* Not Used */
#define TPU_FQM_PRM_1 1 /* Not Used */
#define TPU_FQM_CHANEL_CONTROL 2 /* Channel Control - set rise/fall, TCR1 or TCR2 */
#define TPU_FQM_WINDOW_SIZE 3 /* Sample Window Size */
#define TPU_FQM_PULSE_COUNT 4 /* Pulse Count - Result from TPU*/
#define TPU_FQM_IN_WINDOW_ACCUMULATOR 5 /* In Window Accumulator - used by TPU */
#define TPU_FQM_PRM_6 6 /* Not Used */
#define TPU_FQM_PRM_7 7 /* Not Used */
/* Prototype of functions */
void tpu_fqm_init(struct TPU3_tag *tpu, UINT8 channel,
UINT8 priority, UINT8 mode, UINT8 edge,
UINT8 timer, UINT16 wind_sz);
void tpu_fqm_update_window_size(struct TPU3_tag *tpu,
UINT8 channel, UINT16 wind_sz);
UINT16 tpu_fqm_get_pulse(struct TPU3_tag *tpu, UINT8 channel);
void setup_tpu(struct TPU3_tag *tpu);
#ifdef __cplusplus
}
#endif
/*********************************************************************
*
* Copyright:
* MOTOROLA, INC. All Rights Reserved.
* You are hereby granted a copyright license to use, modify, and
* distribute the SOFTWARE so long as this entire notice is
* retained without alteration in any modified and/or redistributed
* versions, and that such modified versions are clearly identified
* as such. No licenses are granted by implication, estoppel or
* otherwise under any patents or trademarks of Motorola, Inc. This
* software is provided on an "AS IS" basis and without warranty.
*
* To the maximum extent permitted by applicable law, MOTOROLA
* DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
* PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE
* SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY
* ACCOMPANYING WRITTEN MATERIALS.
*
* To the maximum extent permitted by applicable law, IN NO EVENT
* SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING
* WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
* INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
* LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
*
* Motorola assumes no responsibility for the maintenance and support
* of this software
********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -