⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.h

📁 KEIL C编译 到位监控程序
💻 H
字号:

#ifndef __TVMMACHINE_MAIN_H__
#define __TVMMACHINE_MAIN_H__

#define TRUE (1)
#define FALSE (0)

#define CLOSE (0)
#define OPEN (1)  

//#define NULL (0)
//#define ACK  0x06
#define LENMAX  11                   // LENGTH COM = 3 数据 收发 总长度
#define DLELENMAX  16                   // LENGTH COM = 3 数据 收发 总长度

#define STX  0x02	
#define ETX  0x03	
#define DLE  0x10

#define RFU  0x00 //nop

#define CE_OK            0x00  //
#define CE_CHECKERROR    0x01  //
#define CE_BADREQUEST    0x02  //无效命令
#define CE_BADPARAM      0x03  //
#define CE_ERROR         0x70  //故障
#define CE_UNKNOWN       0x7F  //未知错误

#define HALT_STATUS		0
//#define RECEIVE_STATUS	1
#define EXEC_STATUS		2
//#define WAIT_ACK_STATUS	3

#define  uchar unsigned char
#define  uint unsigned int

typedef unsigned char BYTE;
typedef unsigned int WORD;
typedef unsigned long DWORD;
typedef bit BOOL;


//////PWM 
#define PWM50   5     //5=50%
#define PWM100  10     //10=100%
///////
//function in Main.c
void setTimer(WORD ms);
//void timerSet(uchar ms);
//comm.c
void init_serialcom(void);//初始化串口
void send_string_com(uchar *str,uchar strlen);//向串口发送一个字符串

//function in driver.c
//BYTE INPUT1();
void control24V(BOOL relay);

void InCoinDoor(BOOL OpenClose);
//void OutCardLamp(BOOL OpenClose);
//void MaintainLamp(BOOL OpenClose);  
//void AAA(BOOL OpenClose);//for test  备用

BOOL isInCoinDoor();
BOOL isCoinBox();
BOOL isRmbOut();
BOOL isCoiner();      
BOOL isRmbIn();
BOOL isProvider();
BOOL isDoor();
BOOL isAAA();

void isLock0_4();   //function in testfun.c
BOOL isCoinBoxCtl();
BOOL isBigBoxDoor();//大钱箱门
BOOL isDoorLock();
//void  delay();
void  delay_1ms (BYTE x);

//function in dealMoney.c
void REPORT();//
void ReadeBox();//
void DETECT();//
void ONOFF24V();//
void CONTROL();
void readState();
//function in comm.c
//void handleText();
void execCommand();
//发送报文//ACK_BUF=响应报文
void sendtext(uchar *ACK_BUF,uchar length);

//function in testfun.c
//BOOL controlDoor_1(BOOL control);    //硬币投币入口门
void runFan1(BOOL control);
void runFan2(BOOL control);
void runCardLamp(BOOL control);
void runMainLamp(BOOL control);
//void isLock0_4();   //function in testfun.c
void off5Cell();

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -