|
#ifndef __AT_CMD_H__
|
#define __AT_CMD_H__
|
|
#include "stdint.h"
|
|
#define MAX_FRAME_LEN 50
|
#define CMD_READ 1
|
#define CMD_WRITE 2
|
#define CMD_REPLY 3
|
#define TAG_NUM_IN_SYS 256
|
#define PWTAG_MAXGROUPNUM 10
|
#define PWTAG_VALUEMAX_NUM 50
|
#define MAX_REGTAGNUM 50
|
#define MAXUSERDATALEN 80
|
#define PWTAG_REMAINTIME 5
|
#define APP_CONFIG_IAPFLAG_MAP 0x0402D010
|
#define APP_CONFIG_IAPFLAG_SECTOR_ADDR 0x0402D000
|
|
|
struct pwtag_structure
|
{
|
uint8_t remain_time[PWTAG_MAXGROUPNUM],index[PWTAG_MAXGROUPNUM],duorxie[PWTAG_MAXGROUPNUM],len[PWTAG_MAXGROUPNUM];
|
uint16_t groupid[PWTAG_MAXGROUPNUM][2],value[PWTAG_MAXGROUPNUM][PWTAG_VALUEMAX_NUM];
|
};
|
extern struct pwtag_structure pwtag;
|
typedef enum{ UsartReceiveWaitHead0,// 55 0d
|
UsartReceiveWaitHead1,//aa 0a
|
UsartReceiveWaitMsgType,//
|
UsartReceiveWaitLength, //
|
UsartReceiveWaitCMD,
|
UsartReceiveWaitIndex,
|
UsartReceiveWaitDataLen,
|
UsartReceiveWaitData,
|
UsartReceiveWaitChecksum//
|
}UsartRecvPackState;
|
extern uint8_t mUsartReceivePack[100];
|
extern uint8_t mUsart2ReceivePack[150];
|
|
void UsartParseDataHandler(uint8_t data);
|
|
void Usart2ParseDataHandler(uint8_t data);
|
|
void UpdateProcess(uint8_t index);
|
#endif
|