📄 mod_regs_tmr.h
字号:
#ifndef CYGONCE_MOD_REGS_TMR_H
#define CYGONCE_MOD_REGS_TMR_H
//==========================================================================
//
// mod_regs_tmr.h
//
// TPU/TMR Register
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): Uwe Kindler
// Contributors: Uwe Kindler
// Date: 2004-11-03
//
//####DESCRIPTIONEND####
//
//==========================================================================
//==========================================================================
// DOXYGEN FILE HEADER
/// \file mod_regs_tmr.h
/// \brief TPU/TMR Register definitions.
/// \author Uwe Kindler
/// \date 2004-11-04
//==========================================================================
//==========================================================================
// REGISTER ADDRESSES
//==========================================================================
#define CYGARC_TSTR 0xFFFEB0
#define CYGARC_TSYR 0XFFFEB1
//--------------------------------------------------------------------------
// Timer 0
//
#define CYGARC_TCR0 0xFFFF10
#define CYGARC_TMDR0 0xFFFF11
#define CYGARC_TIORH0 0xFFFF12
#define CYGARC_TIORL0 0xFFFF13
#define CYGARC_TIER0 0xFFFF14
#define CYGARC_TSR0 0xFFFF15
#define CYGARC_TCNT0 0xFFFF16
#define CYGARC_TGRA0 0xFFFF18
#define CYGARC_TGRB0 0xFFFF1A
#define CYGARC_TGRC0 0xFFFF1C
#define CYGARC_TGRD0 0xFFFF1E
//--------------------------------------------------------------------------
// Timer 1
//
#define CYGARC_TCR1 0xFFFF20
#define CYGARC_TMDR1 0xFFFF21
#define CYGARC_TIOR1 0xFFFF22
#define CYGARC_TIER1 0xFFFF24
#define CYGARC_TSR1 0xFFFF25
#define CYGARC_TCNT1 0xFFFF26
#define CYGARC_TGRA1 0xFFFF28
#define CYGARC_TGRB1 0xFFFF2A
//--------------------------------------------------------------------------
// Timer 2
//
#define CYGARC_TCR2 0xFFFF30
#define CYGARC_TMDR2 0xFFFF31
#define CYGARC_TIOR2 0xFFFF32
#define CYGARC_TIER2 0xFFFF34
#define CYGARC_TSR2 0xFFFF35
#define CYGARC_TCNT2 0xFFFF36
#define CYGARC_TGRA2 0xFFFF38
#define CYGARC_TGRB2 0xFFFF3A
//--------------------------------------------------------------------------
// Timer 3
//
#define CYGARC_TCR3 0xFFFE80
#define CYGARC_TMDR3 0xFFFE81
#define CYGARC_TIORH3 0xFFFE82
#define CYGARC_TIORL3 0xFFFE83
#define CYGARC_TIER3 0xFFFE84
#define CYGARC_TSR3 0xFFFE85
#define CYGARC_TCNT3 0xFFFE86
#define CYGARC_TGRA3 0xFFFE88
#define CYGARC_TGRB3 0xFFFE8A
#define CYGARC_TGRC3 0xFFFE8C
#define CYGARC_TGRD3 0xFFFE8E
//--------------------------------------------------------------------------
// Timer 4
//
#define CYGARC_TCR4 0xFFFE90
#define CYGARC_TMDR4 0xFFFE91
#define CYGARC_TIOR4 0xFFFE92
#define CYGARC_TIER4 0xFFFE94
#define CYGARC_TSR4 0xFFFE95
#define CYGARC_TCNT4 0xFFFE96
#define CYGARC_TGRA4 0xFFFE98
#define CYGARC_TGRB4 0xFFFE9A
//--------------------------------------------------------------------------
// Timer 5
//
#define CYGARC_TCR5 0xFFFEA0
#define CYGARC_TMDR5 0xFFFEA1
#define CYGARC_TIOR5 0xFFFEA2
#define CYGARC_TIER5 0xFFFEA4
#define CYGARC_TSR5 0xFFFEA5
#define CYGARC_TCNT5 0xFFFEA6
#define CYGARC_TGRA5 0xFFFEA8
#define CYGARC_TGRB5 0xFFFEAA
//--------------------------------------------------------------------------
// Register Bit definition for TPU
//
// TCR bit definitions
//
#define CYGARC_TCR_CLR_CMA 0x20 // TCNT cleared by TGRA compare match/input capture
#define CYGARC_TCR_CLR_CMB 0x40 // TCNT cleared by TGRB compare match/input capture
#define CYGARC_TCR_CLR_CMC 0xA0 // TCNT cleared by TGRC compare match/input capture
#define CYCARC_TCR_CLR_CMD 0xC0 // TCNT cleared by TGRA compare match/input capture
#define CYGARC_TCR_CKE_RISING 0x00 // Count at rising input cock edge
#define CYGARC_TCR_CKE_FALLING 0x08 // Count at falling input cock edge
#define CYGARC_TCR_CKE_BOTH 0x10 // Count at both input cock edges
#define CYGARC_TCR_TPSC_1 0x00 // Internal clock: counts on clock/1
#define CYGARC_TCR_TPSC_4 0x01 // Internal clock: counts on clock/4
#define CYGARC_TCR_TPSC_16 0x02 // Internal clock: counts on clock/16
#define CYGARC_TCR_TPSC_64 0x03 // Internal clock: counts on clock/64
//
// TSTR - Counter start 0 - 5
//
#define CYGARC_TSTR_CST0 0x01
#define CYGARC_TSTR_CST1 0x02
#define CYGARC_TSTR_CST2 0x04
#define CYGARC_TSTR_CST3 0x08
#define CYGARC_TSTR_CST4 0x10
#define CYGARC_TSTR_CST5 0x20
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -