ZDBMS/header_app/Main.h

154 lines
5.4 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.

#ifndef __MAIN_H
#define __MAIN_H
//***------- <<< Use Configuration Wizard in Context Menu >>> ------------------
// <o>串口选择-uart0
// <i>串口选择切换串口号后需要手动修改InitGPIO()端口初始化确保升级或运行过程中不会误点灯或开MOS另外带IAP/ISP的工程也需要同步切换
// <0=>Uart0 : 不使能uart0
// <1=>Uart0 : P0.6 For RXD0,P0.7 For TXD0 UART0CR=32(UART0默认)
// <2=>Uart0 : P0.6 For RXD0,P2.4 For TXD0 UART0CR=42
// <3=>Uart0 : P0.6 For RXD0,P2.5 For TXD0 UART0CR=52
// <4=>Uart0 : P0.6 For RXD0,P0.0 For TXD0 UART0CR=02
// <5=>Uart0 : P0.6 For RXD0,P0.1 For TXD0 UART0CR=12
// <6=>Uart0 : P0.7 For RXD0,P0.6 For TXD0 UART0CR=23
// <7=>Uart0 : P0.7 For RXD0,P2.4 For TXD0 UART0CR=43
// <8=>Uart0 : P0.7 For RXD0,P2.5 For TXD0 UART0CR=53
// <9=>Uart0 : P0.7 For RXD0,P0.0 For TXD0 UART0CR=03
// <10=>Uart0 : P0.7 For RXD0,P0.1 For TXD0 UART0CR=13
// <11=>Uart0 : P2.4 For RXD0,P0.6 For TXD0 UART0CR=24
// <12=>Uart0 : P2.4 For RXD0,P0.7 For TXD0 UART0CR=34
// <13=>Uart0 : P2.4 For RXD0,P2.5 For TXD0 UART0CR=54
// <14=>Uart0 : P2.4 For RXD0,P0.0 For TXD0 UART0CR=04
// <15=>Uart0 : P2.4 For RXD0,P0.1 For TXD0 UART0CR=14
// <16=>Uart0 : P2.5 For RXD0,P0.6 For TXD0 UART0CR=25
// <17=>Uart0 : P2.5 For RXD0,P0.7 For TXD0 UART0CR=35
// <18=>Uart0 : P2.5 For RXD0,P2.4 For TXD0 UART0CR=45
// <19=>Uart0 : P2.5 For RXD0,P0.0 For TXD0 UART0CR=05
// <20=>Uart0 : P2.5 For RXD0,P0.1 For TXD0 UART0CR=15
// <21=>Uart0 : P0.0 For RXD0,P0.7 For TXD0 UART0CR=30
// <22=>Uart0 : P0.0 For RXD0,P2.4 For TXD0 UART0CR=40
// <23=>Uart0 : P0.0 For RXD0,P2.5 For TXD0 UART0CR=50
// <24=>Uart0 : P0.0 For RXD0,P0.6 For TXD0 UART0CR=20
// <25=>Uart0 : P0.0 For RXD0,P0.1 For TXD0 UART0CR=10
// <26=>Uart0 : P0.1 For RXD0,P0.7 For TXD0 UART0CR=31
// <27=>Uart0 : P0.1 For RXD0,P2.4 For TXD0 UART0CR=41
// <28=>Uart0 : P0.1 For RXD0,P2.5 For TXD0 UART0CR=51
// <29=>Uart0 : P0.1 For RXD0,P0.0 For TXD0 UART0CR=01
// <30=>Uart0 : P0.1 For RXD0,P0.6 For TXD0 UART0CR=21
#define UART0_DEFINE 1
// <o>串口选择-uart1
// <0=>Uart1 : 不使能uart1
// <1=>Uart1 : P1.0 For RXD1,P1.1 For TXD1 UART1CR=10(UART1默认)
// <2=>Uart1 : P1.0 For RXD1,P3.3 For TXD1 UART1CR=40
// <3=>Uart1 : P1.0 For RXD1,P3.4 For TXD1 UART1CR=50
// <4=>Uart1 : P1.0 For RXD1,P2.6 For TXD1 UART1CR=20
// <5=>Uart1 : P1.0 For RXD1,P2.7 For TXD1 UART1CR=30
// <6=>Uart1 : P1.1 For RXD1,P1.0 For TXD1 UART1CR=01
// <7=>Uart1 : P1.1 For RXD1,P3.3 For TXD1 UART1CR=41
// <8=>Uart1 : P1.1 For RXD1,P3.4 For TXD1 UART1CR=51
// <9=>Uart1 : P1.1 For RXD1,P2.6 For TXD1 UART1CR=21
// <10=>Uart1 : P1.1 For RXD1,P2.7 For TXD1 UART1CR=31
// <11=>Uart1 : P3.3 For RXD1,P1.0 For TXD1 UART1CR=04
// <12=>Uart1 : P3.3 For RXD1,P1.1 For TXD1 UART1CR=14
// <13=>Uart1 : P3.3 For RXD1,P3.4 For TXD1 UART1CR=54
// <14=>Uart1 : P3.3 For RXD1,P2.6 For TXD1 UART1CR=24
// <15=>Uart1 : P3.3 For RXD1,P2.7 For TXD1 UART1CR=34
// <16=>Uart1 : P3.4 For RXD1,P1.0 For TXD1 UART1CR=05
// <17=>Uart1 : P3.4 For RXD1,P1.1 For TXD1 UART1CR=15
// <18=>Uart1 : P3.4 For RXD1,P3.3 For TXD1 UART1CR=45
// <19=>Uart1 : P3.4 For RXD1,P2.6 For TXD1 UART1CR=25
// <20=>Uart1 : P3.4 For RXD1,P2.7 For TXD1 UART1CR=35
// <21=>Uart1 : P2.6 For RXD1,P1.0 For TXD1 UART1CR=02
// <22=>Uart1 : P2.6 For RXD1,P1.1 For TXD1 UART1CR=12
// <23=>Uart1 : P2.6 For RXD1,P3.3 For TXD1 UART1CR=42
// <24=>Uart1 : P2.6 For RXD1,P3.4 For TXD1 UART1CR=52
// <25=>Uart1 : P2.6 For RXD1,P2.7 For TXD1 UART1CR=32
// <26=>Uart1 : P2.7 For RXD1,P1.0 For TXD1 UART1CR=03
// <27=>Uart1 : P2.7 For RXD1,P1.1 For TXD1 UART1CR=13
// <28=>Uart1 : P2.7 For RXD1,P3.3 For TXD1 UART1CR=43
// <29=>Uart1 : P2.7 For RXD1,P3.4 For TXD1 UART1CR=53
// <30=>Uart1 : P2.7 For RXD1,P2.6 For TXD1 UART1CR=23
#define UART1_DEFINE 0
// <o>串口选择-uart2
// <0=>Uart2 : 不使能uart2
// <1=>Uart2 : P2.2 For RXD2,P2.1 For TXD2
#define UART2_DEFINE 0
// <o>波特率选择
// <0=>9600
// <1=>115200
#define UART_BRT 0
// 使能软启动
//#define SOFT_START 1
// 使能均衡
//#define BALEN 0
// 使能ISP/IAP
// 说明:SH39F325仅支持ISP,SH39F325A支持IAP、ISP
//#define ISPEN 0
// 调速挡数设置
// 两挡调速
// 三档调速
//#define SPEED_LEVEL 3
// 按键个数设置
//#define KEY_NUM 2
//*<<< end of configuration section >>>
#include "MCURegister.h"
#include "c51_type.h"
#include "ABSACC.H"
#include "STDLIB.H"
#include "INTRINS.H"
#include "Initial.h"
#include "InterruptApp.h"
#include "KeyApp.h"
#include "Led.h"
#include "LowPower.h"
#include "Memory.h"
#include "UartApp.h"
#include "Afe.h"
#include "Balance.h"
#include "Calculate.h"
#include "Calibrate.h"
#include "ChargerLoad.h"
#include "ExtE2PRom.h"
#include "GasGaugeV4_13.h"
#include "Interrupt.h"
#include "KeyScan.h"
#include "McuFlash.h"
#include "McuLib.h"
#include "MosCtrl.h"
#include "PorSelfTest.h"
#include "Protect.h"
#include "RTC.h"
#include "Twi.h"
#include "Uart.h"
#include "TWIIO.h"
//#include "sh_iec60730b_8051f_testproc.h"
#define IO_DSG_PWM P2_5
#define IO_BLE_PW P0_3
// SL
#define IO_485_DE P2_0
#define IO_LED P2_4
#define BlueToothPowerEn() IO_BLE_PW = 0;
#define BlueToothPowerDis() IO_BLE_PW = 1;
extern void ISPProcess(void);
#endif