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.

LAUNCHXL-CC1310: CC1310 定时器参考代码

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310

想使用下CC1310的定时器实现1ms的定时功能,有没有相关的例程?

  • https://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_4_20_02_07/docs/tidrivers/doxygen/html/index.html

    您好,这里为您提供了定时器相关api函数说明,另外我这边为您提供了demo

    您这边可以参考sdk目录下 ti drivers 里面的pwm工程参考定时器

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2015-2019, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 没有看到定时器的相关操作!

  • 您好,目前没有定时器的例程

    https://dev.ti.com/tirex/explore/content/simplelink_cc13x0_sdk_4_20_01_03/docs/tidrivers/doxygen/html/_g_p_timer_c_c26_x_x_8h.html

    您可以参考以上api函数文档以及以下代码

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #include <unistd.h>
    #include <stdint.h>
    #include <stddef.h>
    /* Driver Header files */
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26XX.h>
    #include <ti/drivers/timer/GPTimerCC26XX.h>
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #include <xdc/runtime/Types.h>
    /* Board Header file */
    #include "Board.h"
    GPTimerCC26XX_Handle hTimer0A;
    void timerCallback0A(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    您可以测试一下以上内容,它每 348 毫秒发出一次中断:

  • 有问题随时论坛交流,希望可以帮助到您。

x 出现错误。请重试或与管理员联系。