资源简介
本资源位TI提供的CC2530配套代码,里面包括基本的无线点灯实验等等

代码片段和文件信息
/***********************************************************************************
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“
/***********************************************************************************
* 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);
/***********************************************************************************
* @fn appLight
*
* @brief Application code for light application. Puts MCU in endless
* loop waiting for user input from joystick.
*
* @param basicRfConfig - file scope variable. Basic RF configuration data
* pRxData - file scope variable. Pointer to buffer for RX data
*
* @return none
*/
static void appLight()
{
halLcdWriteLi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3385 2009-10-27 12:13 source\apps\per_test\per_test.h
文件 14194 2009-10-27 12:13 source\apps\per_test\per_test.c
文件 3527 2009-10-27 12:13 source\apps\per_test\per_test_menu.h
文件 6852 2009-10-27 12:13 source\apps\per_test\per_test_menu.c
文件 13899 2009-10-27 12:13 source\components\utils\util_lcd.c
文件 3414 2009-10-27 12:13 source\components\utils\util_lcd.h
文件 6001 2009-10-27 12:13 source\components\utils\util_buffer.c
文件 3589 2009-10-27 12:13 source\components\utils\util_buffer.h
文件 5745 2009-10-27 12:13 source\components\utils\util.c
文件 3386 2009-10-27 12:13 source\components\utils\util.h
文件 20499 2009-10-27 12:13 source\components\basicrf\basic_rf.c
文件 5088 2009-10-27 12:13 source\components\basicrf\basic_rf.h
文件 3957 2009-10-27 12:13 source\components\common\hal_int.c
文件 6128 2009-10-27 12:13 source\components\common\hal_defs.h
文件 5345 2009-10-27 12:13 source\components\common\hal_types.h
文件 6227 2009-10-27 12:13 source\components\common\cc8051\hal_cc8051.h
文件 4897 2009-10-27 12:13 source\components\targets\interface\hal_rf.h
文件 2776 2009-10-27 12:13 source\components\targets\interface\hal_assert.h
文件 3489 2009-10-27 12:13 source\components\targets\interface\hal_mcu.h
文件 3872 2009-10-27 12:13 source\components\targets\interface\hal_digio.h
文件 3827 2009-10-27 12:13 source\components\targets\interface\hal_lcd.h
文件 3942 2009-10-27 12:13 source\components\targets\interface\hal_uart.h
文件 3000 2009-10-27 12:13 source\components\targets\interface\hal_button.h
文件 2865 2009-10-27 12:13 source\components\targets\interface\hal_led.h
文件 3365 2009-10-27 12:13 source\components\targets\interface\hal_joystick.h
文件 4434 2009-10-27 12:13 source\components\targets\interface\hal_int.h
文件 3198 2009-10-27 12:13 source\components\targets\interface\hal_timer_32k.h
文件 7239 2009-10-27 12:13 source\components\targets\srf05_soc\hal_board.h
文件 6943 2009-10-27 12:13 source\components\targets\srf05_soc\hal_board.c
文件 2151 2009-10-27 12:13 source\components\targets\srf05_soc\hal_button.c
文件 15744 2009-10-27 12:13 source\components\targets\srf05_soc\hal_digio.c
............此处省略40个文件信息
- 上一篇:manchester.rar
- 下一篇:FBWF 图形化控制台
相关资源
- Azure开发教程:Azure_Serverless_Computing
- 实验三 消息中间件应用开发:Active
- AsyncTask文件控制暂停和继续,在状态
- SpringBoot+H2+mybatis-plus59130
- Rational Rose Common破解文件
- umeshmotion网格推移
- Wolfram Mathematica 矩阵初等变换函数(
- 基本放大电路multisim仿真.ms14
-
Actionsc
ript 1.0实现能跟随鼠标运动的 - CCS5.05.1可使用的license
- TI CCS V5.4 安装步骤及破解文件
- cc2530寄存器手册
- 由浅入深,蓝牙4.0/BLE协议栈开发攻略
- The direction of synaptic plasticity mediated
- Reparatory Effects of Nicotine on NMDA Recepto
- Apolipoprotein E4 Impairs in vivo Hippocampal
- Histamine excites rat lateral vestibular nucle
- Diltiazem augmented pentobarbital-induced LORR
- LenovoTinkPad; Marker 5.01
- Fabrication and all-optical poling characteris
- Rtx51_tiny_RTOS中文版.pdf
- porting.RTEMS移植指南.双语.V20131224.pdf
- mybatis连接oracle实例
- adams vibration 练习原文件
-
开源tinyxm
l - 一个测试报告的模板,有点用
- VESA Computer Display Monitor Timing (DMT)
- 画图程序MFC/VC/VC CRectTracker 串行化
- Tone-Reservation
- 可编辑的CListctrl 支持CEDIT文本框,C
评论
共有 条评论