基于LPC1114的学习型红外遥控器
***************************/
void GPIOIntEnable( uint32_t portNum, uint32_t bitPosi )
{
switch ( portNum )
{
case PORT0:
LPC_GPIO0->IE |= (0x1< break;
case PORT1:
LPC_GPIO1->IE |= (0x1< break;
case PORT2:
LPC_GPIO2->IE |= (0x1< break;
case PORT3:
LPC_GPIO3->IE |= (0x1< break;
default:
break;
}
return;
}
/*****************************************************************************
** Function name: GPIOIntDisable
**
** Descriptions: Disable Interrupt Mask for a port pin.
**
** parameters: port num, bit position
** Returned value: None
**
*****************************************************************************/
void GPIOIntDisable( uint32_t portNum, uint32_t bitPosi )
{
switch ( portNum )
{
case PORT0:
LPC_GPIO0->IE &= ~(0x1< break;
case PORT1:
LPC_GPIO1->IE &= ~(0x1< break;
case PORT2:
LPC_GPIO2->IE &= ~(0x1< break;
case PORT3:
LPC_GPIO3->IE &= ~(0x1< break;
default:
break;
}
return;
}
/*****************************************************************************
** Function name: GPIOIntStatus
**
** Descriptions: Get Interrupt status for a port pin.
**
** parameters: port num, bit position
** Returned value: None
**
*****************************************************************************/
uint32_t GPIOIntStatus( uint32_t portNum, uint32_t bitPosi )
{
uint32_t regVal = 0;
switch ( portNum )
{
case PORT0:
if ( LPC_GPIO0->MIS & (0x1< regVal = 1;
break;
case PORT1:
if ( LPC_GPIO1->MIS & (0x1< regVal = 1;
break;
case PORT2:
if ( LPC_GPIO2->MIS & (0x1< regVal = 1;
break;
case PORT3:
if ( LPC_GPIO3->MIS & (0x1< regVal = 1;
break;
default:
break;
}
return ( regVal );
}
/*****************************************************************************
** Function name: GPIOIntClear
**
** Descriptions: Clear Interrupt for a port pin.
**
** parameters: port num, bit position
** Returned value: None
**
*****************************************************************************/
void GPIOIntClear( uint32_t portNum, uint32_t bitPosi )
{
switch ( portNum )
{
case PORT0:
LPC_GPIO0->IC |= (0x1< break;
case PORT1:
LPC_GPIO1->IC |= (0x1< break;
case PORT2:
LPC_GPIO2->IC |= (0x1< break;
case PORT3:
LPC_GPIO3->IC |= (0x1< break;
default:
break;
}
return;
}
/******************************************************************************
** End Of File
******************************************************************************/
/*****************************************************************************
** 函数名: GPIOSetDir
** 功能: 设置GPIO口方向
** 参数: 端口号(PORT0-PORT3), 第几位(0-31), 方向 (1 输出, 0 输入)
** 返回值: 无
*****************************************************************************/
/*****************************************************************************
** 函数名: GPIOSetValue
** 功能: 设置端口的值
** 参数: 端口号(PORT0-PORT3), 第几位(0-31), 方向 (1 输出, 0 输入)
** 返回值: 无
*****************************************************************************/
/*****************************************************************************
** 函数名: GPIOSetInterrupt
** 功能: 设置中断
** 参数: 端口号(PORT0-PORT3),
第几位(0-31),
触发方式(边缘触发还是电平触发 0边缘,1电平),
单/双电平触发,(0单电平,1,双电平),
根据触发方式选类型(0上升沿或高电平,1下降沿或低电平)
** 返回值: 无
*****************************************************************************/
/*****************************************************************************
** 函数名: GPIOIntEnable
** 功能: 允许I/O引脚中断
** 参数: 端口号
- NXP_LPC1114_LED灯程序(11-29)
- LPC1114_外部中断程序_MDK编译环境(11-29)
- LPC1114_Timer16_0中断程序_MDK编译环境(11-29)
- LPC1114_时钟系统解析(11-29)
- NXP_LPC1114延时函数集合(11-29)
- LPC1114/LPC11U14和LPC1343对比学习(一)整体对比(11-27)