2023-03-06 09:51:44 +08:00

74 lines
1.8 KiB
C

/*
* Public.h
*
* Created on: 2022年03月12日
* Author: User
*/
#ifndef __PUBLIC_H_
#define __PUBLIC_H_
#define FALSE 0
#define TRUE 1
#define HIGH 1
#define LOW 0
//数据类型重定义
typedef signed char sint8_t;
typedef signed short int sint16_t;
typedef signed long int sint32_t;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned long int uint32_t;
//定义枚举类型 -> BIT位
typedef enum
{
BIT0 = (uint8_t)(0x01 << 0),
BIT1 = (uint8_t)(0x01 << 1),
BIT2 = (uint8_t)(0x01 << 2),
BIT3 = (uint8_t)(0x01 << 3),
BIT4 = (uint8_t)(0x01 << 4),
BIT5 = (uint8_t)(0x01 << 5),
BIT6 = (uint8_t)(0x01 << 6),
BIT7 = (uint8_t)(0x01 << 7),
}BIT_t;
//定义枚举类型 系统的状态
typedef enum
{
System_Stop = (uint8_t)0, //系统停止加热
System_Heating = (uint8_t)1, //加热中
System_Complete = (uint8_t)2, //加热温度达到
System_Fault = (uint8_t)3, //系统故障
} Sys_Status_t;
//定义结构体类型
typedef struct
{
uint8_t Channel1_StatusFlag;
uint8_t Channel2_StatusFlag;
uint16_t Setting_Temp1;
uint16_t Setting_Temp2;
void (*Delau_us)(uint16_t); //us延时函数
void (*Delay_ms)(uint16_t); //ms延时函数
void (*Memory_Clr)(uint8_t*,uint16_t); //内存清除函数
void (*Error_Handler)(void); //错误处理函数
void (*Sys_Soft_Reset)(void); //系统软件复位
} Public_t;
/* extern variables-----------------------------------------------------------*/
extern Public_t idata Public;
/*******预编译宏定义*******/
#define Monitor_Run_Code //代码运行监控器
//#define Hardware_TEST //硬件测试
#endif
/********************************************************
End Of File
********************************************************/