📄 tpu_pta.h
字号:
/*********************************************************************
*
* 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
********************************************************************/
/**************************************************************************/
/* FILE NAME: tpu_pta.h COPYRIGHT (c) MOTOROLA 2002 */
/* VERSION: 1.0 All Rights Reserved */
/* */
/* DESCRIPTION: This file defines the interface to the TPU PTA function */
/* and provides useful #defines. */
/* */
/*========================================================================*/
/* HISTORY ORIGINAL AUTHOR: Stan Ostrum */
/* */
/* REV AUTHOR DATE DESCRIPTION OF CHANGE */
/* --- ----------- --------- --------------------- */
/* 1.0 Stan Ostrum 31 Aug 02 Initial version of function. */
/**************************************************************************/
#ifndef _TPU_PTA_H
#define _TPU_PTA_H
#include "m_common.h"
#include "m_tpu3.h"
/* Define HSR values */
#define TPU_PTA_INIT 0x3
/* Define modes (HSQ values) */
#define TPU_PTA_HIGH_TIME_ACCUM 0x0
#define TPU_PTA_LOW_TIME_ACCUM 0x1
#define TPU_PTA_PERIOD_ACCUM_RISE 0x2
#define TPU_PTA_PERIOD_ACCUM_FALL 0x3
/* Define timebases */
#define TPU_PTA_TCR1 1
#define TPU_PTA_TCR2 2
/* Define configuration values for TCR1 timebase */
#define TPU_PTA_HI_LOW_PW 0x0F
#define TPU_PTA_PERIOD_RISING 0x07
#define TPU_PTA_PERIOD_FALLING 0x0B
/* Define parameter RAM locations */
#define TPU_PTA_CHAN_CNTL 0
#define TPU_PTA_MAX_CNT_PRD_CNT 1
#define TPU_PTA_LAST_TIME 2
#define TPU_PTA_ACCUM 3
#define TPU_PTA_HIGH_WORD 4
#define TPU_PTA_LOW_WORD 5
/* TPU PTA function prototypes */
void tpu_pta_init(struct TPU3_tag *tpu, UINT8 channel, UINT8 priority, \
UINT8 timebase, UINT8 mode, UINT8 max_count);
UINT32 tpu_pta_get_accumulation(struct TPU3_tag *tpu, UINT8 channel);
UINT8 tpu_pta_get_period_count(struct TPU3_tag *tpu, UINT8 channel);
#endif /* ifndef _TPU_PTA_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -