⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfpacket.h

📁 SmartRF04EB+CC2431EM的测试代码
💻 H
字号:
/******************************************************************************
 * rfPacket.h
 *
 * Copyright 1994-2006 HolyStone Technology Co.,Ltd.
 *
 * DESCRIPTION:
 *
 * modification history
 * --------------------
 * 01a, 23mar2007, cuiqingwei written
 * --------------------
 ******************************************************************************/

#ifndef _RFPACKETTRANSCEIVER_H
#define _RFPACKETTRANSCEIVER_H

//-----------------------------------------------------------------------------
// Define constants
//-----------------------------------------------------------------------------

#define RF_BUF_SIZE     125

//-----------------------------------------------------------------------------
// Extern Variables
//-----------------------------------------------------------------------------

extern byte RfRecvLength,RfBuf[RF_BUF_SIZE];
extern byte Rssi,Lqi;
extern uint16 RfRecvtimeOut;
//-----------------------------------------------------------------------------
// EXTERN FUNCTIONS
//-----------------------------------------------------------------------------
/******************************************************************************
* @fn  RfSend
*
* @brief
*      This function sends the given number of bytes using the radio. The radio
*      frequency must be set before sending. Can send a maximum of 125 bytes.
*      The function waits until the transfer is complete.
*
* Parameters:
*
* @param  byte*	 pData
*         Pointer to the start of the data to be transferred.
* @param  byte	 length
*         The number of bytes to be transferred.
*
* @return byte
*         Returns the number of transferred bytes.
*
******************************************************************************/

extern byte RfSendPacket(byte* pData, byte length);

/******************************************************************************
* @fn  RfReceivePacket
*
* @brief
*      This function receives a maximum of 128 bytes sent by another radio
*      transmitter. The function will wait for _timeOut_ ms before returning
*      without receiving any data.
*
* Parameters:
*
* @param  byte*	 pData
*         Pointer to the received packet is to be stored.
* @param  byte pRssi
*         Pointer to where to store the received signal strength indicator calculation.
* @param  byte pLqi
*         Pointer to where to store the link quality indicator.
* @param  byte	 timeOut
*         The number of ms the chip will wait for a packet to be received.
*
* @return byte
*         Returns the number of received bytes.
*
******************************************************************************/

extern byte RfReceivePacket(byte* pData, byte* pRssi, byte* pLqi, uint16 timeOut);

#endif  /* _RFPACKETTRANSCEIVER_H */

/*------------------------------------------------------------------------------
                                        0ooo
						      ooo0     (   )
                              (   )     ) /
						       \ (     (_/
	    				        \_)        By:cuiqingwei [gary]
------------------------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -