Files
JBao_Sprayer_FW/apps/usr_app/app_pump.h
T
2026-09-09 15:03:50 +08:00

46 lines
1.2 KiB
C

/******************************************************************************
* @file app_pump.h
* @brief 水泵双脚成对控制(PC2 供 5V + PA6 导通)
* @author cyWu <1917507415@qq.com>
* @date 2026.09.09
* @version V1.0.0
******************************************************************************/
#ifndef __APP_PUMP_H__
#define __APP_PUMP_H__
#include <stdint.h>
typedef enum {
APP_PUMP_OK = 0,
APP_PUMP_ERR_NOT_INIT
} AppPump_Ret_t;
/**
* @brief 初始化泵模块:GPIO 由 bsp_hw_init 成对置低,本函数只清状态
* @return APP_PUMP_OK=成功
*/
AppPump_Ret_t app_pump_init(void);
/**
* @brief 成对切泵:on=1 两脚同时高(泵转),on=0 两脚同时低(泵停)
* @note ⚠ 唯一允许改泵的出口是 app_spray 作业引擎(规格书 7.2)。
* @param on 1=开,0=关
* @return 无
*/
void app_pump_set(uint8_t on);
/**
* @brief 读泵当前态(请求态即实际态:无过零/继电器)
* @return 1=泵转(两脚都通),0=泵停
*/
uint8_t app_pump_get(void);
/**
* @brief 查询模块是否已初始化
* @return APP_PUMP_OK=已初始化,APP_PUMP_ERR_NOT_INIT=未初始化
*/
AppPump_Ret_t app_pump_get_status(void);
#endif /* __APP_PUMP_H__ */