|
|
#ifndef __UART_VCOM_H__
|
|
|
#define __UART_VCOM_H__
|
|
|
|
|
|
#include "sys.h"
|
|
|
#include "LT768.h"
|
|
|
#include "common.h"
|
|
|
#include "flash.h"
|
|
|
#include "usb_reg.h"
|
|
|
#include "reset_drv.h"
|
|
|
#include "ioctrl_drv.h"
|
|
|
#include "pit32_drv.h"
|
|
|
#include "eflash_drv.h"
|
|
|
#include "iomacros.h"
|
|
|
#include "LT768_Lib.h"
|
|
|
#include "Updata.h"
|
|
|
#include "CRC.h"
|
|
|
#include "Flash.h"
|
|
|
|
|
|
//#define Uart_Update 1 //Uart升级功能 1:打开 0:关闭(在二次开发阶段调试APP程序的时候建议可以先关闭此功能)
|
|
|
#define Display_Progress 1 //升级界面显示 1:打开 0:关闭
|
|
|
|
|
|
|
|
|
#define DATA_FIELDS_BEGIN_ADDR 0x08008000 //0x08008000 0x08014000
|
|
|
//#define DTAT_FIELDS_PAGE_NUM 0x100
|
|
|
|
|
|
#define CMD_SET_SWD 0x49
|
|
|
#define CMD_CONNECT_VCOM 0x4B
|
|
|
#define CMD_UPDATE_FLASH 0x4A
|
|
|
#define CMD_UPDATE_SDRAM 0x4D
|
|
|
#define CMD_ERASE_FLASH 0x4C
|
|
|
#define CMD_CRC_FLASH 0x4E
|
|
|
#define CMD_RESET 0x4F
|
|
|
#define CMD_ERROR_PACKET 0x44
|
|
|
#define CMD_GET_INFO 0x47
|
|
|
#define CMD_WR_MCU_PAGE 0x48
|
|
|
|
|
|
#define Run_Boot_ID (*(volatile UINT32 *)(0x20000000+0x37000)) //APP_Update_ID0: 0x32021688
|
|
|
|
|
|
extern UINT8 baud_index;
|
|
|
extern vcom_rep vcom_rp[];
|
|
|
extern UINT16 uart_rx_number;
|
|
|
extern UINT16 uart_rx_endIndex;
|
|
|
extern UINT8 uart_buf[4096+512];
|
|
|
extern UINT8 uart_act_index;
|
|
|
|
|
|
extern const UINT32 bdRate[];
|
|
|
|
|
|
extern UINT8 Flag_Loop;
|
|
|
extern UINT8 count_Loop;
|
|
|
extern UINT8 FLag_Pos;
|
|
|
|
|
|
//typedef void (*iapfun)(void); //定义一个函数类型的参数.
|
|
|
//extern iapfun jump2app;
|
|
|
|
|
|
|
|
|
void PIT1_Init_Uart(void);
|
|
|
void PIT2_Loop(void);
|
|
|
void Uart_Init(UINT32 pclk,UINT32 bound);
|
|
|
void LT_SingleByteToPc(UINT8 val);
|
|
|
void uart_send(UINT8 *pCH,UINT32 len);
|
|
|
|
|
|
|
|
|
void do_all_uart(void);
|
|
|
|
|
|
#endif
|