119 lines
2.6 KiB
C
119 lines
2.6 KiB
C
/*
|
||
******************************************************************************
|
||
*
|
||
* @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"
|
||
|
||
/*Function Select,功能选择宏定义*/
|
||
#define TEST 0
|
||
|
||
//#define DISPLAY_LED_188 //188数码管显示功能,采用Timer1定时扫描(631Bytes)
|
||
|
||
#define TIMER1_ENABLE 0 //Timer1 定时周期100us
|
||
|
||
#define UART0_ENABLE 0 //UART0功能,用于程序调试。
|
||
|
||
#define WTG_ENABLE 1 //看门狗功能使能
|
||
|
||
//#define LED_DISPLAY //LED显示 (888Bytes)
|
||
|
||
#define KEY_HALL_ENABLE 1 //Key和Hall功能。(390Bytes)
|
||
|
||
#define SET_CHG_TIM 0 //设置充电时间。
|
||
|
||
#define VOX_ENABLE 1
|
||
|
||
#define CHARGER_ENABLE 1
|
||
|
||
#define DISCHARGE_ENABLE 1
|
||
|
||
//#define BOOST_AOUT
|
||
|
||
#define SLEEP_ENABLE 1
|
||
|
||
#define ADC_ENABLE 1
|
||
|
||
#if ADC_ENABLE
|
||
#define ADC_CHN_ENABLE 0
|
||
#endif
|
||
|
||
//#define _DEBUG_ALL //打开打印功能
|
||
|
||
//#define _DEBUG_LED
|
||
#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"
|
||
#include "uart.h"
|
||
|
||
#endif
|
||
|