⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pub_def.h

📁 在飞思卡尔MC9S08GB60单片机环境下实现了无线监控
💻 H
字号:

#ifndef __PUB_DEFINE__
#define __PUB_DEFINE__
/*--------------Test only.---------------------------*/
//#define inline


typedef unsigned char  UINT8;      //!<unsigned 8 bit definition 
typedef unsigned int   UINT16;     //!<unsigned 16 bit definition
typedef unsigned long  UINT32;     //!<unsigned 32 bit definition
typedef signed char    INT8;       //!<signed 8 bit definition 
typedef int            INT16;      //!<signed 16 bit definition
typedef long int       INT32;      //!<signed 32 bit definition



/*typedef unsigned char   UINT8;
typedef unsigned char   __byte__;
typedef signed char		__int8__;
typedef unsigned short  UINT16;
typedef signed short    __int16__;
typedef unsigned long   UINT32;
typedef signed long     __int32__;
*/



/* Modes defined for the transciever */
#define IDLE_MODE						0x00
#define RX_MODE							0x02
#define TX_MODE 						0x03
#define CCA_MODE						0x01
#define RX_MODE_WTO					0x80
#define HIBERNATE_MODE			0x81
#define DOZE_MODE						0x82
#define IDLE_MODE_DOZE			0x83
#define IDLE_MODE_ATTN			0x84
#define TIMEOUT							0x85
#define SYSTEM_RESET_MODE		0x86	/* Not implemented */
#define MC13192_RESET_MODE	0x87	/* Not implemented */
#define MC13192_CONFIG_MODE	0x88	/* Not implemented */
#define RESET_DELAY					0x89	/* Set to 100ms	*/

#define TRUE  1
#define FALSE 0

#define MAXPACKETSIZE 		126

#define MAX_POWER 100	/* Numbers chosen arbitrarily but > 16 */
#define NOMINAL_POWER 0x0B
#define MIN_POWER 50	/* Numbers chosen arbitrarily but > 16 */

/* Status enumations for the PHY. */
#define SUCCESS 0x77
#define INITIAL_VALUE 0x0
enum pd_data_status {RX_ON = 1, TRX_OFF};
enum mc13192_power_modes {RF_POWER_ON = 1, RF_POWER_HIBERNATE, RF_POWER_DOZE};
enum PLME_set_trx_state_request {ERROR = 1};
#define OVERFLOW 1

/*! defines the variable to be received by the SMAC */
typedef struct {
    UINT8 u8MaxDataLength; //!< maximum packet size to accept If greater packet is dropped 
    UINT8 u8DataLength;		 //!< length in bytes of the received packet 
    UINT8 *pu8Data;				 //!< where the application would like to have the received data copied into 
    UINT8 u8Status;				 //!< determine if the data indication is due to a received packet or a timeout.
} tRxPacket;

/*! variable to be transmitted by the SMAC.*/
typedef struct {
    UINT8 u8DataLength; //!< number of bytes to transmit 
    UINT8 *pu8Data;			//!< pointer to the data buffer to transmit 
} tTxPacket;

/*! CCA measurement storage */
typedef struct {    
    UINT8 u8CCAMode; //!< CCA Mode 
    UINT8 u8InstantValue; //!< Instant mode 
    UINT8 u8FinalValue; //!< Final mode    
} tCCAMeasurement; 


typedef union {	
	UINT16 PhyOptions[2];
   struct {
      /* Header Processing Byte*/
      UINT16 u1PromiscuousMode   :1;
      UINT16 u15Undef1           :15;
      UINT16 u15Undef2;
   } Bits;
   struct {
      UINT16 u8HeaderProcessing;
      UINT16 u16ScanChannels;
   } Byte;      
} tPhyOptions;


#ifndef NULL
    #define NULL    ((void *)0)	 /*!< NULL */
#endif

//#endif

typedef struct{
  UINT8 maxDataLength;
  UINT8 dataLength;
  //UINT8 *data;
  UINT16 *data;
  UINT8 status;
}rx_packet_t;
 
typedef struct
{
	UINT8 dataLength;
	UINT8 *data;

}tx_packet_t;

typedef struct
{	
	UINT8 cca_mode;
	UINT8 instant_value;
	UINT8 final_value;	
} cca_measurement_t;


#ifndef NULL
  #define NULL			((void *)0)
#endif

#endif








⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -