silabs 外部中断

EM357外部中断:

EM357有四种外部中端,分别为ABCD中断类型。

EM357按键中断例子

  1. 调用库函数方法实现

在dev0680.h

 

IRQA类中断

 

 //BUTTON1  

//#define BUTTON1             PORTB_PIN(0)

/**

 * @brief The GPIO input register for BUTTON0.

 */

//#define BUTTON1_IN          GPIO_PAIN

/**

 * @brief Point the proper IRQ at the desired pin for BUTTON0.

 * @note IRQB is fixed and as such does not need any selection operation.

 */

//#define BUTTON1_SEL()       do { } while(0)

/**

 * @brief The interrupt service routine for BUTTON0.

 */

//#define BUTTON1_ISR         halIrqAIsr

/**

 * @brief The interrupt configuration register for BUTTON0.

 */

//#define BUTTON1_INTCFG      GPIO_INTCFGA

/**

 * @brief The interrupt enable bit for BUTTON0.

 */

//#define BUTTON1_INT_EN_BIT  INT_IRQA

/**

 * @brief The interrupt flag bit for BUTTON0.

 */

//#define BUTTON1_FLAG_BIT    INT_IRQAFLAG

/**

 * @brief The missed interrupt bit for BUTTON0.

 */

//#define BUTTON1_MISS_BIT    INT_MISSIRQA

 

 

IRQB类中断

//BUTTON1  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值