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

📄 mpc555.h.svn-base

📁 我们自己开发的一个OSEK操作系统!不知道可不可以?
💻 SVN-BASE
字号:
/*
 * File:		mpc555.h
 *
 * Discription:		mpc5xx specific definitions
 *
 */

#ifndef __MPC555_H__
#define __MPC555_H__

/*-----------------------------------------------------------------------
 * Exception offsets (PowerPC standard)
 */
#define EXC_OFF_SYS_RESET   	0x0100		/* System reset				*/

/*-----------------------------------------------------------------------
 * IMMR(internal memory map register) 
 */
#define IMMR_ISB			0x00000000
#define IMMR_FLEN        0x00000800  //启动是从外部FLASH还是从片上FLASH开始
#define CFG_IMMR_SET		(IMMR_ISB | IMMR_FLEN)

/*-----------------------------------------------------------------------
* MSR (machine status register)
*/
#define MSR_EE			0x00000000		//是否允许外部中断
#define MSR_FP			0x00000000			 //是否使用浮点功能
#define MSR_ME			0x00000000		 //是否允许机器检测异常
#define MSR_RI			0x00000000			//机器状态是否可恢复
#define MSR_LE			0x00000000			//采用小顶端还是大顶端模式
#define CFG_MSR	(MSR_EE | MSR_FP | MSR_ME | MSR_RI | MSR_LE)

/*-----------------------------------------------------------------------
* BBCMCR(bbc module configuration register)
*/
#define BBCMCR_OERC 	0x00000000		//other exceptions relocation control
#define BBCMCR_ETRE		0x00000000		//exception table relocation enable
#define CFG_BBCMCR	(BBCMCR_OERC | BBCMCR_ETRE)

/*-----------------------------------------------------------------------
 * SYPCR - System Protection Control Register
 */
#define SYPCR_SWTC	0xffff0000	/* Software Watchdog Timer Count	*/
#define SYPCR_BMT	0x0000ff00	/* Bus Monitor Timing			*/
#define SYPCR_BME	0x00000080	/* Bus Monitor Enable			*/
#define SYPCR_SWF	0x00000008	/* Software Watchdog Freeze		*/
#define SYPCR_SWE	0x00000004	/* Software Watchdog Enable		*/
#define SYPCR_SWRI		0x00000002	/* Software Watchdog Reset/Int Select	*/
#define SYPCR_SWP	0x00000001	/* Software Watchdog Prescale		*/
#define CFG_SYPCR 	(SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
			     					 

/*-----------------------------------------------------------------------
 * SIUMCR - SIU Module Configuration Register
 */
#define SIUMCR_EARB		0x80000000	/* External Arbitration			*/
#define SIUMCR_EARP0		0x00000000	/* External Arbi. Request priority 0	*/
#define SIUMCR_EARP1		0x10000000	/* External Arbi. Request priority 1	*/
#define SIUMCR_EARP2		0x20000000	/* External Arbi. Request priority 2	*/
#define SIUMCR_EARP3		0x30000000	/* External Arbi. Request priority 3	*/
#define SIUMCR_EARP4		0x40000000	/* External Arbi. Request priority 4	*/
#define SIUMCR_EARP5		0x50000000	/* External Arbi. Request priority 5	*/
#define SIUMCR_EARP6		0x60000000	/* External Arbi. Request priority 6	*/
#define SIUMCR_EARP7		0x70000000	/* External Arbi. Request priority 7	*/
#define SIUMCR_DSHW		0x00800000	/* Data Showcycles			*/
#define SIUMCR_DBGC00	0x00000000	/* Debug pins configuration		*/
#define SIUMCR_DBGC01	0x00200000	/* - " -				*/
#define SIUMCR_DBGC10	0x00400000	/* - " -				*/
#define SIUMCR_DBGC11	0x00600000	/* - " -				*/
#define SIUMCR_DBPC00	0x00000000	/* Debug Port pins Config.		*/
#define SIUMCR_DBPC01	0x00080000	/* - " -				*/
#define SIUMCR_DBPC10	0x00100000	/* - " -				*/
#define SIUMCR_DBPC11	0x00180000	/* - " -				*/
#define SIUMCR_GPC00		0x00000000	/* General Pins Config 			*/
#define SIUMCR_GPC01		0x00020000	/* General Pins Config 			*/
#define SIUMCR_GPC10		0x00040000	/* General Pins Config 			*/
#define SIUMCR_GPC11		0x00060000	/* General Pins Config 			*/
#define SIUMCR_DLK		0x00010000	/* Debug Register Lock			*/
#define SIUMCR_SC00	0x00000000	/* Multi Chip 32 bit			*/
#define SIUMCR_SC01	0x00004000	/* Muilt Chip 16 bit			*/
#define SIUMCR_SC10	0x00004000	/* Single adress show			*/
#define SIUMCR_SC11	0x00006000	/* Single adress			*/
#define SIUMCR_RCTX	0x00001000	/* Data Parity pins Config.		*/
#define SIUMCR_MLRC00	0x00000000	/* Multi Level Reserva. Ctrl		*/
#define SIUMCR_MLRC01	0x00000400	/* - " -				*/
#define SIUMCR_MLRC10	0x00000800	/* - " -				*/
#define SIUMCR_MLRC11	0x00000c00	/* - " -				*/
#define SIUMCR_MTSC	0x00000100	/* Memory transfer      		*/
#define CFG_SIUMCR 	(SIUMCR_SC11)

/*-----------------------------------------------------------------------
 * TBSCR - Time Base Status and Control Register
 */
#define TBSCR_REFA	((ushort)0x0080)	/* Reference Interrupt Status A	*/
#define TBSCR_REFB	((ushort)0x0040)	/* Reference Interrupt Status B */
#define TBSCR_TBF	((ushort)0x0002)	/* Time Base stops while FREEZE */
#define TBSCR_TBE		((ushort)0x0001)	/*Time Base enables*/
#define CFG_TBSCR 	()

/*-----------------------------------------------------------------------
 * PISCR - Periodic Interrupt Status and Control Register
 */
#define PISCR_PITF	((ushort)0x0002)	/* PIT stops when FREEZE	*/
#define PISCR_PS	0x0080			/* Periodic Interrupt Status	*/
#define CFG_PISCR 	()

/*-----------------------------------------------------------------------
 * PLPRCR - PLL, Low-Power, and Reset Control Register
 */
#define PLPRCR_MF_MSK	0xfff00000	/* MF mask				*/
#define PLPRCR_DIVF_MSK	0x0000001f	/* DIVF mask				*/
#define PLPRCR_CSRC_MSK 0x00000400	/* CSRC mask				*/
#define PLPRCR_MF_SHIFT 0x00000014	/* Multiplication factor shift value	*/
#define PLPRCR_DIVF_0   0x00000000	/* Division factor 0			*/
#define PLPRCR_MF_9     0x00900000	/* Mulitipliaction factor 9		*/
#define PLPRCR_TEXPS	0x00004000	/* TEXP Status				*/
#define PLPRCR_TMIST	0x00001000	/* Timers Interrupt Status		*/
#define PLPRCR_CSR	0x00000080	/* CheskStop Reset value		*/
#define PLPRCR_SPLSS	0x00008000	/* SPLL Lock Status Sticky bit		*/
#define CFG_PLPRCR	()

/*-----------------------------------------------------------------------
 * SCCR - System Clock and reset Control Register
 */
#define SCCR_DFNL_MSK	0x00000070	/* DFNL mask				*/
#define SCCR_DFNH_MSK	0x00000007  	/* DFNH mask				*/
#define SCCR_DFNL_SHIFT 0x0000004	/* DFNL shift value			*/
#define SCCR_RTSEL	0x00100000	/* RTC circuit input source select	*/
#define SCCR_EBDF00	0x00000000	/* Division factor 1. CLKOUT is GCLK2   */
#define SCCR_EBDF11	0x00060000	/* reserved				*/
#define SCCR_TBS	0x02000000	/* Time Base Source			*/
#define SCCR_RTDIV	0x01000000	/* RTC Clock Divide 			*/
#define SCCR_COM00	0x00000000	/* full strength CLKOUT output buffer	*/
#define SCCR_COM01	0x20000000	/* half strength CLKOUT output buffer	*/
#define SCCR_DFNL000	0x00000000	/* Division by 2 (default = minimum)	*/
#define SCCR_DFNH000	0x00000000	/* Division by 1 (default = minimum)	*/
#define SCCR	(0x00000000)

/*-----------------------------------------------------------------------
 * MC - Memory Controller
 */
#define BR_V		0x00000001	/* Bank valid 				*/
#define BR_BI		0x00000002	/* Burst inhibit 			*/
#define BR_PS_8		0x00000400	/* 8 bit port size 			*/
#define BR_PS_16	0x00000800	/* 16 bit port size 			*/
#define BR_PS_32	0x00000000	/* 32 bit port size 			*/
#define BR_LBDIR	0x00000008	/* Late burst data in progess		*/
#define BR_SETA		0x00000004	/* External Data Acknowledge		*/
#define OR_SCY_3	0x00000030	/* 3 clock cycles wait states		*/
#define OR_SCY_1	0x00000000	/* 1 clock cycle wait state		*/
#define OR_SCY_8	0x00000080	/* 8 clock cycles wait states		*/
#define OR_TRLX		0x00000001	/* Timing relaxed			*/
#define OR_BSCY		0x00000060	/* Burst beats length in clocks		*/
#define OR_ACS_10	0x00000600	/* Adress to chip-select setup		*/
#define OR_CSNT		0x00000800	/* Chip-select negotation time		*/
#define OR_ETHR		0x00000100	/* Extended hold time on read		*/
#define OR_ADDR_MK_FF	0xFF000000
#define OR_ADDR_MK_FFFF	0xFFFF0000

/*-----------------------------------------------------------------------
 * UMCR - UIMB Module Configuration Register
 */
#define UMCR_FSPEED 	0x00000000	/* Full speed. Opposit of UMCR_HSPEED	*/
#define UMCR_HSPEED 	0x10000000	/* Half speed				*/
#define CFG_UMCR 	(UMCR_FSPEED)

/*-----------------------------------------------------------------------
 * DER - Timer Decrementer
 *-----------------------------------------------------------------------
 * Initialise to zero
 */
#define CFG_DER			0x00000000


/* The key to unlock registers maintained by keep-alive power.
*/
#define KAPWR_KEY	0x55ccaa33

#endif

⌨️ 快捷键说明

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