uint8_t SX1320INT=0,SX1320INTlock=0;
void Gpio_IRQHandler(uint8_t u8Param)
{
if(0 == u8Param)
{
if (TRUE == Gpio_GetIrqStatus(GpioPortA, GpioPin4))
{
SX1320INT=1;
SX1320INTlock=1;
Gpio_ClearIrq(GpioPortA, GpioPin4);
}
}
}
void GPIO_Init(void)
{
stc_gpio_config_t stcGpioCfg;
DDL_ZERO_STRUCT(stcGpioCfg);
Sysctrl_SetPeripheralGate(SysctrlPeripheralGpio,TRUE);//使能GPIO模块时钟
stcGpioCfg.enDir = GpioDirIn;///< 端口方向配置->输入
stcGpioCfg.enDrv = GpioDrvH;///< 端口驱动能力配置->高驱动能力
stcGpioCfg.enPuPd = GpioNoPuPd;///< 端口上下拉配置->无上下拉
stcGpioCfg.enOD = GpioOdDisable;///< 端口开漏输出配置->开漏输出关闭
stcGpioCfg.enCtrlMode = GpioAHB;///< 端口输入/输出值寄存器总线控制模式配置->AHB
Gpio_Init(GpioPortA, GpioPin4, &stcGpioCfg);
Gpio_ClearIrq(GpioPortA, GpioPin4);
Gpio_EnableIrq(GpioPortA, GpioPin4, GpioIrqFalling);///< 打开并配置PB04为下降沿中断
EnableNvic(PORTA_IRQn, IrqLevel0, TRUE);///< 使能端口PORTA系统中断
} |