📄 sram_test.c
字号:
/*
***********************************************************************
Embest Info&Tech Co., Ltd. All rights reserved.
www.embedinfo.com
***********************************************************************
---------------- file information -------------------------------------
file name: lpc22eb06_test.c
version : v0
author : peter pan / panqan@hotmail.com
begin : 2006-02-10
finish : 2006-02-10
define : lpc22eb06 test file
notes :
---------------- modify information -----------------------------------
version :
modify :
begin :
finish :
define :
-----------------------------------------------------------------------
*/
// (--------------------- compiler condition --------------------------
/*
#ifdef xxx
#define xxx
#endif
*/
// --------------------- compiler condition --------------------------)
/*-------------------------------------------------------------------*/
/* include files */
/*---------------------------------------------------------------- --*/
#include "..\..\com\type_redefine.h"
#include "..\..\com\lpc22xx_register.h"
#include "..\..\com\22eb06_lib_iolamp\22eb06_lib_iolamp.h"
/*-------------------------------------------------------------------*/
/* local function declare */
/*-------------------------------------------------------------------*/
/*
void xxx(xxx xxx, xxx xxx);
*/
/*-------------------------------------------------------------------*/
/* variable define */
/*-------------------------------------------------------------------*/
/*
INT32U XXXXXX;
*/
/*-------------------------------------------------------------------*/
/* extern function declare */
/*-------------------------------------------------------------------*/
/*--- define in XXX.c ---
extern void XXX();
*/
/*-------------------------------------------------------------------*/
/* extern variable declare */
/*-------------------------------------------------------------------*/
/*--- USED in XXX() ---
XXX SSS; // used inXXX()
*/
/*-------------------------------------------------------------------*/
/* function code */
/*-------------------------------------------------------------------*/
/**********************************************************************
* name : xxxxx
* func : xxxxx
* para : xxxx
* ret : xxxx
* glob : xxxx
* inc :
* author:
* date :
* modify:
* comment:
**********************************************************************/
/*void xxx(xxx xxx)
{
}
*/
/**********************************************************************
* name : Main
* func : main fun
* para : none
* ret : none
* glob : xxxx
* inc :
* author:
* date :
* modify:
* comment:
**********************************************************************/
void Main(void)
{
INT16U *pt;
INT8U i;
INT32U hpt=0xfffff;
INT16U data=0;
Init_lamp();
IO_lamp(0,0);
/************check address pin***************/
for(i=18;i>0;i--)
{
pt=(INT16U *)(0x81000000+(--hpt));
data=((0xff-i)<<8)+0xff-i;
*pt=data;
hpt=(hpt>>1);
}
for(i=18,hpt=0xfffff;i>0;i--)
{
pt=(INT16U *)(0x81000000+(--hpt));
data=*pt;
if(data!=((0xff-i)<<8)+0xff-i)
break;
hpt=(hpt>>1);
}
if(i!=0)
{
IO_lamp(1,0);
while(1);
}
/*********check data pin *********************/
pt=(volatile INT16U *)(0x81011110);
*pt=0x5555;
data=*pt;
if(data!=0x5555)
{
IO_lamp(0,1);
while(1);
}
*pt=0xaaaa;
data=*pt;
if(data!=0xaaaa)
{
IO_lamp(0,1);
while(1);
}
*pt=0xffff;
data=*pt;
if(data!=0xffff)
{
IO_lamp(0,1);
while(1);
}
*pt=0x0000;
data=*pt;
if(data!=0x0000)
{
IO_lamp(0,1);
while(1);
}
IO_lamp(1,1);
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -