📄 switch_power.h
字号:
/***********************************************************************
** 常量定义
**********************************************************************/
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL 0
#endif
/***********************************************************************
** 数据类型声明
**********************************************************************/
typedef unsigned char uint8; /* 无符号8位整型变量 */
typedef signed char int8; /* 有符号8位整型变量 */
typedef unsigned short int uint16; /* 无符号16位整型变量 */
typedef signed short int int16; /* 有符号16位整型变量 */
typedef unsigned long int uint32; /* 无符号32位整型变量 */
typedef signed long int int32; /* 有符号32位整型变量 */
typedef float fp32; /* 单精度浮点数(32位长度) */
typedef double fp64; /* 双精度浮点数(64位长度) */
/********************************/
/* 特殊硬件定义 */
/********************************/
#include <c8051F330.h>
/********************************/
/* 应用程序配置 */
/********************************/
#include "system_config.h"
#include "timer.h"
//#include "UART.H"
#include "PCA.h"
#include "ADC.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <absacc.h>
#include <ctype.h>
#include <intrins.h>
/********************************/
/* 系统参数配置 */
/********************************/
//#define _USB_LOW_SPEED_ // Change this comment to make Full/Low speed
//#define SYS_INT_OSC 0x00 // Select to use internal oscillator
//#define USB_4X_CLOCK 0x00 // Select 4x clock multiplier, for USB Full Speed
/********************************/
/* I2C口线配置 */
/********************************/
//sbit Sda = P0^0;
//sbit Scl = P0^1;
/********************************/
/* 定时器0/1初始化 */
/********************************/
#define TH0_INIT 0xf8 //PWM clock source as frequency
#define TL0_INIT 0xf8 //PWM clock source as frequency
#define TH1_INIT 0xcc //UART0 clock source as baud rate
#define TL1_INIT 0xcc //UART0 clock source as baud rate
/********************************/
/* 定时器2初始化 */
/********************************/
//sfr16 TMR2RL = 0xca; // Timer2 reload value
//sfr16 TMR2 = 0xcc; // Timer2 counter
/********************************/
/* PWM占空比参数配置 */
/********************************/
#define OCP_INIT 20//caution:must between OCP_MIN and OCP_MAX
#define OCP_MIN 10
#define OCP_MAX 200
/********************************/
/* 工程全局变量 */
/********************************/
extern uint16 xdata CurrentNum;
extern uint16 xdata VoltageNum;
/********************************/
/* 控制类开放参数配置 */
/********************************/
#define I_Rill
#define I_Rush
#define I_Rest
#define U_Rill_Rush
#define U_Rush_Rest
#define U_End
#define I_Protect
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -