USB2XXX 1.2
USB2XXX接口函数说明文档
载入中...
搜索中...
未找到
hexfile_decode.h
1
9#ifndef __HEXFILE_DECODE_H_
10#define __HEXFILE_DECODE_H_
11
12#include <stdint.h>
13#ifdef _WIN32
14#include <Windows.h>
15#else
16#include <unistd.h>
17#ifndef WINAPI
18#define WINAPI
19#endif
20#endif
21
31typedef struct _HEX_FILE_BLOCK
32{
33 unsigned int StartAddr;
34 unsigned int DataNum;
35 unsigned char *pData;
37
43#define MEMTYPE_UINT8 1
44#define MEMTYPE_UINT16 2
45#define MEMTYPE_UINT32 4
48#ifdef __cplusplus
49extern "C"
50{
51#endif
60int WINAPI hexfile_load_file(const char *filename, char *fileBuf);
61
73int WINAPI hexfile_convert_s19(char *fileBuf, int lenFileBuf, HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType);
74
86int WINAPI hexfile_convert_ihx(char *fileBuf, int lenFileBuf, HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType);
87
99int WINAPI hexfile_convert_txt(char *fileBuf, int lenFileBuf, HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType);
100
109int WINAPI hexfile_free_data(HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum);
110
122int WINAPI hexfile_save_image(const char *filename,HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType,char fillBytes);
123
135int WINAPI hexfile_convert_image(char *pOutData,HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType,char fillBytes);
136#ifdef __cplusplus
137}
138#endif
139
141#endif
int WINAPI hexfile_convert_s19(char *fileBuf, int lenFileBuf, HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType)
按照S19文件格式解析文件,然后输出文件块数据信息
int WINAPI hexfile_save_image(const char *filename, HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType, char fillBytes)
将文件信息块数据转为连续地址数据文件
int WINAPI hexfile_convert_ihx(char *fileBuf, int lenFileBuf, HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType)
按照HEX文件格式解析文件,然后输出文件块数据信息
int WINAPI hexfile_load_file(const char *filename, char *fileBuf)
读取文件内容到数据缓冲区
int WINAPI hexfile_free_data(HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum)
释放文件块数据
int WINAPI hexfile_convert_image(char *pOutData, HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType, char fillBytes)
将文件信息块数据转为连续地址数据
int WINAPI hexfile_convert_txt(char *fileBuf, int lenFileBuf, HEX_FILE_BLOCK *pHexFileBlock, int maxBlockNum, char memType)
按照TXT文件格式解析文件,然后输出文件块数据信息
struct _HEX_FILE_BLOCK HEX_FILE_BLOCK
文件数据块结构体定义
文件数据块结构体定义
Definition: hexfile_decode.h:32
unsigned char * pData
数据块数据存储指针
Definition: hexfile_decode.h:35
unsigned int DataNum
数据块字节数
Definition: hexfile_decode.h:34
unsigned int StartAddr
数据块起始地址
Definition: hexfile_decode.h:33