除了上述线程之外、在如何从 CM0射频内核到 CM4应用处理器获取 RAT 计时器匹配的 HWI 或 SWI 方面是否取得了任何进展?
谢谢!
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.
除了上述线程之外、在如何从 CM0射频内核到 CM4应用处理器获取 RAT 计时器匹配的 HWI 或 SWI 方面是否取得了任何进展?
谢谢!
尊敬的 Mike:
我不确定这是否是您正在寻找的解决方案。 但是、您是否了解过 RF_ratCompare 和 RF_ratCapture API?
这似乎是您要寻找的。 这是我可以找到的关于这一点的唯一内容。
此致。
SID
再次感谢 Sid。
因此、在我使用 RF_runCmd 计划 RX 或 TX 之后、我将其命名为100us。
我的回调会不断触发 RF_EventError。 在示波器上、时序关闭、这与 RF_EventError 相符
我不想在某个地方有这样的示例。
这是调用。 我的主同步在 Tx 开始时间、从机在 Rx rxTime 上从数据包同步、如 rfSynchronizedPacket 示例所示。 该部件一直运转良好。 我将其包含在上下文中、因为我只需将100us 添加到 StartTime 中。
if (isMaster()) {
rf_ctx.RF_cmdPropTx->startTime += RF_convertUsToRatTicks(slotTimeUs);
rf_ctx.RF_cmdPropRx->startTime = rf_ctx.RF_cmdPropTx->startTime;
} else {
rf_ctx.RF_cmdPropRx->startTime += RF_convertUsToRatTicks(slotTimeUs);
rf_ctx.RF_cmdPropTx->startTime = rf_ctx.RF_cmdPropRx->startTime;
}
scheduleTask(rf_ctx.RF_cmdPropRx->startTime + RF_convertUsToRatTicks(100));
这是调度程序
static void scheduleTask(uint32_t timeout) {
RF_RatConfigOutput ioCfg;
RF_RatConfigOutput_init(&ioCfg);
RF_RatConfigCompare channelCfg;
RF_RatConfigCompare_init(&channelCfg);
channelCfg.callback = &scheduleTaskCb;
channelCfg.timeout = timeout;
RF_ratCompare(rfHandle,&channelCfg, &ioCfg);
}
这是回调、只需切换 GPIO 并布置信标(从未发生过)
static void scheduleTaskCb(RF_Handle h, RF_RatHandle rh, RF_EventMask e, uint32_t compareCaptureTime) {
switch(e) {
case RF_EventRatCh:
GPIO_toggle(CONFIG_GPIO_TP1);
Semaphore_post(rfSem);
GPIO_toggle(CONFIG_GPIO_TP1);
break;
case RF_EventError:
// printf("RF_EventError\n");
break;
}
}
这起作用了。 再次感谢 Sid!
想知道我是否可以映射到未使用的 RatGpo 以保存在引脚 IO 上
static void scheduleTask(uint32_t timeout) {
RF_RatConfigOutput ioCfg;
RF_RatConfigOutput_init(&ioCfg);
ioCfg.select = RF_RatOutputSelectRatGpo7;
ioCfg.mode = RF_RatOutputModePulse;
RF_RatConfigCompare channelCfg;
RF_RatConfigCompare_init(&channelCfg);
channelCfg.callback = &scheduleTaskCb;
channelCfg.timeout = timeout;
channelCfg.channel = RF_RatChannelAny;
RF_ratCompare(rfHandle,&channelCfg, &ioCfg);
}