资源简介
亲测有效的基于CC2530的烟雾传感器数据采集系统,内含串口助手,采集的数据会显示在串口助手中。
代码片段和文件信息
/***********************************************************************************
Filename: per_test.c
Description: This application functions as a packet error rate (PER) tester.
One node is set up as transmitter and the other as receiver. The role and
configuration parameters for the PER test of the node is chosen on initalisation
by navigating the joystick and confirm the choices with S1.
The configuration parameters are channel burst size and tx power. Push S1 to
enter the menu. Then the configuration parameters are set by pressing
joystick to right or left (increase/decrease value) and confirm with S1.
After configuration of both the receiver and transmitter the PER test is
started by pressing joystick up on the transmitter. By pressing joystick up
again the test is stopped.
***********************************************************************************/
/***********************************************************************************
* INCLUDES
*/
#include “hal_lcd.h“
#include “hal_led.h“
#include “hal_int.h“
#include “hal_timer_32k.h“
#include “hal_joystick.h“
#include “hal_button.h“
#include “hal_board.h“
#include “hal_rf.h“
#include “hal_assert.h“
#include “util_lcd.h“
#include “basic_rf.h“
#include “per_test.h“
/***********************************************************************************
* CONSTANTS
*/
// Application states
#define IDLE 0
#define TRANSMIT_PACKET 1
/***********************************************************************************
* LOCAL VARIABLES
*/
static basicRfCfg_t basicRfConfig;
static perTestPacket_t txPacket;
static perTestPacket_t rxPacket;
static volatile uint8 appState;
static volatile uint8 appStarted;
/***********************************************************************************
* LOCAL FUNCTIONS
*/
static void appTimerISR(void);
static void appStartStop(void);
static void appTransmitter();
static void appReceiver();
/***********************************************************************************
* @fn appTimerISR
*
* @brief 32KHz timer interrupt service routine. Signals PER test transmitter
* application to transmit a packet by setting application state.
*
* @param none
*
* @return none
*/
static void appTimerISR(void)
{
appState = TRANSMIT_PACKET;
}
/***********************************************************************************
* @fn appStartStop
*
* @brief Joystick up interrupt service routine. Start or stop 32KHz timer
* and thereby start or stop PER test packet transmission.
*
* @param none
*
* @return none
*/
static void appStartStop(void)
{
// toggle value
appStarted ^= 1;
if(appStarted) {
halTimer32kIntEnable();
}
else {
halTimer32kIntDisable();
}
}
/******************************
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-06 22:23 1.一对一数据传输\
文件 384781 2014-01-12 16:26 1.一对一数据传输\CC2530实现一对一无线数据传输.pdf
目录 0 2018-01-06 22:23 1.一对一数据传输\数据发送模块\
目录 0 2018-01-06 22:23 1.一对一数据传输\数据发送模块\ide\
文件 1263 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\cc2530_sw_examples.eww
目录 0 2018-01-06 22:23 1.一对一数据传输\数据发送模块\ide\settings\
文件 4856 2017-12-07 00:45 1.一对一数据传输\数据发送模块\ide\settings\cc2530_sw_examples.wsdt
目录 0 2018-01-06 22:23 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\
目录 0 2018-01-06 22:23 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\
文件 17219 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup (2) of light_switch.ewd
文件 32704 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup (2) of light_switch.ewp
文件 17204 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup (2) of per_test.ewd
文件 33888 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup (2) of per_test.ewp
文件 17204 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup (2) of spectrum_analyzer.ewd
文件 33036 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup (2) of spectrum_analyzer.ewp
文件 13542 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup of light_switch.ewd
文件 32542 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup of light_switch.ewp
文件 13542 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup of per_test.ewd
文件 32675 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup of per_test.ewp
文件 13331 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup of spectrum_analyzer.ewd
文件 31691 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\Backup of spectrum_analyzer.ewp
文件 94559 2017-12-07 00:42 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\light_switch.d51
文件 16536 2017-12-07 00:45 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\light_switch.dep
文件 17220 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\light_switch.ewd
文件 33065 2017-11-16 02:36 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\light_switch.ewp
文件 166 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\light_switch.eww
文件 10281 2017-12-07 00:42 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\light_switch.hex
文件 226588 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\per_test.d51
文件 16424 2017-12-07 00:45 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\per_test.dep
文件 17205 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\per_test.ewd
文件 34212 2014-01-12 16:26 1.一对一数据传输\数据发送模块\ide\srf05_cc2530\iar\per_test.ewp
............此处省略399个文件信息
评论
共有 条评论