SY883x_For_Client_JLAB_JS07/UsrInc/inc/define.h

150 lines
4.1 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 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
/* 芯片类型选择SY8836合封OVP芯片 */
//#define SY8836
/*Function Select功能选择宏定义*/
/*VOX充放电功能选择1、开关盖VOX充放电2、Vox耳机插拔自适应充放电。二者只能选一。*/
#define VOX_ADT_ENABLE 1 //Vox自适应充放电不带Hall自选禁用KEY、HALL功能486Bytes
/* 灯效功能选择1、188数码管2、4颗LED3、呼吸灯 三者只能选一。选择LED显示不需要Timer1。*/
#define LED_DISPLAY 1 //LED显示,3个灯显示带呼吸 (814Bytes),具体灯个数和灯效需要在对应源码中选择更改。
/*呼吸灯功能需要使用Timer1。*/
#if LED_DISPLAY
#define TIMER1_ENABLE
#define BREATHING_LIGHT //呼吸灯功能自选驱动函数置于Timer1中断处理函数中调用周期100us具体灯个数和灯效需要在对应源码中选择更改。
#endif
/* 公共功能选择宏定义,其中自选部分根据需求选择,必选部分勿动。 其中需要调整参数的可在System_Init()中进行配置。)*/
#define VOX_ENABLE 1 //Vox功能配置必选
//#define VOX_TX //Vox发码功能(545Bytes)
#define UART0_ENABLE 0 //UART0功能用于程序调试自选。(85Bytes)
#define WTG_ENABLE 1 //看门狗功能使能(必选)(7Bytes)
#define HALL_ENABLE //Hall功能自选(35Bytes)
#define KEY_ENABLE //Key功能自选(78Bytes)
#define CHARGER_ENABLE 1 //Charger功能必选 231Bytes
#define DISCHARGE_ENABLE 1 //Boost放电功能必选93Bytes
#define VOX_TX_PATTERN 1 //GPIO Pattern (227Bytes)
#define VOX_FOLLOW_CHG 1 //VOX跟随充自选ADT:356Bytes,HALL:165Bytes
#define SLEEP_ENABLE 1 //休眠功能必选91Bytes
#define ADC_ENABLE 1 //ADC功能必选476Bytes
#if ADC_ENABLE
#define NTC_ENABLE //NTC保护功能自选298Bytes
#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