71 lines
1017 B
C
71 lines
1017 B
C
|
|
||
|
#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;
|
||
|
|
||
|
typedef enum {
|
||
|
KEYID_K9,
|
||
|
KEYID_K10,
|
||
|
KEYID_K11,
|
||
|
KEYID_K13,
|
||
|
KEYID_K14,
|
||
|
KEY_NUM,
|
||
|
}KEYID_type;
|
||
|
|
||
|
#define KEY_PRESSED 1
|
||
|
#define KEY_NOPRESSED 0
|
||
|
|
||
|
|
||
|
#define PUMP_ON 1
|
||
|
#define PUMP_OFF 0
|
||
|
|
||
|
#define VALVE_ON 1
|
||
|
#define VALVE_OFF 0
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
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 GetSigState(uint8_t keyno);
|
||
|
void setPumpState(uint8_t state);
|
||
|
void setValveState(uint8_t valve_id,uint8_t state);
|
||
|
void setHeatDuty(uint8_t duty);
|
||
|
void setFanDuty(uint8_t duty);
|
||
|
|
||
|
|
||
|
#endif
|