Files
433_STM32/Core/Inc/relay_control.h

58 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
******************************************************************************
* @file relay_control.h
* @brief 继电器控制模块头文件
* @author Application Layer
* @version 2.0
******************************************************************************
* @attention
* 本模块提供单路继电器的控制接口
* 硬件配置PA15连接继电器控制端
*
* 修订历史:
* v2.0 - 精简为单路继电器控制,移除冗余功能
******************************************************************************
*/
#ifndef __RELAY_CONTROL_H
#define __RELAY_CONTROL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#define RELAY_MIN_INTERVAL 100
/**
* @brief 初始化继电器控制模块
* @note 将继电器初始状态设为关闭
* @param 无
* @retval 无
*/
void Relay_Init(void);
/**
* @brief 设置继电器状态
* @note 带最小间隔保护,防止频繁切换损坏继电器
* @param state: true=打开, false=关闭
* @retval 无
*/
void Relay_SetState(bool state);
/**
* @brief 获取继电器当前状态
* @note 读取软件记录的状态
* @param 无
* @retval true=打开, false=关闭
*/
bool Relay_GetState(void);
#ifdef __cplusplus
}
#endif
#endif