?? radio.h
字號:
/*------------------------------------------------------------------------------
* radio.h
* Copyright 1994-2006 Infortech Technology Co.,Ltd.
* DESCRIPTION:
* Author : Shutingzhong 2008-09-13
-----------------------------------------------------------------------------*/
#ifndef _RADIO_H
#define _RADIO_H
/*-------------------------------------*
* 宏定義 *
*---------------------------------------------------------------------------*/
#define NETWORK_ID_KEY 0x5aa5 // Network ID key that identifies
// transmitter/receiver pair
#define PACKET_LENGTH 169 // 2[network id] + 168[data]
// Payload length. Does not include
// 1 length byte (prefixing payload,
// containing this value) and 2
// appended bytes CRC and Does include
// 2 bytes network identifier and 128
// bytes data
#define STROBE_TX 0x03 // Strobe commands for the RFST
#define STROBE_RX 0x02 // register
#define STROBE_SIDLE 0x04
#define IRQ_DONE 0x10 // The IRQ_DONE bit in the RFIF-
// and RFIM-register
// Preset frequency alternatives
#define FREQUENCY_915MHZ 915000 // kHz. NOTE: If you want to alter
#define FREQUENCY_903MHZ 903000 // these values you will also have
#define FREQUENCY_868MHZ 868000 // to modify the register settings
#define FREQUENCY_433MHZ 433000 // radioConfigure() in
// Preset data rate alternatives
#define DATA_RATE_500K 500000 // bps. NOTE: If you alter these
#define DATA_RATE_250K 250000 // values you will also have to
#define DATA_RATE_38_4K 38400 // modify register settings in
#define DATA_RATE_1_2K 1200 // radioConfigure() in
/*-------------------------------------*
* 變量聲名 *
*---------------------------------------------------------------------------*/
extern byte __xdata radioPktBuffer[1 + PACKET_LENGTH + 2]; // 1[length] + PACKET_LENGTH[payload] +2[crc]
extern int16 perRssiOffset;
/*-------------------------------------*
* 函數聲名 *
*---------------------------------------------------------------------------*/
extern void radioConfigure(uint32 dataRate, uint32 frequency) ;
extern bool pktCheckValidity(void);
extern bool pktCheckCrc(void);
extern void halRfConfig(void);
#endif /* _RADIO_H */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -