📄 flashtool.h
字号:
typedef struct {
// DA report
DA_REPORT_T m_da_report;
DA_INFO m_da_info;
AUTH_INFO m_auth_info;
}FLASHTOOL_RESULT;
//------------------------------------------------------------------------------
// PARAMETER structure
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// utility functions
//------------------------------------------------------------------------------
extern const char * __stdcall GetNorFlashNameByTypeId(unsigned short type_id);
extern const char * __stdcall GetNandFlashNameByTypeId(unsigned short type_id);
extern const char * __stdcall HWChipSelectToString(HW_ChipSelect_E cs);
extern const char * __stdcall HWStorageTypeToString(HW_StorageType_E type);
extern const char * __stdcall HWRamTypeToString(HW_RAMType_E type);
extern const char * __stdcall ReadFlagToString(NUTL_ReadFlag_E flag);
extern const char * __stdcall EraseFlagToString(NUTL_EraseFlag_E flag);
extern const char * __stdcall ParamOpToString(PARAM_OPERATION op);
extern const char * __stdcall OTPOpToString(OTP_OPERATION op);
//------------------------------------------------------------------------------
// flash download
//------------------------------------------------------------------------------
typedef struct {
// single DL_HANDLE
DL_HANDLE_T m_dl_handle;
// multi DL_HANDLE List
DL_HANDLE_LIST_T m_dl_handle_list;
// DL_HANDLE download progress callback
ACCURACY m_download_accuracy;
CALLBACK_DOWNLOAD_PROGRESS_INIT m_cb_download_flash_init;
void * m_cb_download_flash_init_arg;
CALLBACK_DOWNLOAD_PROGRESS m_cb_download_flash;
void * m_cb_download_flash_arg;
// Boot Loader download progress callback
CALLBACK_BOOTLOADER_DOWNLOAD_PROGRESS_INIT m_cb_download_bloader_init;
void * m_cb_download_bloader_init_arg;
CALLBACK_BOOTLOADER_DOWNLOAD_PROGRESS m_cb_download_bloader;
void * m_cb_download_bloader_arg;
// security post-process notify callback
CALLBACK_SECURITY_POST_PROCESS_NOTIFY m_cb_security_post_process_notify;
void * m_cb_security_post_process_notify_arg;
// write FlashToolCfg/CUST_PARA/SEC_RO/OTP parameters
// FlashToolCfg
_BOOL m_ft_cfg_enable;
FlashToolCfg_T m_ft_cfg;
// CUST_PARA
_BOOL m_cust_para_enable;
CustPara_T m_cust_para;
// SEC_RO
_BOOL m_sec_ro_enable;
SecRO_T m_sec_ro;
// OTP
_BOOL m_otp_enable;
OTP_OPERATION m_otp_op;
OTP_T m_otp;
CALLBACK_PARAM_PROGRESS_INIT m_cb_param_process_init;
void * m_cb_param_process_init_arg;
CALLBACK_PARAM_PROGRESS m_cb_param_process;
void * m_cb_param_process_arg;
// format option
_BOOL m_format_enable;
FORMAT_CONFIG_T m_format_cfg;
// format progress callback
CALLBACK_FORMAT_PROGRESS_INIT m_cb_format_report_init;
void * m_cb_format_report_init_arg;
CALLBACK_FORMAT_PROGRESS m_cb_format_report;
void * m_cb_format_report_arg;
// format statistics callback
CALLBACK_FORMAT_STATISTICS m_cb_format_statistics;
void * m_cb_format_statistics_arg;
// post-process callback
CALLBACK_POST_PROCESS_INIT m_cb_post_process_init;
void * m_cb_post_process_init_arg;
CALLBACK_POST_PROCESS m_cb_post_process;
void * m_cb_post_process_arg;
// The flag of m_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 m_enable_tgt_res_layout_check;
// The flag to check if target side baseband chip version is corresponding to ROM file on PC side.
_BOOL m_enable_bbchip_ver_check;
// trigger watch dog timeout after downloading
_BOOL m_enable_wdt_timeout;
unsigned short m_ms_wdt_timeout_interval;
}FLASHTOOL_DOWNLOAD_ARG;
typedef struct {
FormatStatisticsReport_T m_format_statistics;
// NFB boot loader info
BL_INFO m_bl_info;
ROM_INFO m_rom_info;
}FLASHTOOL_DOWNLOAD_RESULT;
extern int __stdcall FlashDownload(
COM_PORT_SETTING *p_com_setting,
const FLASHTOOL_ARG *p_arg,
FLASHTOOL_RESULT *p_result,
const FLASHTOOL_DOWNLOAD_ARG *p_dl_arg,
FLASHTOOL_DOWNLOAD_RESULT *p_dl_result,
int *p_stopflag);
extern int __stdcall FlashDownload_ByhCOM(
COM_PORT_SETTING *p_com_setting,
const FLASHTOOL_ARG *p_arg,
FLASHTOOL_RESULT *p_result,
const FLASHTOOL_DOWNLOAD_ARG *p_dl_arg,
FLASHTOOL_DOWNLOAD_RESULT *p_dl_result,
int *p_stopflag);
//------------------------------------------------------------------------------
// flash readback
//------------------------------------------------------------------------------
typedef struct {
HW_StorageType_E m_storage_type;
RB_HANDLE_T m_rb_handle;
// readback progress callback
ACCURACY m_readback_accuracy;
CALLBACK_READBACK_PROGRESS_INIT m_cb_readback_flash_init;
void * m_cb_readback_flash_init_arg;
CALLBACK_READBACK_PROGRESS m_cb_readback_flash;
void * m_cb_readback_flash_arg;
}FLASHTOOL_READBACK_ARG;
typedef struct {
RB_INFO m_rb_info;
}FLASHTOOL_READBACK_RESULT;
extern int __stdcall FlashReadback(
COM_PORT_SETTING *p_com_setting,
const FLASHTOOL_ARG *p_arg,
FLASHTOOL_RESULT *p_result,
const FLASHTOOL_READBACK_ARG *p_rb_arg,
FLASHTOOL_READBACK_RESULT *p_rb_result,
int *p_stopflag);
extern int __stdcall FlashReadback_ByhCOM(
COM_PORT_SETTING *p_com_setting,
const FLASHTOOL_ARG *p_arg,
FLASHTOOL_RESULT *p_result,
const FLASHTOOL_READBACK_ARG *p_rb_arg,
FLASHTOOL_READBACK_RESULT *p_rb_result,
int *p_stopflag);
//------------------------------------------------------------------------------
// flash format
//------------------------------------------------------------------------------
typedef struct {
HW_StorageType_E m_storage_type;
// format config
FORMAT_CONFIG_T m_format_cfg;
// only take effect on NAND flash
NUTL_EraseFlag_E m_erase_flag;
// format progress callback
CALLBACK_FORMAT_PROGRESS_INIT m_cb_format_report_init;
void * m_cb_format_report_init_arg;
CALLBACK_FORMAT_PROGRESS m_cb_format_report;
void * m_cb_format_report_arg;
// format statistics callback
CALLBACK_FORMAT_STATISTICS m_cb_format_statistics;
void * m_cb_format_statistics_arg;
}FLASHTOOL_FORMAT_ARG;
typedef struct {
FormatStatisticsReport_T m_format_statistics;
}FLASHTOOL_FORMAT_RESULT;
extern int __stdcall FlashFormat(
COM_PORT_SETTING *p_com_setting,
const FLASHTOOL_ARG *p_arg,
FLASHTOOL_RESULT *p_result,
const FLASHTOOL_FORMAT_ARG *p_fmt_arg,
FLASHTOOL_FORMAT_RESULT *p_fmt_result,
int *p_stopflag);
extern int __stdcall FlashFormat_ByhCOM(
COM_PORT_SETTING *p_com_setting,
const FLASHTOOL_ARG *p_arg,
FLASHTOOL_RESULT *p_result,
const FLASHTOOL_FORMAT_ARG *p_fmt_arg,
FLASHTOOL_FORMAT_RESULT *p_fmt_result,
int *p_stopflag);
//------------------------------------------------------------------------------
// flash parameter
//------------------------------------------------------------------------------
typedef struct {
// FlashToolCfg
_BOOL m_ft_cfg_enable;
PARAM_OPERATION m_ft_cfg_op;
FlashToolCfg_T m_ft_cfg;
// CUST_PARA
_BOOL m_cust_para_enable;
PARAM_OPERATION m_cust_para_op;
CustPara_T m_cust_para;
// SEC_RO
_BOOL m_sec_ro_enable;
PARAM_OPERATION m_sec_ro_op;
SecRO_T m_sec_ro;
// OTP
_BOOL m_otp_enable;
OTP_OPERATION m_otp_op;
OTP_T m_otp;
} PARAMETER_ARG;
typedef struct {
// parameters
PARAMETER_ARG m_param;
// update parameter progress callback
CALLBACK_PARAM_PROGRESS_INIT m_cb_param_process_init;
void * m_cb_param_process_init_arg;
CALLBACK_PARAM_PROGRESS m_cb_param_process;
void * m_cb_param_process_arg;
}FLASHTOOL_PARAMETER_ARG;
typedef struct {
// dummy
}FLASHTOOL_PARAMETER_RESULT;
extern int __stdcall FlashParameter(
COM_PORT_SETTING *p_com_setting,
const FLASHTOOL_ARG *p_arg,
FLASHTOOL_RESULT *p_result,
const FLASHTOOL_PARAMETER_ARG *p_pm_arg,
FLASHTOOL_PARAMETER_RESULT *p_pm_result,
int *p_stopflag);
extern int __stdcall FlashParameter_ByhCOM(
COM_PORT_SETTING *p_com_setting,
const FLASHTOOL_ARG *p_arg,
FLASHTOOL_RESULT *p_result,
const FLASHTOOL_PARAMETER_ARG *p_pm_arg,
FLASHTOOL_PARAMETER_RESULT *p_pm_result,
int *p_stopflag);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -