/*
 ******************************************************************************
 *
 * @file     define.h
 * @brief    define module
 *                 
 *
 * @version  1.0
 * @date     2023/07/12   09:59:40
 * @author   Alex Xu
 *
 * Copyright (c) 2013-2099,Tkplusemi Technology Co.,Ltd.
 * All Rights Reserved
 *
 * History:
 * Revision          Date           Author            Desc
 * 1.0.0            2023/07/12      Alex          build this file
 ******************************************************************************
 */
#ifndef	__DEFINE_H__
#define	__DEFINE_H__

#include "config.h"

/*程序版本，第一个数代表在硬件存在改动不能兼容之前版本时加1，
	第二个数在功能存在改动时加1，第三个数在软件调试出现不同的
	测试版本时改动；高位数字变动时，低位数字清零。*/

#define FW_VER0	0x01			//程序版本0:代表在硬件存在改动不能兼容之前版本时加1
#define FW_VER1	0x01			//程序版本1:代表在功能存在改动时加1
#define FW_VER2	0x02			//程序版本2:代表在软件调试出现不同的测试版本时改动时加1

/*Function Select，功能选择宏定义*/

#define TIMER1_ENABLE						1			//Timer1  定时周期1ms

#if TIMER1_ENABLE
#define BREATHING_LIGHT									//呼吸灯功能，驱动函数置于Timer1中断处理函数中，调用周期100us。(243Bytes)
#endif

#define UART0_ENABLE 						1			//UART0功能，用于程序调试。(153Bytes)
 
#define WTG_ENABLE							1			//看门狗功能使能(7Bytes)

#define LED_DISPLAY										//LED显示 ,1个灯显示 (348Bytes)

#define HALL_ENABLE							1			//Hall功能。(Hall 46Bytes)

#define KEY_ENABLE							1			//Key功能(262Bytes)

#define VOX_ENABLE							1			//304Bytes

#define VOX_TX											//587Bytes
	
#define VOX_TX_PATTERN						0				//GPIO Pattern (118Bytes)

#define VOX_FOLLOW_CHG 						0

//#define VOX_RX											//405Bytes

#define CHARGER_ENABLE						1			//225Bytes
	
#define DISCHARGE_ENABLE					1			//75Bytes

#define SLEEP_ENABLE						1			//82Bytes

#define ADC_ENABLE							1           //561Bytes

#if ADC_ENABLE
#define NTC_ENABLE							1
#endif

#define BAT_VALUE							1			//147Bytes

//#define _DEBUG_ALL										//打开打印功能

#ifdef _DEBUG_ALL

	  #define _DEBUG_MAIN
//    #define _DEBUG_KEY
//	  #define _DEBUG_VOX
//    #define _DEBUG_HALL
//    #define _DEBUG_ADC				
//    #define _DEBUG_DISCHARGE
//      #define _DEBUG_CHARGER
//      #define _DEBUG_SLEEP
//    #define _DEBUG_BAT

//#define TEST_MODE

#include "stdio.h"
#include "string.h"

#endif

#define HIBYTE(v1)              ((uint8_t)((v1)>>8))                      //v1 is uint16_t
#define LOBYTE(v1)              ((uint8_t)((v1)&0xFF))

typedef bit                   BIT;
typedef unsigned char         uint8_t;
typedef unsigned int          uint16_t;
typedef unsigned long         uint32_t;

typedef unsigned char         uint8;
typedef unsigned int          uint16;
typedef unsigned long         uint32;

typedef signed char         int8_t;
typedef signed int          int16_t;
typedef signed long         int32_t;

typedef signed char         int8;
typedef signed int          int16;
typedef signed long         int32;

typedef signed char s8;
typedef unsigned char u8;
typedef signed short int s16;
typedef unsigned short int u16;
typedef signed long int s32;
typedef unsigned long int u32;

typedef enum{false = 0, true = !false} bool;

#define FALSE false
#define TRUE true
#define ON  true
#define OFF  false

#include "reg3310.h"
#if UART0_ENABLE
#include "uart.h"
#endif

#endif

