system.c

来自「在ARM平台上开发的LCD驱动程序,具有很强的通用性.」· C语言 代码 · 共 57 行

C
57 行
字号
/*************************************************************************************
*	Copyright (c) 2005 by National ASIC System Engineering Research Center.
*	PROPRIETARY RIGHTS of ASIC are involved in the subject matter of this 
*	material.  All manufacturing, reproduction, use, and sales rights 
*	pertaining to this subject matter are governed by the license agreement.
*	The recipient of this software implicitly accepts the terms of the license.
*
*	File Name: system.c
*
*	Function Description:
*		void	pmc_init(void)
*								The function initialize PMC unit and open all modules
*							for chip debug.
*
*		void	system_init(void)			
*								It calls two function to accomplish PMC unit initialization
*							and interrupt controller initialization.
*
*	Created by Michael <yuyu_zh@seu.edu.cn>, 2005-03-23
**************************************************************************************/

#include "garfield.h"

void pmc_init(U32 sysclk, U32 module)
{
	U32 i;
	U32	n,m;

	*(RP)(PMU_PCSR) |= module;		// 打开所需要的模块
	
	*(RP)(PMU_PMDR)	= 0x01;			// 设置Garfield为Normal工作状态
	*(RP)(PMU_PLTR) = 0x00d200cd;	// PLL稳定时间设置  MLTV=210,ULTV=205
	
	for(i=0;i<100;i++);
		
	n = 2;
	m = 8*sysclk/10000000;
	*(RP)(PMU_PMCR) = (n << 8) | m;
	*(RP)(PMU_PMCR) = (1 << 12) | (n << 8) | m; 	// 工作频率设定
		
	*(RP)(PMU_PUCR)=0x1530;			//parameter PD=5,D=48

	return ;
}

void system_init(void)
{
	/* PLL initialized */
	pmc_init(10000000, 0xffff);

	/* Interrupt initialize */
	INT_INIT();

	return ;
}

/* end of system.c */

⌨️ 快捷键说明

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