/** @brief Configure wakeup (from shutdown) on pins * * @param aPinCfg #PIN_Config list identifying pin ID and relevant pin *configuration as one of: *- #PINCC26XX_NO_WAKEUP(default) *- #PINCC26XX_WAKEUP_POSEDGE *- #PINCC26XX_WAKEUP_NEGEDGE * @return #PIN_SUCCESS if successful, else error code * @todoDefine properly * @par Usage *@code *PIN_setWakeup(NULL, PIN_ID(9)|PIN_WAKEUP_NEGEDGE); *Power_shutdown(0, 0); *@endcode */ extern PIN_Status PINCC26XX_setWakeup(const PIN_Config aPinCfg[]);
PINCC26XX_setWakeup的引脚配置表里能支持两个引脚吗,也就是两个引脚里任意一个引脚都可以唤醒?
Alvin Chen:
可以的。
Alvin Chen:
回复 Alvin Chen:
限制是必须是DIO即Digital IO
user4959119:
回复 Alvin Chen:
这个没毛病。如果我两个引脚A,B都设置为下降沿唤醒,当A引脚正在中断处理中,此时B也产生了中断,内核怎么处理B中断,会丢失吗?
Alvin Chen:
回复 user4959119:
不会丢失,会稍后处理,你可以看一下pinShutdown的demo
user4959119:
回复 Alvin Chen:
嗯,能给引脚设置中断优先级吗?
Alvin Chen:
回复 user4959119:
/** Array of callback function pointers* NOTE: The order of the pin configurations must coincide with what was*defined in CC26X2R1_LAUNCH.h* NOTE: Pins not used for interrupts can be omitted from callbacks array to*reduce memory usage (if placed at end of gpioPinConfigs array).*/ GPIO_CallbackFxn gpioCallbackFunctions[] = {NULL,/* Button 0 */NULL,/* Button 1 */NULL,/* CC26X2R1_LAUNCHXL_SPI_MASTER_READY */NULL,/* CC26X2R1_LAUNCHXL_SPI_SLAVE_READY */ };const GPIOCC26XX_Config GPIOCC26XX_config = {.pinConfigs= (GPIO_PinConfig *)gpioPinConfigs,.callbacks= (GPIO_CallbackFxn *)gpioCallbackFunctions,.numberOfPinConfigs = CC26X2R1_LAUNCHXL_GPIOCOUNT,.numberOfCallbacks= sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),.intPriority= (~0) };PINCC26XX_HWAttrs可以设置优先级。
user4959119:
回复 Alvin Chen:
嗯像咱们的驱动,UART_close,Clock_Close等等,是不是相应硬件驱动就不耗电了?
Alvin Chen:
回复 user4959119:
关闭之后把相应GPIO 设置一下就可以了。
user4959119:
回复 Alvin Chen:
GPIO设置一下是什么意思?比如我执行了UART_close(),我就认为串口模块不耗电了,对吗?
Alvin Chen:
回复 user4959119:
UART_close 你的UART单元不工作了,但是UART用的IO有可能也会漏电,比如时输出状态。