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

📄 fiotest.c

📁 LPC214X例程全包括,代码大全
💻 C
字号:
/*****************************************************************************
 *   fiotest.c:  main C entry 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"

extern DWORD timer_counter;

/*****************************************************************************
**   Main Function  main()
******************************************************************************/
int main (void)
{	    		
    /********* The main Function is an endless loop ***********/	
    init_VIC();
    init_timer();

    /* Initialize GPIO pins, default is REGULAR_PORT  */
    GPIOInit( REGULAR_PORT );

    /* Initialize timer for GPIO toggling timing */
    enable_timer( 0 );
       
    while( 1 ) 
    {
	GPIOInit( FAST_PORT );
	while ( timer_counter < 0x100 )
	{ 
	    FIO1SET = 0x00FF0000;
	    FIO1CLR = 0x00FF0000;
	}

	GPIOInit( REGULAR_PORT );
	while ( timer_counter < 0x200 )
	{
	    IOSET1 = 0x00FF0000;
	    IOCLR1 = 0x00FF0000;
	}
	timer_counter = 0;
    }
    return 0;
}

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

⌨️ 快捷键说明

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