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

📄 port.c

📁 NEC 的无线通讯方案
💻 C
字号:
/*
* $Id: port.c,v 1.7 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 :	port.c
**  Abstract :	This file implements device driver for PORT module.
**  APIlib :	NEC78K0KX2.lib V1.01 [09 Aug. 2005]
**
**  Device :	uPD78F0537, uPD78F0514
**
**  Compiler :	NEC/CC78K0
**
*******************************************************************************
*/
/*
*******************************************************************************
**  Include files
*******************************************************************************
*/
#include "unet.h"
#include "port.h"
/*
*******************************************************************************
**  Constants
*******************************************************************************
*/

/*
**-----------------------------------------------------------------------------
**
**  Abstract:
**  	This function initializes the I/O module.
**
**  Parameters:
**  	None
**
**  Returns:
**  	None
**
**-----------------------------------------------------------------------------
*/
void PORT_Init( void )
{
	/* initialize the port registers */
	P0 = PORT_P0;
	P1 = PORT_P1;
	P2 = PORT_P2;
	P3 = PORT_P3;
	P4 = PORT_P4;
#ifdef PORT_P5
	P5 = PORT_P5;
#endif
	P6 = PORT_P6;
	P7 = PORT_P7;
	P12 = PORT_P12;
	P13 = PORT_P13;
	P14 = PORT_P14;

	/* initialize the Pull-up resistor option registers */
	PU0 = PORT_PU0;
	PU1 = PORT_PU1;
	PU3 = PORT_PU3;
	PU4 = PORT_PU4;
#ifdef PORT_PU5
	PU5 = PORT_PU5;
#endif
	PU7 = PORT_PU7;
	PU12 = PORT_PU12;
	PU14 = PORT_PU14;

	/* initialize the mode registers */
	PM0 = PORT_PM0;
	PM1 = PORT_PM1;
	PM2 = PORT_PM2;
	ADPC = PORT_ADPC;
	PM3 = PORT_PM3;
	PM4 = PORT_PM4;
#ifdef PORT_PM5
	PM5 = PORT_PM5;
#endif
	PM6 = PORT_PM6;
	PM7 = PORT_PM7;
	PM12 = PORT_PM12;
	PM14 = PORT_PM14;
}

⌨️ 快捷键说明

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