CC2640如何设置上升沿触发和下降沿触发??
Viki Shi:
请问你用什么模块?
user6477475:
回复 Viki Shi:
ADXL362 的中断处理,SPI通信。
user6477475:
回复 Viki Shi:
嗯嗯明白了,还有一个问题,我看咱的中断(灯示例)没有开启中断和清除中断的代码???
示例代码如下所示:
PIN_Config ADXL362PinTable[] = {ADXL362_INT| PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,PIN_TERMINATE
};
ADXL362PinHandle = PIN_open(&ADXL362PinState, ADXL362PinTable);需要额外加开启中断和清楚中断的代码吗?具体代码是什么呢?
Viki Shi:
回复 user6477475:
/** @brief Control interrupt enable and edge for pin**@param handleHandle provided by previous call to PIN_open()*@param pinCfg#PIN_Config entry identifying pin ID and relevant pin*configuration as combinations of:*- #PIN_IRQ_DIS(default)*- #PIN_IRQ_POSEDGE*- #PIN_IRQ_NEGEDGE*- #PIN_IRQ_BOTHEDGES*@return #PIN_SUCCESS if successful, else error code*@note Any pending interrupts on pins that have not had interrupt enabled*will be cleared when enabling interrupts*@par Usage*@code*PIN_setInterrupt(hPins, PIN_ID(8)|PIN_IRQ_POSEDGE);*@endcode*/ extern PIN_Status PIN_setInterrupt(PIN_Handle handle, PIN_Config pinCfg);例程是直接在PIN_Config 里设置了
user6477475:
回复 Viki Shi:
那还需要调用PIN_setInterrupt吗?
Viki Shi:
回复 user6477475:
两种方式都可以,你自己选择