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

📄 fio.c

📁 lpc2148-keil环境下的各个功能模块的例程
💻 C
字号:
/*****************************************************************************
 *   fio.c:  Fast I/O module file for Philips LPC214x Family Microprocessors
 *
 *   Copyright(C) 2006, Philips Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2005.10.01  ver 1.00    Prelimnary version, first Release
 *
******************************************************************************/
#include "LPC214x.H"                        /* LPC21xx definitions */
#include "type.h"
#include "irq.h"
#include "timer.h"
#include "fio.h"

/*****************************************************************************
** Function name:		GPIOInit
**
** Descriptions:		initialize GPIO port
**
** parameters:			port type, Fast I/O or regular GPIO
** Returned value:		None
** 
*****************************************************************************/
void GPIOInit( DWORD PortType )
{
    if ( PortType == FAST_PORT )
    {
	SCS |= (GPIO0M | GPIO1M);	/* set GPIOx to use Fast I/O */
	FIO1DIR = 0x00FF0000;
	FIO1CLR	= 0x00FF0000;
    }
    else
    {
	SCS = 0;			/* set GPIOx to use regular I/O */
	IODIR1 = 0x00FF0000;		/* P1.16..23 defined as Outputs */
	IOCLR1 = 0x00FF0000;		/* turn off LEDs */
    }
    return;
}

/*********************************************************************************
**                            End Of File
*********************************************************************************/

⌨️ 快捷键说明

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