码迷,mamicode.com
首页 > 其他好文 > 详细

CC2541设置中断输入模式

时间:2017-08-06 14:01:25      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:cpu   设置   source   hal   中断   lin   ble   port   control   

//P0.0

/* SW_6 is at P0.1 */
#define HAL_KEY_SW_6_PORT P0
#define HAL_KEY_SW_6_BIT BV(0)
#define HAL_KEY_SW_6_SEL P0SEL
#define HAL_KEY_SW_6_DIR P0DIR

/* edge interrupt */
#define HAL_KEY_SW_6_EDGEBIT BV(0)
#define HAL_KEY_SW_6_EDGE HAL_KEY_RISING_EDGE//HAL_KEY_FALLING_EDGE

/* SW_6 interrupts */
#define HAL_KEY_SW_6_IEN IEN1 /* CPU interrupt mask register */
#define HAL_KEY_SW_6_IENBIT BV(5) /* Mask bit for all of Port_0 */
#define HAL_KEY_SW_6_ICTL P0IEN /* Port Interrupt Control register */
#define HAL_KEY_SW_6_ICTLBIT BV(0) /* P0IEN - P0.1 enable/disable bit */
#define HAL_KEY_SW_6_PXIFG P0IFG /* Interrupt flag at source */

//P0.1

 

/* SW_6 is at P0.1 */
#define HAL_KEY_SW_6_PORT P0
#define HAL_KEY_SW_6_BIT BV(0)
#define HAL_KEY_SW_6_SEL P0SEL
#define HAL_KEY_SW_6_DIR P0DIR

 

/* edge interrupt */
#define HAL_KEY_SW_6_EDGEBIT BV(1)
#define HAL_KEY_SW_6_EDGE HAL_KEY_RISING_EDGE//HAL_KEY_FALLING_EDGE

 

/* SW_6 interrupts */
#define HAL_KEY_SW_6_IEN IEN1 /* CPU interrupt mask register */
#define HAL_KEY_SW_6_IENBIT BV(5) /* Mask bit for all of Port_0 */
#define HAL_KEY_SW_6_ICTL P0IEN /* Port Interrupt Control register */
#define HAL_KEY_SW_6_ICTLBIT BV(1) /* P0IEN - P0.1 enable/disable bit */
#define HAL_KEY_SW_6_PXIFG P0IFG /* Interrupt flag at source */

 

CC2541设置中断输入模式

标签:cpu   设置   source   hal   中断   lin   ble   port   control   

原文地址:http://www.cnblogs.com/zhaogaojian/p/7294313.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!