• 大小: 1.09MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-28
  • 语言: 其他
  • 标签: CC2530  basic  rf  

资源简介

CC2530 basic rf

资源截图

代码片段和文件信息

/***********************************************************************************
  Filename: light_switch.c

  Description:  This application function either as a light or a
  switch toggling the ligh. The role of the
  application is chosen in the menu with the joystick at initialisation.

  Push S1 to enter the menu. Choose either switch or
  light and confirm choice with S1.
  Joystick Up: Sends data from switch to light

***********************************************************************************/

/***********************************************************************************
* INCLUDES
*/
#include 
#include 
#include 
#include 
#include 
#include 
#include “hal_mcu.h“
#include “hal_button.h“
#include “hal_rf.h“
#include “util_lcd.h“
#include “basic_rf.h“
/* 5/7/2010 ++ by outman from feibit */
#include


/***********************************************************************************
* CONSTANTS
*/
// Application parameters
#define RF_CHANNEL                25      // 2.4 GHz RF channel

// BasicRF address definitions
#define PAN_ID                0x2007
#define SWITCH_ADDR           0x2520
#define LIGHT_ADDR            0xBEEF
#define APP_PAYLOAD_LENGTH        1
#define LIGHT_TOGGLE_CMD          0

// Application states
#define IDLE                      0
#define SEND_CMD                  1

// Application role
#define NONE                      0
#define SWITCH                    1
#define LIGHT                     2
#define APP_MODES                 2

/***********************************************************************************
* LOCAL VARIABLES
*/
static uint8 pTxData[APP_PAYLOAD_LENGTH];
static uint8 pRxData[APP_PAYLOAD_LENGTH];
static basicRfCfg_t basicRfConfig;

// Mode menu
static menuItem_t pMenuItems[] =
{
#ifdef ASSY_EXP4618_CC2420
  // Using Softbaugh 7-seg display
  “ L S    “ SWITCH
  “ LIGHT  “ LIGHT
#else
  // SRF04EB and SRF05EB
  “Switch“   SWITCH
  “Light“    LIGHT
#endif
};

static menu_t pMenu =
{
  pMenuItems
  N_ITEMS(pMenuItems)
};


#ifdef SECURITY_CCM
// Security key
static uint8 key[]= {
    0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7
    0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf
};
#endif

/***********************************************************************************
* LOCAL FUNCTIONS
*/
static void appLight();
static void appSwitch();
static uint8 appSelectMode(void);

/* 5/7/2010 ++ by outman from feibit */
void printRecCnt(int8 rec_cnt)
{
   char rssiString[16];
   sprintf(rssiString  (char const *)“Rec Cnt: %d“ (rec_cnt));
   halLcdWriteLine(HAL_LCD_LINE_3(char const *)rssiString);
}
/* 5/7/2010 ++ by outman from feibit */
void printRSSI(int8 rssi)
{
   char rssiString[16];
   sprintf(rssiString  (char const *)“RSSI: %d dBm“ (rssi));
   halLcdWriteLine(HAL_LCD_LINE_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-05-16 18:29  CC2530_BasicRF\
     目录           0  2010-06-30 16:00  CC2530_BasicRF\docs\
     文件      456246  2009-10-27 13:13  CC2530_BasicRF\docs\CC2530_Software_Examples.pdf
     目录           0  2010-06-30 16:00  CC2530_BasicRF\ide\
     目录           0  2010-06-30 16:00  CC2530_BasicRF\ide\settings\
     文件        3078  2010-06-30 16:03  CC2530_BasicRF\ide\settings\cc2530_sw_examples.wsdt
     目录           0  2010-06-30 16:00  CC2530_BasicRF\ide\srf05_cc2530\
     目录           0  2013-05-19 12:12  CC2530_BasicRF\ide\srf05_cc2530\iar\
     文件      167509  2013-05-17 18:34  CC2530_BasicRF\ide\srf05_cc2530\iar\light_switch.d51
     文件       16771  2013-05-20 12:49  CC2530_BasicRF\ide\srf05_cc2530\iar\light_switch.dep
     文件       13542  2009-10-27 13:13  CC2530_BasicRF\ide\srf05_cc2530\iar\light_switch.ewd
     文件       32541  2013-05-17 17:32  CC2530_BasicRF\ide\srf05_cc2530\iar\light_switch.ewp
     文件         166  2009-10-27 13:13  CC2530_BasicRF\ide\srf05_cc2530\iar\light_switch.eww
     文件       14763  2013-05-17 18:34  CC2530_BasicRF\ide\srf05_cc2530\iar\light_switch.hex
     文件      196272  2010-10-21 13:51  CC2530_BasicRF\ide\srf05_cc2530\iar\per_test.d51
     文件       16587  2013-05-20 11:23  CC2530_BasicRF\ide\srf05_cc2530\iar\per_test.dep
     文件       13542  2009-10-27 13:13  CC2530_BasicRF\ide\srf05_cc2530\iar\per_test.ewd
     文件       32684  2010-10-21 14:03  CC2530_BasicRF\ide\srf05_cc2530\iar\per_test.ewp
     文件         162  2009-10-27 13:13  CC2530_BasicRF\ide\srf05_cc2530\iar\per_test.eww
     文件       24979  2010-10-21 13:51  CC2530_BasicRF\ide\srf05_cc2530\iar\per_test.hex
     文件       26365  2010-10-11 19:23  CC2530_BasicRF\ide\srf05_cc2530\iar\per_test_new_LCD_20101011.hex
     目录           0  2010-06-30 16:00  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\
     文件        2496  2013-05-20 11:23  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\light_switch.cspy.bat
     文件        5474  2013-05-20 12:49  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\light_switch.dbgdt
     文件         459  2013-05-20 12:49  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\light_switch.dni
     文件        5060  2013-05-20 12:49  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\light_switch.wsdt
     文件        2496  2013-05-20 11:22  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\per_test.cspy.bat
     文件        5848  2013-05-20 11:23  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\per_test.dbgdt
     文件         459  2013-05-20 11:23  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\per_test.dni
     文件        4695  2013-05-20 11:23  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\per_test.wsdt
     文件        2496  2010-08-31 17:19  CC2530_BasicRF\ide\srf05_cc2530\iar\settings\spectrum_analyzer.cspy.bat
............此处省略144个文件信息

评论

共有 条评论