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

📄 cpu_init.c.svn-base

📁 我们自己开发的一个OSEK操作系统!不知道可不可以?
💻 SVN-BASE
字号:
/*
 * File:		cpu_init.c
 *
 * Discription:		Contains initialisation functions to setup
 *    			the cpu properly
 *
 */

#include "mpc555_immap.h"#include "mpc555.h"

/*
 * Setup essential cpu registers to run
 */
void cpu_init_f ( volatile immap_t *immr)
{
	volatile memctl5xx_t *memctl = &immr->im_memctl;
	
	/* SYPCR - contains watchdog control. This will enable watchdog */
//	immr->im_siu_conf.sc_sypcr = CFG_SYPCR;

	/* SIUMCR - contains debug pin configuration */
//	immr->im_siu_conf.sc_siumcr = CFG_SIUMCR;

	/* Memory Controller */
/*	memctl->memc_br0 = ;
	memctl->memc_or0 = ;
*/
/*#if (defined(CFG_OR1_PRELIM) && defined(CFG_BR1_PRELIM))
	memctl->memc_or1 = CFG_OR1_PRELIM;
	memctl->memc_br1 = CFG_BR1_PRELIM;
#endif

#if defined(CFG_OR2_PRELIM) && defined(CFG_BR2_PRELIM)
	memctl->memc_or2 = CFG_OR2_PRELIM;
	memctl->memc_br2 = CFG_BR2_PRELIM;
#endif

#if defined(CFG_OR3_PRELIM) && defined(CFG_BR3_PRELIM)
	memctl->memc_or3 = CFG_OR3_PRELIM;
	memctl->memc_br3 = CFG_BR3_PRELIM;
#endif*/

	/*dual mapping base register, maybe we don't need it*/
/*	memctl->memc_dmbr = ;*/
	
	/*dual mapping option register*/
/*	memctl->memc_dmor = ;*/

	/*UIMB module configuration register*/
	/* Full IMB bus speed */
//	immr->im_uimb.uimb_umcr = CFG_UMCR;

	/*External master control register*/
/*	immr->im_siu_conf.sc_emcr = ;*/

	/*system clock control register*/
/*	immr->im_clkrstk.cark_sccrk = KAPWR_KEY;*/
	immr->im_clkrst.car_sccr = 0;

	/* Initialize timebase. Unlock TBSCRK */
//	immr->im_sitk.sitk_tbscrk = KAPWR_KEY; 
	immr->im_sit.sit_tbscr = 0;

	/* Initialize the PIT. Unlock PISCRK */
//	immr->im_sitk.sitk_piscrk = KAPWR_KEY;
/*	immr->im_sit.sit_piscr = ;*/

	/* PLL (CPU clock) settings */
//	immr->im_clkrstk.cark_plprcrk = KAPWR_KEY;
	immr->im_clkrst.car_plprcr = 0;
}

/*
 * Initialize higher level parts of cpu
 */
int cpu_init_r (void)
{
  	/* Nothing to do at the moment */
	return (0);
}

⌨️ 快捷键说明

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