brom.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:23k
- /*******************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2003
- *
- ******************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * brom.h
- *
- * Project:
- * --------
- * BootRom Library
- *
- * Description:
- * ------------
- * Exported C interface APIs for BootRom library.
- *
- * Author:
- * -------
- * Amos Hsu (mtk00539)
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision: 1.21 $
- * $Modtime: Dec 06 2005 15:05:36 $
- * $Log: //mtkvs01/vmdata/flash_tool/archives/BootRom/brom.h-arc $
- *
- * Jan 31 2008 mtk01413
- * [STP100001630] [FlashTool] v3.0804.0 release
- * New features:
- * 1. USB Download for End User
- * Enhancements:
- * 1. [DA] Download Optimization with 921k on MT6225/MT6229/MT6230/MT6235/MT6238
- * 2. [DA] Provide two download methodology : Best Effort Erase (default) and Sequential Erase
- * 3. [DA] New CheckID algorithm for all SPANSION MCP series
- *
- * Dec 3 2007 mtk01413
- * [STP100001568] [FlashTool] v3.0748.0 release
- * New features:
- * 1. USB Download on MT6225/MT6226/MT6227 Series BB
- * 2. GPS Download
- * 3. MT6238, MT6235, TK6516 AP/MD DVT
- *
- * Aug 30 2007 mtk01413
- * [STP100001497] [FlashTool] v3.2.0 release
- *
- *
- * Jan 2 2007 mtk01413
- * [STP100001195] FlashTool v3.1.02 release
- * New features:
- * 1. [BROM_DLL/DA] Support MT6223 download.
- * 2. [BROM_DLL/DA] Support MT6268T download.
- *
- * Sep 27 2006 mtk00539
- * [STP100001145] FlashTool v3.1.01 release
- *
- *
- * Aug 16 2006 mtk00539
- * [STP100001057] FlashTool v3.1.00 release
- * Add GetBromDLLInfo().
- *
- * Aug 14 2006 mtk00539
- * [STP100001057] FlashTool v3.1.00 release
- *
- *
- * Jul 21 2006 mtk01413
- * [STP100001021] FlashTool v2.9.1002 release
- * 1. [BROM_DLL] Fix DA download error on MT6205/MT6205B.
- *
- * Rev 1.21 Dec 29 2005 10:42:02 mtk00539
- * 1. [BROM_DLL] Support new baseband chip MT6226M.
- * Resolution for 156: [FlashTool v2.7.1013][BUG FIX] Fix BootROM start command failure while manually selecting NMT6226 or MT6227 baseband chip.
- *
- * Rev 1.20 Sep 13 2005 13:21:58 mtk00539
- * 1. [BROM_DLL][Enhance] Workaround the 1st time power up failure issue when RTC is empty.
- * 2. [BROM_DLL][Enhance] Padding download bin file length to EVEN number.
- * 3. [BROM_DLL][New] New baseband chip support, MT6226, MT6227(0x8A01), MT6228(0x8A01).
- * Resolution for 130: [BROM_DLL v2.4.1016][Enhance] Workaround the 1st time power up failure issue when RTC is empty.
- *
- * Rev 1.19 Jul 24 2005 21:37:50 mtk00539
- * 1. Support MT6228 NFB META mode.
- * Resolution for 121: [BROM_DLL v2.4.1014][New] Support MT6227 and MT6228 NFB META mode.
- *
- * Rev 1.18 May 24 2005 19:54:20 mtk00539
- * 1. [BROM_DLL][New] Add DA_cmd::CMD_EnableWatchDog() to enable watchdog after download process.
- * 2. [BROM_DLL][New] Add DL_ResourceProjectIdComparisonSetting() API to enable/disable resource project id comparison.
- * 3. [BROM_DLL][New] Add callback function in Boot_META() series API to do extra process after BootROM start command passed.
- * 4. [BROM_DLL][BUG FIX] Fix com port error after using HyperTerminal.
- * 5. [BROM_DLL][BUG FIX] Fix m_boot_timeout takes no effect in BRom_AutoBoot::BRom_StartCmd().
- * 6. [BROM_DLL][Change Behavior] Stop download process while CALLBACK_BEFORE_PROCESS return non-zero value.
- * 7. [BROM_DLL][Change Behavior] Skip resource table size and content size checking for CustPack project.
- * Resolution for 115: [BROM_DLL v2.4.1012][New] Support new flash devices and bug fix.
- *
- * Rev 1.17 Nov 22 2004 14:27:54 mtk00539
- * 1. [BROM_DLL][BUG FIX] Add baudrate sync procedure for BootROM stage baudrate change for Prolific convertor.
- * 2. [BROM_DLL][BUG FIX] Fix ReadData() delay time too long problem in DA_cmd::CMD_ChangeUartSpeed() while target is running at 13MHz.
- * 3. [BROM_DLL][BUG FIX] DO NOT use while loop in reading BootROM ack in BRom_AutoBoot::BRom_StartCmd(), it will cause BootROM timeout.
- * 4. [BROM_DLL][Enhance] Extend the read timeout waiting time in DA_cmd::CMD_WriteData, because SHARP flash program time is slow.
- * 5. [BROM_DLL][Enhance] Add m_speedup_brom_baudrate flag to enable/disable speed-up baudrate in BootROM stage.
- * Resolution for 99: [BROM_DLL v2.4.1008][New] Support INTEL family flash Buffered-Program method.
- *
- * Rev 1.16 Nov 05 2004 10:35:08 mtk00539
- * 1. [BROM_DLL][New] Implement S/W compatible mechanism for MT6218B_FN and MT6218B_GN.
- * 2. [BROM_DLL][Enhance] Read property to check if it was RS232 or Modem from COM1 to COM3.
- * 3. [BROM_DLL][Change Behavior] Unknown bbchip won't allow to download once check ECO version flag is enabled.
- * Resolution for 96: [BROM_DLL v2.4.1007][New] Implement S/W compatible mechanism for MT6218B_FN and MT6218B_GN.
- *
- * Rev 1.15 Oct 29 2004 11:42:58 mtk00539
- * 1. [BROM_DLL][New] Implement auto bbchip and ext_clock detection mechanism.
- * 2. [BROM_DLL][New] Increase BootROM baudrate as twice times by setup UART_HIGHSPEED_RATE_STEP register.
- * 3. [BROM_DLL][New] Add new bbchip MT6205_EN and MT6218B_GN.
- * 4. [BROM_DLL][Enhance] Increase MT6217 and MT6219 EMI driving strength.
- * Resolution for 92: [BROM_DLL v2.4.1006][BUG FIX] Fix AM49DL3208GT & S71PL032J download fail problem and some enhancement.
- *
- * Rev 1.14 Jul 19 2004 01:56:36 mtk00539
- * 1. [BROM_DLL][BUG FIX] When bbchip_type is inconsistent with rom bbchip info, do not use rom bbchip info to compare with target bbchip id.
- * 2. [BROM_DLL][BUG FIX] Fix baudrate 921600 download fail under 13MHz external clock.
- * 1. Add Sleep(0) to force context switch to flush UART TX data in BRom_Base::WriteData() and DA_cmd::WriteData().
- * 2. After target side baudrate changed command was issued, add Sleep() to delay sending SYNC_CHAR.
- * This will prevent the interference of target side UART state machine during target side baudrate changed.
- * 3. Purge PC side and target side UART TX & RX FIFO after baudrate changed.
- * 4. Use while(1) loop to avoid flash readback checksum timeout.
- * 5. Add baudrate full char sync mechanism to test if baudrate is stable.
- * 3. [BROM_DLL][CHANGE] Change GetJumpTableInfoFromBuf() to fit JumpTable definition changed in Maui.SW system.
- * 4. [BROM_DLL][Enhance] Remove unnecessary functions MT6205_MEM_config and MT6205B_MEM_config.
- * 5. [BROM_DLL][Enhance] Add MT6218B and MT6219 EMI general control register setting in BootROM stage.
- * 6. [BROM_DLL][Enhance] Change EMI setting to 32 bits.
- * Resolution for 81: [BROM_DLL v2.4.1001] Support Intel flash and fix many bugs.
- *
- * Rev 1.13 May 26 2004 21:23:58 mtk00539
- * [New] Add callback function in BootROM stage. So that users could have chance to issue other BootROM command after start cmd is passed, or do whatever they want otherwise.
- * Resolution for 73: [BROM_DLL v2.3.1005][New] Add callback function in BootROM stage.
- *
- * Rev 1.12 May 21 2004 15:44:38 mtk00539
- * 1. [brom.dll][New] add J2ME_ROM resource for w04.21 load.
- * 2. [brom.dll][New] add MT6217 BootROM.
- * 3. [brom.dll][New] add Brom_DownloadData API.
- * 4. [brom.dll][New] remove Brom_Verify relative APIs.
- * 5. [brom.dll][Enhance] move region overlap checking from Rom_Load() to IsReady() for more convenience.
- * Resolution for 70: [BROM_DLL v2.3.1003][New] add J2ME_ROM resource for w04.21 load.
- *
- * Rev 1.11 May 17 2004 12:55:20 mtk00539
- * [New] keep old interfaces of Boot_META, Boot_FlashTool & Brom_Verify
- * Resolution for 69: [BootRom v2.3.1002][BUG FIX] fix RB_HANDLE deadlock.
- *
- * Rev 1.10 May 14 2004 17:01:26 mtk00539
- * 1. [brom.dll][BUG FIX] fix DA_cmd::CMD_WriteData() buffer overrun problem.
- * 2. [brom.dll][BUG FIX] remove DA_HANDLE & DL_HANDLE rwlock_writer_sentry for multi-thread download.
- * 3. [brom.dll][BUG FIX] fix download address remap problem for Multi-Bin download on MT6218B series projects.
- * 4. [brom.dll][Enhance] for the unknown bbchip_name just bypass ECO checking, don't stop process.
- * 5. [brom.dll][New] add FAT auto format mechanism, parse the embedded FAT range info from the end of the ROM file.
- * 6. [brom.dll][New] add DA auto selection mechanism, parse the embedded custom_bane info from the end of the DA file.
- * 7. [brom.dll][New] add _ByhCOM interface to let users to control com port handle.
- * 8. [brom.dll][New] add BootROM start command retry mechanism to prevent cable TX/RX cross over.
- * 9. [brom.dll][New] add MT6219_AV, MT6219_BV and MT6218B_FN support.
- * 10. [DA][New] add DA auto selection mechanism, append custom_name at the end of DA.
- * 11. [DA][New] add FAT auto format mechanism, report flash manufacture id and device code to PC side.
- * Resolution for 67: [BootRom v2.3.1001][New] add FAT auto format, DA auto selection mechanism and bug fix.
- *
- * Rev 1.9 Mar 18 2004 23:06:40 mtk00539
- * 1. [brom.dll][Enhance] only bbchip after MT6218B has to check firmware version.
- * 2. [brom.dll][BUG FIX] change func() to func(void) to fix header file compatibility for LabView.
- * 3. [brom.dll][BUG FIX] CompareTargetBBChipHWID() should return error and skip comparison when target doesn't respond.
- * Resolution for 61: [BootRom v2.2.1012][BUG FIX] fix CompareTargetBBChipHWID() error.
- *
- * Rev 1.8 Mar 09 2004 21:00:50 mtk00539
- * [Enhance] check BBChip H/W version in Boot_META and Boot_FlashTool.
- * Resolution for 57: [BootRom v2.2.1010][Enhance] check BBChip H/W version in Boot_META and Boot_FlashTool.
- *
- * Rev 1.7 Mar 02 2004 00:19:04 mtk00539
- * 1. [brom.dll][Enhance] add resource and jump table consistency detection.
- * 2. [brom.dll][Enhance] read back target's jump table layout and compare before download.
- * 3. [brom.dll][Enhance] automatically load all the resource files.
- * 4. [brom.dll][Enhance] add target bbchip id detection.
- * 5. [brom.dll][Enhance] add ini module.
- * 6. [brom.dll][Enhance] add MT6219 support.
- * Resolution for 53: [BootRom v2.2.1007][Enhance] resource layout error detection.
- *
- * Rev 1.6 Sep 25 2003 13:57:52 mtk00539
- * brom.dll v2.1.1001, please see SCR(28) for more details.
- * Resolution for 28: [BootRom v2.1.1001][New] See the reasons below.
- *
- * Rev 1.5 Jul 25 2003 15:50:28 mtk00539
- * Reason:
- * 1. SA reports read(10sec)/write(3sec) timeouts are too long. Because DA_cmd::WriteData() and DA_cmd::ReadData() will re-try one time, so the actual timeouts are read(10x2sec)/write(3x2sec). So I decide to reduce timeouts to read(5sec)/write(1.5sec).
- *
- * 2. Add specific debug log at the end of FlashDownload(), FlashReadback() and FlashFormat(). In this way SA can query whether if the function successfully executed by this signature.
- *
- * 3. Export debug log clear function, let users clear debug log whenever they want.
- * Resolution for 17: [BootRom v2.0.1006][Add Features] shorten read/write timeout and export debug log clear function.
- *
- * Rev 1.4 Jun 30 2003 19:24:50 mtk00539
- * 1. [brom.dll][Add Features] Split flashtool function into brom.dll
- * 2. [brom.dll][Add Features] Add a fake MT6208 bootrom for FlashTool for Pluto version.
- * 3. [DA][Add Features] Check format range.
- * 4. [DA][Add Features] Report format percentage.
- * 5. [DA][Add Features] Support 6208 EVB/CEVB for double flash devices access.
- * 6. [DA][BUG FIXED] Fix DA pre-format sector bug, it shouldn't format beyond the max size of flash.
- * 7. [DA][BUG FIXED] Fix DA FlashTool MEM_CMD end_addr bug, FlashTool should use (begin_addr+length-1) as end_addr.
- * 8. [DA][BUG FIXED] Fix DA AM29DL640D, MB84VD23280FA and TC58FVB64 flash table error.
- * Resolution for 12: [BootRom v2.2.1001][New Version] Split flashtool function into brom.dll
- *
- * Rev 1.2 May 22 2003 17:27:48 mtk00539
- * add bootstop flag
- * Resolution for 6: [FlashTool v2.2][AddFeature] Support 6205/6205B at 13MHz, 26MHz and 52MHz.
- *
- * Rev 1.1 May 20 2003 18:05:46 mtk00539
- * add copyright
- * Resolution for 6: [FlashTool v2.2][AddFeature] Support 6205/6205B at 13MHz, 26MHz and 52MHz.
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- #ifndef _BROM_H_
- #define _BROM_H_
- #include <windows.h>
- #include "flashtool_handle.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- // The magic value to stop boot process
- #define BOOT_STOP 9876
- // boot infinitely
- #define BOOT_INFINITE 0xFFFFFFF
- // default start cmd retry count
- #define DEFAULT_BROM_START_CMD_RETRY_COUNT 1
- //------------------------------------------------------------------------------
- // prototype of COM initial stage callback
- //------------------------------------------------------------------------------
- typedef int (__stdcall *CALLBACK_COM_INIT_STAGE)(HANDLE hCOM, void *usr_arg);
- //------------------------------------------------------------------------------
- // prototype of BootROM stage callback
- //------------------------------------------------------------------------------
- typedef int (__stdcall *CALLBACK_IN_BROM_STAGE)(unsigned int brom_handle, HANDLE hCOM, void *usr_arg);
- //------------------------------------------------------------------------------
- // prototype of write buf progress callback
- //------------------------------------------------------------------------------
- typedef int (__stdcall *CALLBACK_WRITE_BUF_PROGRESS_INIT)(void *usr_arg);
- typedef int (__stdcall *CALLBACK_WRITE_BUF_PROGRESS)(unsigned char finished_percentage, unsigned int finished_bytes, unsigned int total_bytes, void *usr_arg);
- //------------------------------------------------------------------------------
- // prototype of Serial-Link-Authentication challenge callback
- //------------------------------------------------------------------------------
- typedef int (__stdcall *CALLBACK_SLA_CHALLENGE)(void *usr_arg, const unsigned char *p_challenge_in, unsigned int challenge_in_len, unsigned char **pp_challenge_out, unsigned int *p_challenge_out_len);
- typedef int (__stdcall *CALLBACK_SLA_CHALLENGE_END)(void *usr_arg, unsigned char *p_challenge_out);
- //------------------------------------------------------------------------------
- // runtime debug trace
- //------------------------------------------------------------------------------
- int __stdcall Brom_DebugOn(void);
- int __stdcall Brom_DebugOff(void);
- int __stdcall Brom_DebugClear(void);
- //------------------------------------------------------------------------------
- // translate enum to string
- //------------------------------------------------------------------------------
- const char * __stdcall BBChipTypeToName(const BBCHIP_TYPE bbchip);
- const char * __stdcall ExtClockToName(const EXT_CLOCK ext_clock);
- const char * __stdcall StatusToString(int status);
- //------------------------------------------------------------------------------
- // Windows message to notify application ready to power on target
- //------------------------------------------------------------------------------
- #define WM_BROM_READY_TO_POWER_ON_TGT (0x8888)
- int __stdcall GetReadyToPowerOnWinAppMsgID(unsigned int *p_wm_app_id);
- int __stdcall SetReadyToPowerOnWinAppMsgID(unsigned int wm_app_id);
- //------------------------------------------------------------------------------
- // boot-up result
- //------------------------------------------------------------------------------
- typedef struct {
- BBCHIP_TYPE m_bbchip_type;
- char m_bbchip_name[32];
- unsigned short m_bbchip_hw_ver;
- unsigned short m_bbchip_sw_ver;
- unsigned short m_bbchip_hw_code;
- EXT_CLOCK m_ext_clock;
- unsigned char m_bbchip_secure_ver;
- unsigned char m_bbchip_bl_ver;
- unsigned int m_fw_ver_len;
- char m_fw_ver[64];
- unsigned char m_msp_err_code;
- } BOOT_RESULT;
- //------------------------------------------------------------------------------
- // boot META mode
- //------------------------------------------------------------------------------
- typedef struct {
- BBCHIP_TYPE m_bbchip_type;
- EXT_CLOCK m_ext_clock;
- unsigned int m_ms_boot_timeout;
- unsigned int m_max_start_cmd_retry_count;
- // This callback function will be invoke after COM port is opened
- // You can do some initialization by using this callback function.
- CALLBACK_COM_INIT_STAGE m_cb_com_init_stage;
- void * m_cb_com_init_stage_arg;
- // 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 m_cb_in_brom_stage;
- void * m_cb_in_brom_stage_arg;
- // speed-up BootROM stage baudrate
- _BOOL m_speedup_brom_baudrate;
- // Application's window handle to send WM_BROM_READY_TO_POWER_ON_TGT message
- HWND m_ready_power_on_wnd_handle;
- void * m_ready_power_on_wparam;
- void * m_ready_power_on_lparam;
- // Serial Link Authentication
- AUTH_HANDLE_T m_auth_handle; // AUTH file handle
- CALLBACK_SLA_CHALLENGE m_cb_sla_challenge;
- void * m_cb_sla_challenge_arg;
- CALLBACK_SLA_CHALLENGE_END m_cb_sla_challenge_end;
- void * m_cb_sla_challenge_end_arg;
- // use USB Cable
- _BOOL m_usb_enable;
- } BOOT_META_ARG;
- int __stdcall Boot_META(
- HANDLE hCOM,
- const BOOT_META_ARG *p_arg,
- BOOT_RESULT *p_result,
- int *p_bootstop);
- //------------------------------------------------------------------------------
- // boot FlashTool download mode
- //------------------------------------------------------------------------------
- #define WAIT_STATE_AUTO_DETECT_BY_FREQUENCY NULL
- typedef struct {
- BBCHIP_TYPE m_bbchip_type;
- EXT_CLOCK m_ext_clock;
- unsigned int m_ms_boot_timeout;
- unsigned int m_max_start_cmd_retry_count;
- // This callback function will be invoke after COM port is opened
- // You can do some initialization by using this callback function.
- CALLBACK_COM_INIT_STAGE m_cb_com_init_stage;
- void * m_cb_com_init_stage_arg;
- // 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 m_cb_in_brom_stage;
- void * m_cb_in_brom_stage_arg;
- // speed-up BootROM stage baudrate
- _BOOL m_speedup_brom_baudrate;
- // Application's window handle to send WM_BROM_READY_TO_POWER_ON_TGT message
- HWND m_ready_power_on_wnd_handle;
- void * m_ready_power_on_wparam;
- void * m_ready_power_on_lparam;
- // Serial Link Authentication
- AUTH_HANDLE_T m_auth_handle; // AUTH file handle
- CALLBACK_SLA_CHALLENGE m_cb_sla_challenge;
- void * m_cb_sla_challenge_arg;
- CALLBACK_SLA_CHALLENGE_END m_cb_sla_challenge_end;
- void * m_cb_sla_challenge_end_arg;
- // EMI Control for Bank0 and Bank1
- unsigned int *m_p_bank0_mem_cfg; // bank0 memory config
- unsigned int *m_p_bank1_mem_cfg; // bank0 memory config
- // Download Agent
- _BOOL m_enable_da_start_addr; // Old parameter, no use now. Use DA_SetDefaultStartAddr instead.
- unsigned int m_da_start_addr; // Old parameter, no use now. Use DA_SetDefaultStartAddr instead.
- DA_HANDLE_T m_da_handle;
- // da download progress callack
- CALLBACK_WRITE_BUF_PROGRESS_INIT m_cb_download_da_init;
- void * m_cb_download_da_init_arg;
- CALLBACK_WRITE_BUF_PROGRESS m_cb_download_da;
- void * m_cb_download_da_arg;
- // use USB Cable
- _BOOL m_usb_enable;
- } BOOT_FLASHTOOL_ARG;
- int __stdcall Boot_FlashTool(
- HANDLE hCOM,
- const BOOT_FLASHTOOL_ARG *p_arg,
- BOOT_RESULT *p_result,
- int *p_bootstop);
- //------------------------------------------------------------------------------
- // get brom.dll version
- //------------------------------------------------------------------------------
- int __stdcall Brom_GetDLLVer(unsigned int *major_ver, unsigned int *minor_ver, unsigned int *build_num, unsigned int *patch_num);
- int __stdcall Brom_GetDLLInfo(const char **pp_version, const char **pp_release_type, const char **pp_build_date, const char **pp_load_path);
- //------------------------------------------------------------------------------
- // BootROM Command
- //------------------------------------------------------------------------------
- int __stdcall Brom_Create(unsigned int *p_brom_handle, BBCHIP_TYPE bbchip_type, EXT_CLOCK ext_clock, int *p_bootstop, unsigned int ms_boot_timeout, unsigned int max_start_cmd_retry_count);
- int __stdcall Brom_Destroy(unsigned int *p_brom_handle);
- int __stdcall Brom_StartCmd(unsigned int brom_handle, HANDLE hCOM, BOOT_RESULT *p_result);
- int __stdcall Brom_Write16Cmd(unsigned int brom_handle, HANDLE hCOM, unsigned int write_addr, unsigned short *data, unsigned int num_of_word);
- int __stdcall Brom_Read16Cmd(unsigned int brom_handle, HANDLE hCOM, unsigned int read_addr, unsigned short *data, unsigned int num_of_word);
- int __stdcall Brom_Write32Cmd(unsigned int brom_handle, HANDLE hCOM, unsigned int write_addr, unsigned int *data, unsigned int num_of_dword);
- int __stdcall Brom_Read32Cmd(unsigned int brom_handle, HANDLE hCOM, unsigned int read_addr, unsigned int *data, unsigned int num_of_dword);
- int __stdcall Brom_Checksum16Cmd(unsigned int brom_handle, HANDLE hCOM, unsigned int chksum_addr, unsigned int num_of_word, unsigned short *chksum);
- int __stdcall Brom_JumpCmd(unsigned int brom_handle, HANDLE hCOM, unsigned int jump_addr, unsigned char bWaitForAck);
- typedef struct {
- unsigned int m_baseaddr;
- unsigned char * m_data;
- unsigned int m_data_len; // in byte
- } _DataBlock;
- #define BROM_MAX_DATA_BLOCKS 10
- typedef struct {
- unsigned short m_block_count;
- _DataBlock m_blocks[BROM_MAX_DATA_BLOCKS];
- } BromWriteDataBlocks;
- int __stdcall Brom_DownloadData(unsigned int brom_handle, HANDLE hCOM, const BromWriteDataBlocks *p_data_blocks, CALLBACK_WRITE_BUF_PROGRESS_INIT cb_init, void *cb_init_arg, CALLBACK_WRITE_BUF_PROGRESS cb, void *cb_arg);
- #ifdef __cplusplus
- }
- #endif
- #endif