完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
ti工程师,您好!我在打开无线设备后,想重新初始化一下速率和频率,也就是重新初始化一次无线设备,请问该如何操作呢?谢谢!
RF_Params rfParams; RF_Params_init(&rfParams); /* Open LED pins */ ledPinHandle = PIN_open(&ledPinState, pinTable); if (ledPinHandle == NULL) [ while(1); ] //sleep(5); /* Route out LNA active pin to LED1 */ PINCC26XX_setMux(ledPinHandle, Board_PIN_LED1, PINCC26XX_MUX_RFC_GPO0); /* Create queue and data entries */ if (RFQueue_defineQueue(&dataQueue, rxDataEntryBuffer, sizeof(rxDataEntryBuffer), NUM_DATA_ENTRIES, MAX_LENGTH + NUM_APPENDED_BYTES)) [ /* Failed to allocate space for all data entries */ while(1); ] /* Copy all RX options from the SmartRF Studio exported RX command to the RX Sniff command */ initializeSniffCmdFromRxCmd(&RF_cmdPropRxSniff, &RF_cmdPropRx); /* Configure RX part of RX_SNIFF command */ RF_cmdPropRxSniff.pQueue = &dataQueue; RF_cmdPropRxSniff.pOutput = (uint8_t*)&rxStatistics; RF_cmdPropRxSniff.maxPktLen = MAX_LENGTH; /* Discard ignored packets and CRC errors from Rx queue */ RF_cmdPropRxSniff.rxConf.bAutoFlushIgnored = 1; RF_cmdPropRxSniff.rxConf.bAutoFlushCrcErr = 1; /* Calculate datarate from prescaler and rate word */ uint32_t datarate = calculateSymbolRate(RF_cmdPropRadioDivSetup.symbolRate.preScale, RF_cmdPropRadioDivSetup.symbolRate.rateWord); /* Configure Sniff-mode part of the RX_SNIFF command */ configureSniffCmd(&RF_cmdPropRxSniff, WOR_MODE, datarate, WOR_WAKEUPS_PER_SECOND); /* Request access to the radio */ rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams); /* Set frequency */ RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, &callback, 0); while(1) [ ] 其实我的应用是这样的,无线唤醒时,由于数据量小,故而用一个速率比较快的方式,当真正在通信时,需要提高通信的灵敏度和成功率,所以需要一个速率较低的方式进行。我尝试过在wakeOnRadio下修改,每次接受到数据之间RF_close(),再重新初始化,发现根本不能关闭,仿真时,之间死在RF_close里面。所以需要问下,RF_open和RF_close到底是如何操作的?另外,我的速率参数修改是否一定需要close后再重新初始化。 |
|
相关推荐
7个回答
|
|
我看过,就是 rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);中的 RF_cmdPropRadioDivSetup参数需要重新设置。
|
|
|
|
你设置的接收到数据后的工作状态是什么?
如果是继续接收,那么你需要先退出RX状态,在RF处于idle时调用RF_close()。 关于RF_close()函数的使用例程,可以参看rfPacketErrorRate示例工程。 另外,修改频率可以直接使用RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0); 修改速率,可以使用RF_control(rfHandle, RF_CTRL_UPDATE_SETUP_CMD, NULL) 命令 可以借鉴如下做法: Use the command RF_control(..,RF_CTRL_UPDATE_SETUP_CMD, ..) after defining the new frequency. RF_CTRL_UPDATE_SETUP_CMD signals that the change will take effect immidiate on the next power cycle. The flow could look like this: RF_open Start RX (using freq. 1) Exit Rx RF_control (RF_CTRL_UPDATE_SETUP_CMD) - change to freq.2 Go to standby or atleast power down RF core (either RF_yield or set inactivityTimeout) Start Rx (using freq. 2) Exit Rx RF_control (RF_CTRL_UPDATE_SETUP_CMD) - change to freq.1 Go to standby or atleast power down RF core (either RF_yield or set inactivityTimeout) Start Rx (using freq. 1) Exit Rx Driver documentation: http://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_1_30_00_06/docs/tidrivers/doxygen/html/_r_f_8h.html Description of define RF_CTRL_UPDATE_SETUP_CMD : Setting this control notifies RF that the setup command is to be updated, so that RF will take proper actions when executing the next setup command. Note the updated setup command will take effect in the next power up cycle when RF executes the setup command. Prior to updating the setup command, user should make sure all pending commands have completed. |
|
|
|
个人用户 发表于 2018-5-15 13:58 您好。我想问下:我的另外一种速率定义为RF_cmdPropRadioDivSetup_100,然后RF_control是在下面的一个命令吗? rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup_100, &rfParams); RF_control(rfHandle, RF_CTRL_UPDATE_SETUP_CMD, NULL); 按照这个测试还是一样,收到的还是原来速率的数据,并未更新为新的。 |
|
|
|
个人用户 发表于 2018-5-15 13:58 追加一问,是设置的接收到数据后的工作状态变为IDLE是如何设置? |
|
|
|
可以借鉴如下做法: Use the command RF_control(..,RF_CTRL_UPDATE_SETUP_CMD, ..) after defining the new frequency. RF_CTRL_UPDATE_SETUP_CMD signals that the change will take effect immidiate on the next power cycle. The flow could look like this: RF_open Start RX (using freq. 1) Exit Rx RF_control (RF_CTRL_UPDATE_SETUP_CMD) - change to freq.2 Go to standby or atleast power down RF core (either RF_yield or set inactivityTimeout) Start Rx (using freq. 2) Exit Rx RF_control (RF_CTRL_UPDATE_SETUP_CMD) - change to freq.1 Go to standby or atleast power down RF core (either RF_yield or set inactivityTimeout) Start Rx (using freq. 1) Exit Rx Driver documentation: http://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_1_30_00_06/docs/tidrivers/doxygen/html/_r_f_8h.html Description of define RF_CTRL_UPDATE_SETUP_CMD : Setting this control notifies RF that the setup command is to be updated, so that RF will take proper actions when executing the next setup command. Note the updated setup command will take effect in the next power up cycle when RF executes the setup command. Prior to updating the setup command, user should make sure all pending commands have completed. |
|
|
|
个人用户 发表于 2018-5-15 14:15 请问下,答案能否再通俗点呢? |
|
|
|
F.ex.: 1. …use settings from smartrf_settings.c (50kbps) 2. RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0); //Send packet@50kbps 3. //Change from 50kbps to 500kbps with update RF_cmdPropRadioDivSetup.symbolRate.preScale = 0x6; RF_cmdPropRadioDivSetup.symbolRate.rateWord = 0x20000; RF_cmdPropRadioDivSetup.modulation.modType = 0x1; RF_cmdPropRadioDivSetup.modulation.deviation = 0x2BC; RF_cmdPropRadioDivSetup.rxBw = 0x2F; 4. RF_control(rfHandle, RF_CTRL_UPDATE_SETUP_CMD, NULL); //Signal update Rf core 5. RF_yield(rfHandle); // Force a power down using RF_yield() API. This will power down RF after all pending radio commands are complete. 5. RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0); //Send packet@500kbps |
|
|
|
只有小组成员才能发言,加入小组>>
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
690 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
604 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1059 浏览 1 评论
749 浏览 0 评论
普中科技F28335开发板每次上电复位后数码管都会显示,如何熄灭它?
527 浏览 1 评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
170浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
131浏览 14评论
在使用3254进行录音的时候出现一个奇怪的现象,右声道有吱吱声,请教一下,是否是什么寄存器设置存在问题?
129浏览 13评论
TLV320芯片内部自带数字滤波功能,请问linein进来的模拟信号是否是先经过ADC的超采样?
125浏览 12评论
GD32F303RCT6配置PA4 ADC引脚,将PA2代替key功能,PA2连接时无法实现预期功能,为什么?
59浏览 10评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 17:55 , Processed in 1.046167 second(s), Total 94, Slave 77 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号