CC26xx/CC13x0的SCS应用

Sensor Controller Studio 是一款 Windows 应用程序,用于开发和调试基于 CC26xx/CC13xx 传感器控制器的任务。此程序将帮助开发人员快速创建可独立于系统 CPU 运行的应用,并自主执行简单的后台任务。

下面以CC2640R2F为例:

第一步先产生SCScode:



二。进行上述操作后就可以在对应目录下找到相应的工程。


编译成功,没有报错,上电运行正常。

三)如何把SCS工程加入到普通的BLE工程。

scif.c
scif.h
scif_framework.c 
scif_framework.h
scif_osal_tirtos.c
scif_osal_tirtos.h

把这些文件添加到工程目录下。然后修改一个为一个线程。

static void sensorTaskFxn(UArg a0, UArg a1)

{

.......

      // Initialize the Sensor Controller

    scifOsalInit();

    scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);

    scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);

    scifInit(&scifDriverSetup);

    scifStartRtcTicksNow(0x00010000 / 128);

    // Configure and start the ADC Data Logger task. The task does not signalize data exchange, but

    // has buffering capacity for 256 samples = 2 seconds

    scifStartTasksNbl(BV(SCIF_ADC_DATA_LOGGER_TASK_ID)); 

  // Task loop

  uint16_t tail = 0;

  while (true)

  {

    if ( sensorConfig == ST_CFG_SENSOR_ENABLE )

    {

      Data_t data;

        // Wake up every 1 seconds

        Task_sleep(1000000 / Clock_tickPeriod);

        // Fetch the current head index

        uint16_t head = scifTaskData.adcDataLogger.output.head;

        while (tail != head) {

            data= scifTaskData.adcDataLogger.output.pSamples[tail];

            // Increment the tail index

            if (++tail >= (sizeof(scifTaskData.adcDataLogger.output.pSamples) / sizeof(uint16_t))) {

                tail = 0;

            }

..
}
重点函数: SCS生成的代码添加大CCS工程中之后,还需要在CCS原工程中触发SCS代码进行迭代:scifStartTasksNbl 
PS:大家可能发现开始是LED,后来变成了ADC,是我太懒了,拿了一部分同事的Code作为讲解。

如果有什么不懂得可以去看TI的视频比我讲的详细很多:http://software-dl.ti.com/lprf/simplelink_academy/overview.html

https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/p/607699/2236580

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值