資源簡介
這是一個通過按鍵中斷控制LED燈的程序,key1~4分別控制led1~4.

代碼片段和文件信息
//===================================================================
//?File?Name?:?2440lib.c
//?Function??:?S3C2410?PLLUart?LED?Port?Init
//?Date??????:?March?20?2002
//?Version???:?0.0
//?History
//???0.0?:?Programming?start?(February?202002)?->?SOP
//===================================================================
#include?“def.h“
#include?“option.h“
#include?“2440addr.h“
#include?“2440lib.h“
#include?“2440slib.h“?
#include?
#include?
#include?
#include?
#include?
extern?char?Image$$RW$$Limit[];
void?*mallocPt=Image$$RW$$Limit;
//***************************[?SYSTEM?]***************************************************
void?Delay(int?time)
{
U32?val?=?(PCLK>>3)/1000-1;
rTCFG0?&=?~(0xff<<8);
rTCFG0?|=?3<<8; //prescaler?=?3+1
rTCFG1?&=?~(0xf<<12);
rTCFG1?|=?0<<12; //mux?=?1/2
rTCNTB3?=?val;
rTCMPB3?=?val>>1; //?50%
rTCON?&=?~(0xf<<16);
rTCON?|=?0xb<<16; //interval?inv-off?update?TCNTB3&TCMPB3?start?timer?3
rTCON?&=?~(2<<16); //clear?manual?update?bit
while(time--)?{
while(rTCNTO3>=val>>1);
while(rTCNTO3>1);
};
}
//***************************[?PORTS?]****************************************************
void?Port_Init0(void)
{
????//CAUTION:Follow?the?configuration?order?for?setting?the?ports.?
????//?1)?setting?value(GPnDAT)?
????//?2)?setting?control?register??(GPnCON)
????//?3)?configure?pull-up?resistor(GPnUP)??
????//32bit?data?bus?configuration??
????//***?PORT?A?GROUP
????//Ports??:?GPA22?GPA21??GPA20?GPA19?GPA18?GPA17?GPA16?GPA15?GPA14?GPA13?GPA12??
????//Signal?:?nFCE?nRSTOUT?nFRE???nFWE??ALE???CLE??nGCS5?nGCS4?nGCS3?nGCS2?nGCS1?
????//Binary?:??1?????1??????1???1???1???1????1?????1?????1?????1?????1
????//Ports??:?GPA11???GPA10??GPA9???GPA8???GPA7???GPA6???GPA5???GPA4???GPA3???GPA2???GPA1??GPA0
????//Signal?:?ADDR26?ADDR25?ADDR24?ADDR23?ADDR22?ADDR21?ADDR20?ADDR19?ADDR18?ADDR17?ADDR16?ADDR0?
????//Binary?:??1???????1??????1??????1????1???????1??????1??????1?????1???????1?????1??????1?????????
????rGPACON?=?0x7fffff;?
????//****?PORT?B?GROUP
????//Ports??:?GPB10????GPB9????GPB8????GPB7????GPB6?????GPB5????GPB4???GPB3???GPB2?????GPB1??????GPB0
????//Signal?:?nXDREQ0?nXDACK0?nXDREQ1?nXDACK1?nSS_KBD?nDIS_OFF?L3CLOCK?L3DATA?L3MODE?nIrDATXDEN?Keyboard
????//Setting:?INPUT??OUTPUT???INPUT??OUTPUT???INPUT???OUTPUT???OUTPUT?OUTPUT?OUTPUT???OUTPUT????OUTPUT?
????//Binary?:???00????01???????00?????01??????00?????01???????01?????01?????01?????01????????01??
????rGPBCON?=?0x044555;
????rGPBUP??=?0x7ff;?????//?The?pull?up?function?is?disabled?GPB[10:0]
????//***?PORT?C?GROUP?for?youlong
????//Ports??:?GPC15?GPC14?GPC13?GPC12?GPC11?GPC10?GPC9?GPC8??GPC7???GPC6???GPC5?GPC4?GPC3??GPC2??GPC1?GPC0
????//Signal?:?VD7???VD6???VD5???VD4???VD3???VD2???VD1??VD0?LCDVF2?LCDVF1?LCDVF0?VM?Vframe?VLINE?VCLK?LEND??
????//Binary?:??10???10???10????10???10????10???10???10???10?????10????1
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????40633??2005-07-08?01:34??Key_poll_example\inc\2440addr.h
?????文件???????4427??2008-09-13?18:53??Key_poll_example\inc\2440addr.inc
?????文件???????2325??2009-02-24?22:56??Key_poll_example\inc\2440lib.h
?????文件???????1831??2005-07-02?23:52??Key_poll_example\inc\2440slib.h
?????文件???????1256??2005-07-07?23:09??Key_poll_example\inc\def.h
?????文件????????919??2009-03-03?03:44??Key_poll_example\inc\IIC.h
?????文件????????311??2009-02-25?23:17??Key_poll_example\inc\MAIN.h
?????文件???????3111??2007-07-18?18:34??Key_poll_example\inc\Memcfg.inc
?????文件????????279??2002-03-27?17:48??Key_poll_example\inc\memtest.h
?????文件???????1201??2003-05-17?04:10??Key_poll_example\inc\mmu.h
?????文件???????3029??2009-01-10?07:07??Key_poll_example\inc\option.h
?????文件???????3728??2007-07-18?18:36??Key_poll_example\inc\Option.inc
?????文件????????439??2002-03-27?18:20??Key_poll_example\inc\profile.h
?????文件?????193673??2014-07-31?10:08??Key_poll_example\Key_poll_example.mcp
?????文件???????3395??2014-07-31?10:08??Key_poll_example\Key_poll_example_Data\CWSettingsWindows.stg
?????文件??????54494??2014-07-31?10:08??Key_poll_example\Key_poll_example_Data\Debug\TargetDataWindows.tdt
?????文件??????22996??2014-07-31?09:59??Key_poll_example\Key_poll_example_Data\DebugRel\Key_poll_example.axf
?????文件???????3359??2014-07-31?09:59??Key_poll_example\Key_poll_example_Data\DebugRel\list.txt
?????文件???????9572??2014-07-21?16:40??Key_poll_example\Key_poll_example_Data\DebugRel\ob
?????文件??????54464??2014-07-21?16:40??Key_poll_example\Key_poll_example_Data\DebugRel\ob
?????文件???????3638??2014-07-21?16:40??Key_poll_example\Key_poll_example_Data\DebugRel\ob
?????文件??????39092??2014-07-31?09:59??Key_poll_example\Key_poll_example_Data\DebugRel\ob
?????文件?????105678??2014-07-31?10:08??Key_poll_example\Key_poll_example_Data\DebugRel\TargetDataWindows.tdt
?????文件??????53120??2014-07-31?10:08??Key_poll_example\Key_poll_example_Data\Release\TargetDataWindows.tdt
?????文件?????????58??2014-08-06?10:44??Key_poll_example\Readme.txt
?????文件??????20266??2008-10-29?02:08??Key_poll_example\src\2440init.s
?????文件??????28029??2009-02-24?23:13??Key_poll_example\src\2440lib.c
?????文件???????7436??2005-07-25?17:24??Key_poll_example\src\2440slib.s
?????文件???????4622??2014-08-06?10:50??Key_poll_example\src\Main.c
?????文件???????4622??2014-08-06?10:49??Key_poll_example\src\Main.c.bak
............此處省略12個文件信息
評論
共有 條評論