M20/APP/user/hwCtrl.h

63 lines
918 B
C
Raw Normal View History

2024-05-19 17:07:18 +08:00
#ifndef __HWCTRL_H__
#define __HWCTRL_H__
#include "r_cg_macrodriver.h"
typedef enum
{
VALVE_OFF,
VALVE_ON,
}VALVE_STATE_type;
typedef enum
{
VALVE1,
VALVE2,
VALVE3,
VALVE4,
VALVE5,
VALVE6,
VALVE7,
VALVE_NUM,
}VALVE_ID_type;
typedef enum {
AD_ST1_IGN,
AD_ST2_BAT,
AD_ST3_KEY,
AD_ST_NUM,
} AD_STEP_type;
#define KEY_PRESSED 1
#define KEY_NOPRESSED 0
2024-05-19 21:15:43 +08:00
#define KEY_NUM 1
2024-05-19 17:07:18 +08:00
2024-05-19 20:26:03 +08:00
#define PUMP_ON 1
#define PUMP_OFF 0
#define VALVE_ON 1
#define VALVE_OFF 0
2024-05-19 17:07:18 +08:00
void ad_handle(void);
uint16_t getAdval(uint8_t ch);
void KeyScan(void);
void ClearKeyState(void);
uint8_t GetKeyState(uint8_t keyno);
uint8_t getKeyReleaseFlag(uint8_t id);
uint8_t getKeyPressFlag(uint8_t id);
uint8_t GetIOState(uint8_t keyno);
2024-05-19 20:26:03 +08:00
void setPumpState(uint8_t state);
2024-05-19 17:07:18 +08:00
void setValveState(uint8_t valve_id,uint8_t state);
void setHeatDuty(uint8_t duty);
void setFanDuty(uint8_t duty);
#endif