rf_multi_pipe例程¶
1 功能概述¶
rf_multi_pipe演示了RF 297L增强型多通道功能在PAN262xb1_evb上的使用方法。
2 环境准备¶
Board: PAN262xb1_evb多块(另几块烧录不同地址的发送程序)
Micro USB线 用于供电和查看串口打印Log
硬件接线:
将 J19 开关拔至TX侧,将P3_1与uart的TX引脚相连
3 编译和烧录¶
例程位置:01_SDK\example_basic\rf\rf_multi_pipe
打开目录下keil下的rf_multi_pipe.uvprojx工程,编译整个代码工程,并下载至开发板。
4 演示说明¶
4.1 PIPE0通道接收演示¶
发送端的例程采用01_SDK\example_basic\rf\rf_tx
,rf发送地址如下:
RFConfig_t xdata gRfConfig =
{
/*.Channel = */ 2418,
/*.TxPower = */ 7,
/*.DataRate = */ RF_DR_1Mbps,
/*.ChipMode = */ RF_CHIPMODE_XN297,
/*.WorkMode = */ RF_WORKMODE_ENHANCE,
/*.EnAPL = */ ENABLE,
/*.EnDPL = */ ENABLE,
/*.EnTxNoAck = */ DISABLE,
/*.EnWhite = */ ENABLE,
/*.Crc = */ RF_CRC_2BYTE,
/*.AddrWidth = */ RF_ADRESS_SIZE,
/*.TRxAddr = */ {0x10, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x11, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x12, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x13, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x14, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x15, 0x22, 0x55, 0x0F, 0x71},
/*.RxTimeoutUs = */ 1000,
/*.TxSetupTimeUs = */ 200,
/*.TxBuf = */ {0},
/*.RxBuf = */ {0},
/*.TxLen = */ 0,
/*.RxLen = */ 0,
};
编译下载至发送端evb板,收发两端代码运行后可发现接收端在pipe5通道接收到了数据包,抓取接收端部分串口log如下:
RxPipe[0],RxLen[35]: 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C TxLen[64]: 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47
RxPipe[0],RxLen[35]: 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D TxLen[64]: 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48
4.2 PIPE0通道接收演示¶
发送端的例程采用01_SDK\example_basic\rf\rf_tx
,rf发送地址修改如下:
RFConfig_t xdata gRfConfig =
{
/*.Channel = */ 2418,
/*.TxPower = */ 7,
/*.DataRate = */ RF_DR_1Mbps,
/*.ChipMode = */ RF_CHIPMODE_XN297,
/*.WorkMode = */ RF_WORKMODE_ENHANCE,
/*.EnAPL = */ ENABLE,
/*.EnDPL = */ ENABLE,
/*.EnTxNoAck = */ DISABLE,
/*.EnWhite = */ ENABLE,
/*.Crc = */ RF_CRC_2BYTE,
/*.AddrWidth = */ RF_ADRESS_SIZE,
// /*.TRxAddr = */ {0x10, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x11, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x12, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x13, 0x22, 0x55, 0x0F, 0x71},
// /*.TRxAddr = */ {0x14, 0x22, 0x55, 0x0F, 0x71},
/*.TRxAddr = */ {0x15, 0x22, 0x55, 0x0F, 0x71},
/*.RxTimeoutUs = */ 1000,
/*.TxSetupTimeUs = */ 200,
/*.TxBuf = */ {0},
/*.RxBuf = */ {0},
/*.TxLen = */ 0,
/*.RxLen = */ 0,
};
编译下载至发送端evb板,收发两端代码运行后可发现接收端在pipe5通道接收到了数据包,抓取接收端部分串口log如下:
RxPipe[5],RxLen[35]: 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C TxLen[64]: 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47
RxPipe[5],RxLen[35]: 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D 5D TxLen[64]: 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48
5 RAM/Flash资源使用情况¶
Program Size: data=40.1 xdata=185 const=68 code=6085