CC2541外部中断唤醒
如何设置CC2541进入深度睡眠后,外部中断下降沿或者上升沿唤醒?
参考键盘或者keyfob的例子,
C:\Texas Instruments\BLE-CC254x-1.4.1.43908b\Projects\ble\KeyFob
C:\Texas Instruments\BLE-CC254x-1.4.1.43908b\Projects\ble\HIDEmuKbd
如:keyfob用P0.0,P0.1作为按键,则初始化如下,可参考HalKeyInit()函数
HAL_KEY_SW_1_SEL &= ~(HAL_KEY_SW_1_BIT); /* Set pin function to GPIO */
HAL_KEY_SW_1_DIR &= ~(HAL_KEY_SW_1_BIT); /* Set pin direction to Input */
HAL_KEY_SW_2_SEL &= ~(HAL_KEY_SW_2_BIT); /* Set pin function to GPIO */
HAL_KEY_SW_2_DIR &= ~(HAL_KEY_SW_2_BIT); /* Set pin direction to Input */
/* Rising/Falling edge configuratinn */
PICTL |= HAL_KEY_SW_1_EDGEBIT; /* Set the edge bit to set falling edge to give int */
HAL_KEY_SW_1_IEN |= ( HAL_KEY_SW_1_IENBIT | HAL_KEY_SW_2_IENBIT ); /* enable CPU interrupt */
PM3唤醒: