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"
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
extern volatile uint8_t gCommFlag; //Ӳ<><D3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD>UART<52><54><EFBFBD><EFBFBD>USB<53><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USB<53>жϣ<D0B6><CFA3><EFBFBD><EFBFBD><EFBFBD>USB
|
|||
|
|
extern uint32_t gReturnBLCnt;
|
|||
|
|
extern UART_HandleTypeDef ghuart1;
|
|||
|
|
extern uint8_t gUartBuff[MAX_RECEIVE_DATA_LEN];
|
|||
|
|
extern volatile uint16_t gUartLen;
|
|||
|
|
|
|||
|
|
//<2F>궨<EFBFBD><EAB6A8>
|
|||
|
|
#define LIMIT_TIME 20000 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>BL<42><4C>ʱ<EFBFBD><CAB1>
|
|||
|
|
|
|||
|
|
/** @defgroup TimerHSIClockCount controlType
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
#define START_TIMER 1
|
|||
|
|
#define GET_TIMER 2
|
|||
|
|
#define STOP_TIMER 3
|
|||
|
|
/**
|
|||
|
|
* @}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
//<2F>Ƿ<EFBFBD>֧<EFBFBD><D6A7>unicode<64><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ֿ<EFBFBD>100<30><30>k<EFBFBD><6B><EFBFBD>迼<EFBFBD><E8BFBC><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƱģʽҲ<CABD><D2B2><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>Unicode<64><65><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
|||
|
|
#define SUPPORT_UNICODE 1
|
|||
|
|
|
|||
|
|
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
#define SUPPORT_VOICE 1
|
|||
|
|
|
|||
|
|
//Ĭ<><C4AC><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,Ĭ<>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD>ʶ<EFBFBD><CAB6>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
#define SCANBOX 0x01
|
|||
|
|
|
|||
|
|
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ɨ<EFBFBD><C9A8>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,Ĭ<><C4AC>UARTͨ<54>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><C7A3><EFBFBD>SCANMODULE<4C><45><EFBFBD><EFBFBD>Ϊ1
|
|||
|
|
#define SCANMODULE 0x00
|
|||
|
|
|
|||
|
|
// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><C7A3><EFBFBD>BCTCTEST<53><54><EFBFBD><EFBFBD>Ϊ1
|
|||
|
|
#define BCTCTEST 0x00
|
|||
|
|
|
|||
|
|
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>
|
|||
|
|
#define RAM_BASE_ADDR 0x20000000
|
|||
|
|
#define IR_VECTOR_TABLE_ADDR 0x00
|
|||
|
|
#define IR_VECTOR_TABLE_SIZE 364
|
|||
|
|
|
|||
|
|
//<2F>ɼ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ַ
|
|||
|
|
#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
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//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 */
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|