📄 22eb06_lib_iolamp.c
字号:
/*
***********************************************************************
Embest Info&Tech Co., Ltd. All rights reserved.
www.embedinfo.com
***********************************************************************
---------------- file information -------------------------------------
file name: 22eb06_lib_iolamp.c
version : v0
author : peter pan / panqan@hotmail.com
begin : 2006-02-10
finish : 2006-02-10
define : lpc22eb06 iolamp controll functions
notes :
---------------- modify information -----------------------------------
version :
modify :
begin :
finish :
define :
-----------------------------------------------------------------------
*/
// (--------------------- compiler condition --------------------------
/*
#ifdef xxx
#define xxx
#endif
*/
// --------------------- compiler condition --------------------------)
/*-------------------------------------------------------------------*/
/* include files */
/*---------------------------------------------------------------- --*/
#include "22eb06_lib_iolamp.h"
/*-------------------------------------------------------------------*/
/* local function declare */
/*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*/
/* 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 : Init_lamp(void)
* func : init the port
* para :
* ret : xxxx
* glob : xxxx
* inc :
* author:
* date :
* modify:
* comment:
**********************************************************************/
void Init_lamp()
{
INT32U i;
INT32U j;
//connect to GPIO function
i = PINSEL2;
i |= (0x01<<4);
PINSEL2 = i;
//set the GPIO direction
i = IODIR2;
i |= (0x03<<23);
IODIR2 = i;
// IOSET2 = 0xffffffff;
}
/**********************************************************************
* name : IO_lamp(INT32U IO_lamp1_onoff, INT32U IO_lamp2_onoff)
* func : on off the IO_lamp
used the hardware p2.23/p2.24
* para : IO_lamp controllor
0: off the lamp
1: on the lamp
* ret : xxxx
* glob : xxxx
* inc :
* author:
* date :
* modify:
* comment:
**********************************************************************/
void IO_lamp(INT32U IO_lamp1_onoff, INT32U IO_lamp2_onoff)
{
INT32U i;
INT32U j;
//on off the lamp1
if (IO_lamp1_onoff == 0)
{ //off the lamp
i = IOSET2;
i |= (0x01<<23);
IOSET2 = i;
}
else
{
i = IOCLR2;
i |= (0x01<<23);
IOCLR2 = i;
}
//on off the lamp2
if (IO_lamp2_onoff == 0)
{ //off the lamp
i = IOSET2;
i |= (0x01<<24);
IOSET2 = i;
}
else
{
i = IOCLR2;
i |= (0x01<<24);
IOCLR2 = i;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -