完善资料让更多小伙伴认识你,还能领取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 |
|
|
|
只有小组成员才能发言,加入小组>>
TMS320F28377D:新做了以377d为芯片的板子,上电后芯片复位引脚出现方波请问如何解决?
1888 浏览 0 评论
TPS55340通电后输入端保险丝烧断,芯片输入和GND之间短路
3641 浏览 4 评论
5027 浏览 0 评论
请问如何用DM368对RGB格式的图片数据进行编码生成JPEG格式图片?
1732 浏览 1 评论
9353 浏览 8 评论
CC3100BOOST使用CC3200lunchXL进行烧录
664浏览 2评论
707浏览 1评论
TMS320F28034: 利用C2prog通过SCI给TMS320F28034烧录程序,出现错误提示:Bootloading... failed (invalid echo)!
668浏览 1评论
求DLPC350 Programmer’s Guide User's Guide 中文版说明书
1189浏览 1评论
1761浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-20 12:12 , Processed in 0.492229 second(s), Total 50, Slave 45 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号