资源简介

while(1) { /* user code start */ if(basicRfPacketIsReady()){ basicRfReceive(buf,1,NULL); if(buf[0]==0x01){ P1_7=!P1_7; P1_0=1;4 } else if(buf[0]==0x00) { P1_7=!P1_7; P1_0=0; } else if(buf[0]==0x03) { P2_0=!P2_0; P1_1=1; } else if(buf[0]==0x02) { P2_0 =!P2_0; P1_1=0; } } /* user code end */ }

资源截图

代码片段和文件信息

//-------------------------------------------------------------------
// Filename: basic_rf.c
// Description: Basic RF library
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// INCLUDES
//-------------------------------------------------------------------
#include “hal_defs.h“
#include “hal_int.h“
#include “hal_mcu.h“            // Using halMcuWaitUs()
#include “hal_rf.h“
#include “basic_rf.h“
#ifdef SECURITY_CCM
    #include “hal_rf_security.h“
    #include “basic_rf_security.h“
#endif 
#include 

//-------------------------------------------------------------------
// CONSTANTS AND DEFINES
//-------------------------------------------------------------------
// Packet and packet part lengths
#define PKT_LEN_MIC                         8
#define PKT_LEN_SEC                         PKT_LEN_UNSEC + PKT_LEN_MIC
#define PKT_LEN_AUTH                        8
#define PKT_LEN_ENCR                        24

// Packet overhead ((frame control field sequence number PAN ID
// destination and source) + (footer))
// Note that the length byte itself is not included included in the packet length
#define BASIC_RF_PACKET_OVERHEAD_SIZE       ((2 + 1 + 2 + 2 + 2) + (2))
#define BASIC_RF_MAX_PAYLOAD_SIZE         (127 - BASIC_RF_PACKET_OVERHEAD_SIZE - BASIC_RF_AUX_HDR_LENGTH - BASIC_RF_LEN_MIC)
#define BASIC_RF_ACK_PACKET_SIZE         5
#define BASIC_RF_FOOTER_SIZE                2
#define BASIC_RF_HDR_SIZE                   10

// The time it takes for the acknowledgment packet to be received after the
// data packet has been transmitted.
#define BASIC_RF_ACK_DURATION         (0.5 * 32 * 2 * ((4 + 1) + (1) + (2 + 1) + (2)))
#define BASIC_RF_SYMBOL_DURATION         (32 * 0.5)

// The length byte
#define BASIC_RF_PLD_LEN_MASK               0x7F

// frame control field
#define BASIC_RF_FCF_NOACK                  0x8841
#define BASIC_RF_FCF_ACK                    0x8861
#define BASIC_RF_FCF_ACK_BM                 0x0020
#define BASIC_RF_FCF_BM                     (~BASIC_RF_FCF_ACK_BM)
#define BASIC_RF_SEC_ENABLED_FCF_BM         0x0008

// frame control field LSB
#define BASIC_RF_FCF_NOACK_L                LO_UINT16(BASIC_RF_FCF_NOACK)
#define BASIC_RF_FCF_ACK_L                  LO_UINT16(BASIC_RF_FCF_ACK)
#define BASIC_RF_FCF_ACK_BM_L               LO_UINT16(BASIC_RF_FCF_ACK_BM)
#define BASIC_RF_FCF_BM_L                   LO_UINT16(BASIC_RF_FCF_BM)
#define BASIC_RF_SEC_ENABLED_FCF_BM_L       LO_UINT16(BASIC_RF_SEC_ENABLED_FCF_BM)

// Auxiliary Security header
#define BASIC_RF_AUX_HDR_LENGTH             5
#define BASIC_RF_LEN_AUTH                   BASIC_RF_PACKET_OVERHEAD_SIZE + BASIC_RF_AUX_HDR_LENGTH - BASIC_RF_FOOTER_SIZE
#define BASIC_RF_SECURITY_M                 2
#define BASIC_RF_LEN_MIC                    8
#ifdef SECURITY_CCM
    #undef BASIC_RF_HDR_SIZE
    #define BASIC_RF_HDR_SIZE      

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      18442  2012-04-12 17:22  无线点灯\主\CC2530_lib\basicrf\basic_rf.c

     文件       5728  2012-11-12 10:22  无线点灯\主\CC2530_lib\basicrf\basic_rf.h

     文件       2345  2009-10-14 22:30  无线点灯\主\CC2530_lib\basicrf\basic_rf_security.c

     文件        445  2009-10-14 22:30  无线点灯\主\CC2530_lib\basicrf\basic_rf_security.h

     文件        264  2015-06-09 14:15  无线点灯\主\CC2530_lib\board\hal_board.c

     文件      15884  2012-03-05 18:39  无线点灯\主\CC2530_lib\board\hal_board.h

     文件       2626  2011-03-13 21:32  无线点灯\主\CC2530_lib\board\hal_led.c

     文件        427  2011-03-13 21:33  无线点灯\主\CC2530_lib\board\hal_led.h

     文件       1827  2012-03-05 17:43  无线点灯\主\CC2530_lib\common\hal_adc.c

     文件       3670  2012-03-05 17:38  无线点灯\主\CC2530_lib\common\hal_adc.h

     文件       3451  2009-10-21 15:10  无线点灯\主\CC2530_lib\common\hal_cc8051.h

     文件       2765  2009-10-14 22:30  无线点灯\主\CC2530_lib\common\hal_clock.c

     文件       3258  2009-10-14 23:46  无线点灯\主\CC2530_lib\common\hal_clock.h

     文件       4027  2010-10-16 17:09  无线点灯\主\CC2530_lib\common\hal_defs.h

     文件      14331  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_digio.c

     文件       1601  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_digio.h

     文件       2034  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_int.c

     文件        854  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_int.h

     文件       3870  2009-11-06 10:13  无线点灯\主\CC2530_lib\common\hal_mcu.c

     文件        734  2009-11-18 15:58  无线点灯\主\CC2530_lib\common\hal_mcu.h

     文件      12325  2011-10-24 17:31  无线点灯\主\CC2530_lib\common\hal_rf.c

     文件       2321  2011-10-24 17:31  无线点灯\主\CC2530_lib\common\hal_rf.h

     文件      12339  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_rf_security.c

     文件       1114  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_rf_security.h

     文件       1915  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_rf_util.c

     文件        439  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_rf_util.h

     文件        823  2011-09-06 11:21  无线点灯\主\CC2530_lib\common\hal_sleep.c

     文件        266  2011-09-06 10:04  无线点灯\主\CC2530_lib\common\hal_sleep.h

     文件       3960  2009-10-17 22:57  无线点灯\主\CC2530_lib\common\hal_timer_32k.c

     文件        784  2009-10-14 22:31  无线点灯\主\CC2530_lib\common\hal_timer_32k.h

............此处省略214个文件信息

评论

共有 条评论