#ifndef _DOWN_H #define _DOWN_H #include "equ.h" #define SPI_BOOT_ADDR 0x300000 // SPI flash中boot程序的起始地址 #define DOWN_COMMNO 0 #define DOWN_COMMBAUD 57600 #define ErsFSH 0xc0//擦除flash #define WrtDt 0xc1//write date #define RdDt 0xc2 //read date #define NAKCODE 0xc3 #define RunPrg 0xc4 //run program #define ReadInf 0xd0 #define StartDOWN 0xd1 #define WAVEINF 0xd4 // 录波信息 #define EupInf 0x00 //设备信息 #define SUMERR 0xe3 #define CMDINVALID 0xe0 #define NAKLTH 0x04 #define OK 0x00 #define UNOK 0x01//未执行/操作被拒绝 #define OPFail 0x03//操作失败 #define VIRLCD_E0 0xE0 #define VIRLCD_E1 0xE1 #define VIRLCD_E2 0xE2 #define VIRLCD_F0 0xF0 #define VIRLCD_F1 0xF1 #define VIRLCD_C3 0xC3 #define UART_FRAME_LEN 256 //extern BYTE g_arrLcdByte[] ;//虚拟LCD液晶屏内容.128*64可打印16*4=64个字节,最多需要64*3的空间存放。显示1byte占3单元,每个单元包含{x地址与反显,y地址,byte字符} typedef struct DOWN_PARA { WORD wMode; // 下载方式;串口、以太网、CAN等。 WORD wBaud; // 波特率 BYTE byNo; // 串口编号 BYTE byParity; BYTE byIP[12]; // IP Gate Mask char resver[14]; }DOWN_PARA; struct program_head { u16 can_bus; }; struct program_comm { u8 status; u8 comm; struct program_head head[EQU_SLOT_NUM_MAX]; u8 slot; //板卡 s8 *file_name; u32 num; //程序长度 u16 crc16; //程序校验 u8 *probuf; //程序内容 u16 frameno; //当前帧号 u16 framenum; //程序总帧数 struct timespec update_time; u32 bit_prog; u32 bit_echo; u32 us_recv; }; //虚拟LCD液晶屏内容.128*64可打印16*4=64个字节,最多需要64*3的空间存放。显示1byte占3单元,每个单元包含{x地址与反显,y地址,byte字符} void DebugRecv(BYTE cRcvData) ; void DebugTask(void); void GetDownPara(DOWN_PARA *pt); void print_mem_net(char *addr,unsigned char *pd,int lenth); int init_file_program(u8 slot, s32 index); extern int prog_recv_timeout(void); extern int prog_recv(u8 *buf); extern int prog_send (void); int down_exit(void); #ifdef METERING_ENERGY u8 is_prog_down(void); #endif #endif