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

📄 protocol.h~

📁 使用avr--cc2420模块程序,需要原理图的联系 QQ:120304948
💻 H~
字号:
#ifndef __PROTOCOL_H__
#define __PROTOCOL_H__


#define PROTOCOL_BUFFER_LENGTH 64

extern eeprom unsigned char MobilePhone1[12];
extern eeprom unsigned char MobilePhone2[12];
extern eeprom unsigned char MobilePhone3[12];
extern eeprom unsigned int MY_ID;
extern unsigned int Protocol_pointer_last;
extern unsigned int Protocol_pointer_current;

extern bit bMobilePhone;
extern bit bAlarmValue;
extern bit bAlarmData;


typedef eeprom struct 
{
/* date and time */
    unsigned char nYear;
    unsigned char nMonth;
    unsigned char nDay;
    
    unsigned char nHour;
    unsigned char nMinute;
    unsigned char nSecond;
    
    float fPatrol10m;  /* 10分钟 */
    float fPatrol1h;   /* 1 小时*/
    float fPatrol1d;   /* 日 */
    float fPatrolCon;  /* 连续 */
    
    float fRisk10m;  /* 10 分钟 */
    float fRisk1h;  /* 1 小时 */
    float fRisk1d;  /* 日 */
    float fRiskCon; /* 连续 */
    
	unsigned int nBeginTime;	/* 日起点 */

    float fUploadThres; /* 上传门槛 */
    float fStep;        /* 递增值 */
    unsigned int nLasting;     /* 持续时间 */

} OMBROSETTING;


extern eeprom OMBROSETTING my_ombset;

void SetThreshold();
void ReadThreshold();
void SetMobile();
void SetClock();
void ReadHistoryData();
void ConfirmMobilePhone();
void ConfirmAlarmValue();
void ConfirmAlarmData();
void uploadMobile();
void uploadAlarmValue();
void uploadRealtimeData();
void uploadAlarmData(unsigned char value);


/* hex to bcd */
unsigned char hex2bcd(unsigned char hdata);
/* bcd to hex */
unsigned int bcd2hex(BYTE bdata);

void initial_protocol(void);
void ProtocolProc(void);
void SerialPortWrite(BYTE *pBuf, int nLength);



#endif

⌨️ 快捷键说明

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