TMC32_QJB/Decode/Scan.h
2026-04-30 16:23:12 +08:00

66 lines
1.7 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//说明可在本头文件配置算法库占用的Flash地址(SCAN_DATA_ADDR)和是否需要DM/PDF417码(NEED_PDF417_DM),其他内容请勿改动。
#ifndef __SCAN_H__
#define __SCAN_H__
#ifdef __cplusplus
extern "C" {
#endif
//配置算法库占用的Flash地址
#define SCAN_DATA_ADDR 0x3000
//配置是否需要DM和PDF417码。0表示不需要1表示需要。
#define NEED_PDF417_DM 1
//以下请勿改动!!!!
//条码/二维码识别结果结构体
typedef struct
{
int bartype; //条码类型
unsigned char *bardata; //条码数据
int datalen; //条码数据的长度
unsigned char containECI; //条码数据是否含ECI
unsigned char packType; //packType:0x01-明码0x03-B指令0x04-C指令
unsigned char reserved[2];
void *barinfo; //根据条码类型(bartype)的不同,传出不同的结构体
} BarData;
//条码/二维码信息结构体
typedef struct
{
int mod_size;
short center_x;
short center_y;
} QRInfo;
//初始化
typedef int (*TMC_Scan_Init_Func)(unsigned char *license);
#define TMC_Scan_Init ((TMC_Scan_Init_Func)(1+SCAN_DATA_ADDR))
//设置参数
typedef int (*TMC_Scan_Set_Func)(int key, int value);
#define TMC_Scan_Set ((TMC_Scan_Set_Func)(0x21+SCAN_DATA_ADDR))
//获取参数
typedef int (*TMC_Scan_Get_Func)(int key, int *pvalue);
#define TMC_Scan_Get ((TMC_Scan_Get_Func)(0x41+SCAN_DATA_ADDR))
//识别
typedef int (*TMC_Scan_Decode_Func)(BarData *bardata);
#define TMC_Scan_Decode ((TMC_Scan_Decode_Func)(0x61+SCAN_DATA_ADDR))
//获取版本信息
typedef const char * (*TMC_Scan_GetVersion_Func)(void);
#define TMC_Scan_GetVersion ((TMC_Scan_GetVersion_Func)(0x81+SCAN_DATA_ADDR))
#ifdef __cplusplus
}
#endif
#endif