system.c

来自「NEC 的无线通讯方案」· C语言 代码 · 共 65 行

C
65
字号
/*
* $Id: system.c,v 1.6 2007/10/23 07:52:04 sunny Exp $
*/
/*
*******************************************************************************
**
**  This device driver was created by Applilet for the 78K0/KB2, 78K0/KC2,
**  78K0/KD2, 78K0/KE2 and 78K0/KF2 8-Bit Single-Chip Microcontrollers.
**
**  Copyright(C) NEC Electronics Corporation 2002 - 2005
**  All rights reserved by NEC Electronics Corporation.
**
**  This program should be used on your own responsibility.
**  NEC Electronics Corporation assumes no responsibility for any losses
**  incurred by customers or third parties arising from the use of this file.
**
**  Filename :	system.c
**  Abstract :	This file implements device driver for System module.
**  APIlib :	NEC78K0KX2.lib V1.01 [09 Aug. 2005]
**
**  Device :	uPD78F0537
**
**  Compiler :	NEC/CC78K0
**
*******************************************************************************
*/
/*
*******************************************************************************
**  Include files
*******************************************************************************
*/
#include "unet.h"
#include "system.h"
/*
*******************************************************************************
**  MacroDefine
*******************************************************************************
*/

/*
**-----------------------------------------------------------------------------
**
**  Abstract:
**	Init the Clock Generator and Oscillation stabilization time.
**
**  Parameters:
**	None
**
**  Returns:
**	None
**
**-----------------------------------------------------------------------------
*/
void Clock_Init( void )
{
	ClrIORBit(MCM, 0x05);			/* High-Ring-OSC operate for CPU */

	SetIORBit(MCM, 0x01);			/* peripheral hardware clock:frh */
	SetIORBit(PM12, 0x18);			/* P123/124 input mode */
	ClrIORBit(OSCCTL, 0x20);		/* XT1 input mode */
	SetIORBit(OSCCTL, 0x10);
	SetIORBit(MOC, 0x80);			/* stop X1 clock */
	PCC = CG_CPU_CLOCKSEL;
}

⌨️ 快捷键说明

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