2024-07-13 20:32:59 +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,
|
|
|
|
VALVE_NUM,
|
|
|
|
}VALVE_ID_type;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
AD_ST1_IGN,
|
|
|
|
AD_ST2_BAT,
|
|
|
|
AD_ST_NUM,
|
|
|
|
} AD_STEP_type;
|
|
|
|
|
|
|
|
typedef enum {
|
2024-07-21 09:56:43 +08:00
|
|
|
KEYID_AM,//按摩
|
|
|
|
KEYID_JS,//解锁
|
2024-07-13 20:32:59 +08:00
|
|
|
KEY_NUM,
|
|
|
|
}KEYID_type;
|
|
|
|
|
2024-07-21 09:56:43 +08:00
|
|
|
typedef enum {
|
|
|
|
MOTOR_NOACT,
|
|
|
|
MOTOR_XQ,//向前
|
|
|
|
MOTOR_XH,//向后
|
|
|
|
}MOTORACT_type;
|
|
|
|
|
2024-07-13 20:32:59 +08:00
|
|
|
#define KEY_PRESSED 1
|
|
|
|
#define KEY_NOPRESSED 0
|
|
|
|
|
|
|
|
|
|
|
|
#define PUMP_ON 1
|
|
|
|
#define PUMP_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);
|
2024-07-21 09:56:43 +08:00
|
|
|
void setUnlockMotor(MOTORACT_type state);
|
2024-07-13 20:32:59 +08:00
|
|
|
|
|
|
|
#endif
|