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

📄 flashtool.h_tmp

📁 多串口下载手机软件的软件
💻 H_TMP
📖 第 1 页 / 共 2 页
字号:
	unsigned int	ms_read_timeout;
	unsigned int	ms_write_timeout;
}COM_PORT_SETTING;

//------------------------------------------------------------------------------
// DA report structure                                                          
//------------------------------------------------------------------------------
typedef	struct {
	unsigned char	expected_da_major_ver;
	unsigned char	expected_da_minor_ver;
	unsigned char	da_major_ver;
	unsigned char	da_minor_ver;
	DEVICE_INFO		flash_device_id;
	unsigned int	flash_size;
	unsigned int	fat_begin_addr;
	unsigned int	fat_length;
	unsigned int	ext_sram_size;
}DA_REPORT_T;

//------------------------------------------------------------------------------
// prototype of callback function                                               
//------------------------------------------------------------------------------
typedef int (__stdcall *CALLBACK_BEFORE_PROCESS)(const DA_REPORT_T  *p_da_report, void *usr_arg);
typedef int (__stdcall *CALLBACK_SET_HIGHSPEED_BAUDRATE)(unsigned char BaudrateId, unsigned int *p_baudrate, void *usr_arg);
typedef int (__stdcall *CALLBACK_FLASH_DOWNLOAD_INIT)(void *usr_arg);
typedef int (__stdcall *CALLBACK_FLASH_DOWNLOAD)(unsigned char finished_percentage, unsigned int sent_bytes, unsigned int total_bytes, void *usr_arg);
typedef int (__stdcall *CALLBACK_FLASH_FORMAT_INIT)(void *usr_arg);
typedef int (__stdcall *CALLBACK_FLASH_FORMAT)(unsigned char finished_percentage, void *usr_arg);
typedef int (__stdcall *CALLBACK_FLASH_READBACK_INIT)(const char *rb_filepath, void *usr_arg);
typedef int (__stdcall *CALLBACK_FLASH_READBACK)(unsigned char finished_percentage, unsigned int read_bytes, unsigned int total_bytes, void *usr_arg);

//------------------------------------------------------------------------------
// FLASHTOOL_ARG structure                                                      
//------------------------------------------------------------------------------

#define	WAIT_STATE_AUTO_DETECT_BY_FREQUENCY		NULL

typedef	struct {
	
	BBCHIP_TYPE			bbchip;
	EXT_CLOCK			ext_clock;

	unsigned int		*p_bank0_mem_cfg;
	unsigned int		*p_bank1_mem_cfg;

	DA_HANDLE_T			da_handle;

	CALLBACK_BROM_WRITE_BUF_INIT	cb_download_da_init;
	void 	*cb_download_da_init_arg;

	CALLBACK_BROM_WRITE_BUF		cb_download_da;
	void 	*cb_download_da_arg;

	CALLBACK_BEFORE_PROCESS		cb_before_process;
	void 	*cb_before_process_arg;

	CALLBACK_SET_HIGHSPEED_BAUDRATE		cb_set_high_speed_baudrate;
	void 	*cb_set_high_speed_baudrate_arg;
	
	unsigned int		ms_boot_timeout;
	unsigned int		max_start_cmd_retry_count;

	DA_INFO		da_info;

	// [OUT] the PC side bbchip name 
	const char  *p_bbchip_name;

	// This callback function will be invoke after BootROM start cmd is passed. 
	// You can issue other BootROM command by brom_handle and hCOM which provides callback arguments, 
	// or do whatever you want otherwise. 
	CALLBACK_IN_BROM_STAGE		cb_in_brom_stage;
	void	*cb_in_brom_stage_arg;

	unsigned char	m_baudrate_full_sync_count;

	// speed-up BootROM stage baudrate 
	_BOOL	m_speedup_brom_baudrate;

}FLASHTOOL_ARG;

//------------------------------------------------------------------------------
// flash download                                                               
//------------------------------------------------------------------------------

typedef enum {
	FORMAT_FAT_AUTO = 0,		// automatically format the FAT area on flash 
	FORMAT_FAT_MANUAL			// format according to the format begin_addr and length 
} FORMAT_FAT_OPTION;

typedef	struct {

	FORMAT_FAT_OPTION	option;

	// begin_addr and length only take effect when option is FORMAT_MANUAL 
	unsigned int		fat_begin_addr;
	unsigned int		fat_length;

} FORMAT_FAT_CONFIG_T;

typedef	struct {
	
	DL_HANDLE_T		dl_handle;

	CALLBACK_FLASH_DOWNLOAD_INIT	cb_download_flash_init;
	void	*cb_download_flash_init_arg;

	ACCURACY	download_accuracy;
	CALLBACK_FLASH_DOWNLOAD		cb_download_flash;
	void	*cb_download_flash_arg;

	CALLBACK_FLASH_FORMAT_INIT	cb_format_report_init;
	void	*cb_format_report_init_arg;

	CALLBACK_FLASH_FORMAT	cb_format_report;
	void	*cb_format_report_arg;

	ROM_INFO		rom_info;
	
	// The flag of enable_tgt_res_layout_check is used to control whether if target resource 
	// layout checking operation will be performed.                                          
	// _TRUE: Enable target resource layout checking operation.                         
	// _FALSE: Disable target resource layout checking operation.                       
	_BOOL			enable_tgt_res_layout_check;

	// This array is used to store the index of DL_HANDLE if and only if you got the 
	// (FT_DL_HANDLE_ERROR|FTHND_RES_DOWNLOAD_SELECT_INCOMPLETE) error code.         
	// In order to maintain target side resource and jump table integrity, each index points 
	// to a resource which is required to download but you DID NOT select it. 
	unsigned short	required_resource_count;
	unsigned short	required_resource[MAX_RESOURCE_ENTRY];

	// The flag to check if target side baseband chip ECO version is corresponding to ROM file on PC side. 
	_BOOL			enable_bbchip_eco_check;

	// format option 
	_BOOL					enable_fat_format;
	FORMAT_FAT_CONFIG_T		fmt_fat;

	// trigger watch dog timeout after downloading 
	_BOOL					enable_wdt_timeout;
	unsigned short			ms_wdt_timeout_interval;

}FLASHTOOL_DOWNLOAD_ARG;

extern int __stdcall FlashDownload(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_DOWNLOAD_ARG	*p_dl_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall FlashDownload_ByhCOM(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_DOWNLOAD_ARG	*p_dl_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall AutoBoot_FlashDownload(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_DOWNLOAD_ARG	*p_dl_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall AutoBoot_FlashDownload_ByhCOM(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_DOWNLOAD_ARG	*p_dl_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

//------------------------------------------------------------------------------
// flash readback                                                               
//------------------------------------------------------------------------------

typedef	struct {
	
	RB_HANDLE_T		rb_handle;

	CALLBACK_FLASH_READBACK_INIT	cb_readback_flash_init;
	void	*cb_readback_flash_init_arg;

	ACCURACY	readback_accuracy;
	CALLBACK_FLASH_READBACK		cb_readback_flash;
	void	*cb_readback_flash_arg;

	RB_INFO		rb_info;
	
}FLASHTOOL_READBACK_ARG;

extern int __stdcall FlashReadback(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_READBACK_ARG	*p_rb_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall FlashReadback_ByhCOM(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_READBACK_ARG	*p_rb_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall AutoBoot_FlashReadback(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_READBACK_ARG	*p_rb_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall AutoBoot_FlashReadback_ByhCOM(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_READBACK_ARG	*p_rb_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

//------------------------------------------------------------------------------
// flash format                                                                 
//------------------------------------------------------------------------------

typedef	struct {
	
	unsigned int	format_addr;
	unsigned int	format_length;

	CALLBACK_FLASH_FORMAT_INIT	cb_format_report_init;
	void	*cb_format_report_init_arg;

	CALLBACK_FLASH_FORMAT	cb_format_report;
	void	*cb_format_report_arg;
	
}FLASHTOOL_FORMAT_ARG;

extern int __stdcall FlashFormat(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_FORMAT_ARG	*p_fmt_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall FlashFormat_ByhCOM(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_FORMAT_ARG	*p_fmt_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall AutoBoot_FlashFormat(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_FORMAT_ARG	*p_fmt_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

extern int __stdcall AutoBoot_FlashFormat_ByhCOM(
		COM_PORT_SETTING	*p_com_setting,
		FLASHTOOL_ARG	*p_arg,
		FLASHTOOL_FORMAT_ARG	*p_fmt_arg,
		int *p_stopflag,
		DA_REPORT_T  *p_da_report);

#ifdef	__cplusplus
}
#endif

#endif


⌨️ 快捷键说明

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