TMC32_QJB/App/scanmode.h
2026-04-30 16:23:12 +08:00

57 lines
2.0 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.

/**
******************************************************************************
* @file scanmode.h
* @author TMC Scan Team
* @version V1.0.0
* @date 09/06/2019
* @brief
******************************************************************************
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, TMC SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* <h2><center>&copy; COPYRIGHT 2016 TMC</center></h2>
******************************************************************************
**/
#ifndef _SCANMODE_H
#define _SCANMODE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "global.h"
#define SENSOR_VALUE 3000
#define SCANCODE_OPEN 0x01
#define SCANCODE_CLOSE 0x00
#define TIME_OUT 6000000 //感应模式时间超时500ms
#define LIGHTING 1 //默认感应模式扫码完毕关LED
extern uint8_t gAutoModeOverTimeFlag; //连续模式下,同码延时和异码延时,第一次解码不需要延时;或者扫码一直不成功,定时器如果超时,解码也不需要延时
extern uint8_t gCmdStartFlag; //命令模式下开启扫码命令标记FALSE表示禁止扫码TRUE表示使能扫码
extern uint8_t gSensorChangeFlag; //环境变化标记,FALSE表明环境无变化TRUE表明环境有变化
extern ImageSizeType gLastPictureSize; //感应模式下上一次采图标记感知环境变化时由于RAM不足需要采集小图当进入解码状态时采集图像尺寸恢复到640*480
extern uint32_t gCurrentPictureAddr; //感应模式下,需要采集两张图像,标记当前采集图像的地址
extern int gPreCodeType;
void AppScanModeInit(void);
int AutoScanMode(BarData *pCode);
int CmdScanMode(BarData *pCode);
int CmdScanTimeMode(BarData *pCode);
int SensorScanMode(BarData *pCode);
uint8_t ScanModeReceiveData(BarData *bardata);
#ifdef __cplusplus
}
#endif
#endif