You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
728 B

/*
* Timer.h
*
* Created on: Feb 28, 2025
* Author: bihon
*/
#ifndef INC_TIMER_H_
#define INC_TIMER_H_
#include <stdint.h>
/**
* @brief 设置定时器的计时时间
* @param set_time 要设置的计时时间(单位:ms)
* @param stop_perm 计时中断允许标志,0 表示不允许中断,1 表示允许中断
* @note 由于定时器周期为 2ms,实际计时时间为 set_time / 2
*/
uint8_t Timer_Set(uint16_t set_time, uint8_t stop_perm);
/**
* @brief 开始倒计时,在定时器中断中调用
* @return 计时结束返回 1,计时未结束或被停止返回 0
*/
uint8_t Timer_Start_Count();
/**
* @brief 停止定时器计时
*/
void Timer_Stop_Count();
#endif /* INC_TIMER_H_ */