📄 si443x_demo.h
字号:
/*
** ============================================================================
**
** FILE
** $Id: Si443x.h,v 1.0 2007/08/28 krk Exp apache $
**
** DESCRIPTION
**
**
** CREATED
** Integration Hungary Ltd
**
** COPYRIGHT
** Copyright 2006 Integration Associates Inc. All rights reserved.
**
** Permission to use, copy, modify, revise, translate, abridge, condense, expand, collect,
** compile, link, recast, distribute, transform or adapt this software is granted only by
** specific written license from Integration Associates Inc. Contact Integration Associates
** at 110 Pioneer Way, Unit L, Mountain View, California 94041, Attention Sales & Marketing,
** or call (650) 969-4100 for information about obtaining a license.
**
** Any copy or modification made must satisfy the following conditions:
**
** 1. Both the copyright notice and this permission notice appear in all copies of the software,
** derivative works or modified versions, and any portions thereof, and that both notices
** appear in supporting documentation.
**
** 2. All copies of the software shall contain the following acknowledgement: "Portions of this
** software are used under license from Integration Associates Inc. and are copyrighted."
**
** 3. Neither the name of Integration Associates Inc. nor any of its subsidiaries may be used
** to endorse or promote products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY "AS IS" AND ALL WARRANTIES OF ANY KIND, INCLUDING THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR USE, ARE EXPRESSLY DISCLAIMED. THE DEVELOPER
** SHALL NOT BE LIABLE FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
** THIS SOFTWARE MAY NOT BE USED IN PRODUCTS INTENDED FOR USE IN IMPLANTATION OR OTHER DIRECT
** LIFE SUPPORT APPLICATIONS WHERE MALFUNCTION MAY RESULT IN THE DIRECT PHYSICAL HARM OR INJURY
** TO PERSONS. ALL SUCH IS USE IS EXPRESSLY PROHIBITED.
**
** ============================================================================
*/
#ifndef IA443X_DEMO_H
#define IA443X_DEMO_H
#include "S8051.h"
#include "timers.h"
#include "Si443x_rf.h"
/* ======================================= *
* D E F I N I T I O N S *
* ======================================= */
#define MAX_LENGTH_OF_PAYLOAD 64
#define ACK_TIMEOUT 25000
#define DEMO_RX 0
#define DEMO_TX 1
#define PARAM_DR 0
#define PARAM_FREQ 1
#define PARAM_DID 2
typedef struct _DEMO_FREQ
{
uint8 frequency_band;
uint16 frequency;
uint8 freq_text[7];
} DEMO_FREQ;
typedef enum _PACKET_TYPE
{
ACK_PACKET = 0,
PING_PACKET = 1,
} PACKET_TYPE;
typedef enum _DEMO_STATES
{
sDemoInit,
sDemoStartScreen,
sDemoDelayAfterScreens,
sDemoInitRf,
sDemoSettingScreen,
sDemoChangeSP1,
sDemoDrawSP2,
sDemoChangeSP2,
sDemoDrawSP3,
sDemoChangeSP3,
sDemoDrawSP4,
sDemoChangeSP4,
sDemoDefineDemoOrTest,
sDemoStartCW,
sDemoCheckSettingButton,
sDemoStartPN9,
sDemoStartBER,
sDemoStartPER,
sDemoPERWaitForStart,
sDemoPERStartReceive,
sDemoPERPrintResult,
sDemoRestartTxDemo,
sDemoTxStartTransmit,
sDemoRestartRxDemo,
sDemoRxStartReceive,
sDemoRxWaitForReceive,
sDemoRestartDemo,
sDemoStartReceive,
sDemoDelayBeforeTx,
sDemoWaitForClearScreen,
sDemoWaitForReceive,
sDemoPacketReceived,
sDemoSendPing,
sDemoWaitForSendPacket,
sDemoPacketSent,
sDemoTxError,
sDemoWaitForAck,
sDemoDoNothing,
} DEMO_STATES;
/* ======================================= *
* V A R I A B L E S *
* ======================================= */
/* ======================================= *
* F U N C T I O N P R O T O T Y P E S *
* ======================================= */
void DemoInit(void);
void DemoStateMachine(void);
float CalcPer(uint16 total, uint16 received);
void SetRadio(void);
GetFreq(uint8 freq_number, uint8 * strig);
void GetAntDiversityResult(void);
void RFSetFrequencyForX2(uint8 rx_tx);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -