⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tid_8xx_def.h

📁 mpc8xx driver(led), based on tqm8
💻 H
字号:
/*********************************************************************** * * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * Jean-Jacques Germond, Fr閐閞ic Soulier, Christian Batt; Alcatel * C/O jjg@sxb.bsf.alcatel.fr * * All rights reserved. * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU *Library* General Public License * as published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This code 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 * *Library* General Public License for more details. * * You should have received a copy of the GNU *Library* General Public * License along with this program (see file COPYING.LIB); if not, * write to the Free Software Foundation, Inc., 675 Mass Ave, * Cambridge, MA 02139, USA. * ***********************************************************************//* * Definitions to access the CPM Timer registers * See 8xx_immap.h for Internal Memory Map layout, * and commproc.h for CPM Interrupt vectors (aka "IRQ"s) */typedef struct tid_8xx_cpmtimer_s {  ushort	*tgcrp;		/* Pointer to Timer Global Config Reg.	*/  ushort	*tmrp;		/* Pointer to Timer Mode Register	*/  ushort	*trrp;		/* Pointer to Timer Reference Register	*/  ushort	*tcrp;		/* Pointer to Timer Capture Register	*/  ushort	*tcnp;		/* Pointer to Timer Counter Register	*/  ushort	*terp;		/* Pointer to Timer Event Register	*/  int		 cpm_vec;	/* CPM Interrupt Vector for this timer	*/} tid_8xx_cpmtimer_t;/* Hack to provide a default clock rate. You might want to * define TQM_CLOCKRATE at the makefile level in the CFLAGS. */#ifndef TQM_CLOCKRATE#  define TQM_CLOCKRATE 64#endif#define	CPMT_CLOCK_DIV		16#define	CPMT_MAX_PRESCALER	256#define CPMT_MAX_REFERENCE	65535	/* max. unsigned short */#define	CPMT_MAX_TICKS		(CPMT_MAX_REFERENCE * CPMT_MAX_PRESCALER)#define	CPMT_MAX_TICKS_WITH_DIV	(CPMT_MAX_REFERENCE * CPMT_MAX_PRESCALER * CPMT_CLOCK_DIV)#define	CPMT_MAX_INTERVAL	(CPMT_MAX_TICKS_WITH_DIV / TQM_CLOCKRATE)/* For now: always use max. prescaler value */#define	CPMT_PRESCALER		(CPMT_MAX_PRESCALER)/* CPM Timer Event Register Bits */#define	CPMT_EVENT_CAP		0x0001	/* Capture Event		*/#define	CPMT_EVENT_REF		0x0002	/* Reference Counter Event	*//* CPM Timer Global Config Register */#define	CPMT_GCR_RST		0x0001	/* Reset  Timer			*/#define	CPMT_GCR_STP		0x0002	/* Stop   Timer			*/#define	CPMT_GCR_FRZ		0x0004	/* Freeze Timer			*/#define	CPMT_GCR_GM_CAS		0x0008	/* Gate Mode / Cascade Timers	*/#define	CPMT_GCR_MASK		(CPMT_GCR_RST|CPMT_GCR_STP|CPMT_GCR_FRZ|CPMT_GCR_GM_CAS)/* CPM Timer Mode register */#define	CPMT_MR_GE		0x0001	/* Gate Enable			*/#define	CPMT_MR_ICLK_CASC	0x0000	/* Clock internally cascaded	*/#define	CPMT_MR_ICLK_CLK	0x0002	/* Clock = system clock		*/#define	CPMT_MR_ICLK_CLKDIV	0x0004	/* Clock = system clock / 16	*/#define	CPMT_MR_ICLK_TIN	0x0006	/* Clock = TINx signal		*/#define	CPMT_MR_FRR		0x0008	/* Free Run / Restart		*/#define	CPMT_MR_ORI		0x0010	/* Out. Reference Interrupt En.	*/#define	CPMT_MR_OM		0x0020	/* Output Mode			*/#define	CPMT_MR_CE_DIS		0x0000	/* Capture/Interrupt disabled	*/#define	CPMT_MR_CE_RISE		0x0040	/* Capt./Interr. on rising  TIN	*/#define CPMT_MR_CE_FALL		0x0080	/* Capt./Interr. on falling TIN	*/#define	CPMT_MR_CE_ANY		0x00C0	/* Capt./Interr. on any TIN edge*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -