This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC1354P10:复位单触发计时器

Guru**** 2386620 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1530779/cc1354p10-reset-oneshot-timer

部件号:CC1354P10

工具/软件:

您好:

我想使用单触发计时器检测持续至少 5s 的低电平状态。 我使用 GPIO 中断来控制计时器启动/停止。 GPIO 中断效果很好、但我必须在停止计时器时将其复位。 我找不到任何函数可以执行此操作。 请告诉我如何重置计时器值。

计时器初始化:

    Timer_Params t;
    Timer_Params_init(&t);
    t.periodUnits = Timer_PERIOD_US;
    t.period = 5 * 1000 * 1000;
    t.timerMode = Timer_ONESHOT_CALLBACK;
    t.timerCallback = timerInt;

GPIO 内部:

extern "C" void pinIrQ(uint_least8_t index) {
    uint8_t status = GPIO_read(index);
    if(status == 0){
        Timer_start(tim);
    }else{
        Timer_stop(tim);
        //timer reset!
    }
}