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.

[参考译文] RTOS/CC2640:CC2640计时器计算高电平持续时间

Guru**** 2583445 points


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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/595433/rtos-cc2640-the-cc2640-timer-calculates-the-high-level-duration

器件型号:CC2640

工具/软件:TI-RTOS

 这是我的代码

//初始化
Power_setDependency (Periph_GPT1);

TimerConfigure (GPT1_base、TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_CAP_TIME_UP);

TimerPrescaleSet (GPT1_base、TIMER_Both、 0);

//启动计时
器 void CSB_start ()
{
Power_setConstraint (Power_SB_disallow);
TimerEnable (GPT1_base、timer_A);

}
//停止计时
器 void CSB_stop ()
{
count_yth=TimerValueGet (GPT1_base、timer_A);
Power_learen_test



(在此);GPB_disable_program (Timer_start

);}(GPB_is_disable_t1);(GPB_disable_ise_t1)(在此)(Timer_disable_disable_task_start);(GPB_is_is_is_is_is_disable)()(GPB_


但计时器的计数值始终为0

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

    您可以使用我们的 GPTimer 驱动程序来实现所需的功能。

    您可以将触发器设置为 GPTimerCC26XX_both _edges、然后您将获得两个边沿的时间戳。
    之后、您只需处理从回调获取的值、即可获得高级别持续时间的时间。

    有关 GPTimer 的更多信息、请查看我们的技术参考手册第13节。

    有关 GPTimer 使用示例、请查看 TI-RTOS 文档、该文档可在下载 TI BLE 堆栈的位置找到。
    例如:
    C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/docs/Documentation_Overview_cc13xx_cc26xx.html