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

📄 system.c

📁 USART的驱动程序
💻 C
字号:
/*************************************************************************************
*	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;	//open all module
	
	*(RP)(PMU_PMDR)	= 0X01;
	*(RP)(PMU_PLTR) = 0x00d200cd;	//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(70000000, 0xffff);

	/* Interrupt initialize */
	INT_INIT();

	return ;
}

/* end of system.c */

⌨️ 快捷键说明

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