165 lines
3.6 KiB
C
165 lines
3.6 KiB
C
/**
|
||
******************************************************************************
|
||
* @file global.h
|
||
* @author TMC Scan Team
|
||
* @version V1.0.0
|
||
* @date 09/12/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>© COPYRIGHT 2016 TMC</center></h2>
|
||
******************************************************************************
|
||
**/
|
||
|
||
#ifndef _GLOBAL_H
|
||
#define _GLOBAL_H
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
//type define
|
||
typedef void (* voidfunc) (void);
|
||
|
||
#include <string.h>
|
||
#include "thm36x2.h"
|
||
#include "TMC_SYSTICK.h"
|
||
#include "Version.h"
|
||
#include "TIM.h"
|
||
#include "PWM.h"
|
||
#include "RCC.h"
|
||
#include "DCMI.h"
|
||
#include "DMA.h"
|
||
#include "UART.h"
|
||
#include "FLASH.h"
|
||
#include "EXTI.h"
|
||
#include "PWR.h"
|
||
#include "STOP.h"
|
||
#include "flash_cache.h"
|
||
#include "GPIO.h"
|
||
#include "IIC.h"
|
||
#include "uart_main.h"
|
||
#include "audio.h"
|
||
#include "led.h"
|
||
#include "iic_main.h"
|
||
#include "configuration.h"
|
||
#include "camera_cfg.h"
|
||
#include "Scan.h"
|
||
#include "camera_main.h"
|
||
#include "usb.h"
|
||
#include "vsp.h"
|
||
#include "hid.h"
|
||
#include "wdt.h"
|
||
#include "wdt_main.h"
|
||
#include "cmdhandle.h"
|
||
#include "Scan_Para.h"
|
||
#include "outprompts.h"
|
||
#include "bsp_cfg.h"
|
||
#include "usb_init.h"
|
||
#include "buzzer.h"
|
||
#include "communication.h"
|
||
#include "scanmode.h"
|
||
#include "billmode.h"
|
||
#include "characterencode.h"
|
||
#include "sm4.h"
|
||
#include "romTable.h"
|
||
#include "xdes.h"
|
||
|
||
//变量声明
|
||
extern volatile uint8_t gCommFlag; //硬件检测判断是UART还是USB,如果进USB中断,则是USB
|
||
extern uint32_t gReturnBLCnt;
|
||
extern UART_HandleTypeDef ghuart1;
|
||
extern uint8_t gUartBuff[MAX_RECEIVE_DATA_LEN];
|
||
extern volatile uint16_t gUartLen;
|
||
|
||
//宏定义
|
||
#define LIMIT_TIME 20000 //限制允许恢复BL的时间
|
||
|
||
/** @defgroup TimerHSIClockCount controlType
|
||
* @{
|
||
*/
|
||
#define START_TIMER 1
|
||
#define GET_TIMER 2
|
||
#define STOP_TIMER 3
|
||
/**
|
||
* @}
|
||
*/
|
||
|
||
//是否支持unicode输出,需要字库100多k,需考虑资源情况;发票模式也必须支持Unicode才能实现
|
||
#define SUPPORT_UNICODE 1
|
||
|
||
//是否需要语音数据
|
||
#define SUPPORT_VOICE 1
|
||
|
||
//默认是扫码盒子配置,默认键盘输出,自动识别模式,有语音输出
|
||
#define SCANBOX 0x01
|
||
|
||
//是否是扫码模块配置,默认UART通信,命令模式,如果是,将SCANMODULE定义为1
|
||
#define SCANMODULE 0x00
|
||
|
||
// 是否是送检配置,如果是,将BCTCTEST定义为1
|
||
#define BCTCTEST 0x00
|
||
|
||
//中断向量表搬移地址定义
|
||
#define RAM_BASE_ADDR 0x20000000
|
||
#define IR_VECTOR_TABLE_ADDR 0x00
|
||
#define IR_VECTOR_TABLE_SIZE 364
|
||
|
||
//采集图像地址
|
||
#define DCMIBUFADDR 0x20028800
|
||
|
||
//License
|
||
#define LINSCENCE 0x00000600
|
||
#define SNADDR 0x1F000020
|
||
#define SNLEN 16
|
||
#define SNFLAGLEN 8
|
||
|
||
//UPDATECFG
|
||
#define UPDATECFG 1
|
||
#define UPDATEALCFG 2
|
||
extern uint8_t gCfgUpdateFlag;
|
||
|
||
#define VOICEDATA 1
|
||
#define VOICEDELETE 2
|
||
#define VOICECLEAN 3
|
||
|
||
//函数声明
|
||
//void ResetChip(void);
|
||
void ResetChip(uint8_t entid);
|
||
void TimerDelay(TIM_TypeDef* TIMx, uint32_t ms);
|
||
uint32_t TimerHSIClockCount(TIM_TypeDef* TIMx, uint8_t controlType);
|
||
uint8_t Memcmp(uint8_t *pchDest, uint8_t *pchSrc, uint16_t bLen);
|
||
void Memcpy(u8 * dst,u8 * src,u16 len);
|
||
void Delay(u32 n);
|
||
void AppTIMxInterrupt(TIM_TypeDef *TIMx, uint32_t ms);
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
|
||
#endif /* _GLOBAL_H */
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|