Car/Peripheral/Src/buzzer.c

21 lines
410 B
C
Raw Normal View History

2024-07-18 11:29:28 +08:00
#include "buzzer.h"
#include "timer.h"
static uint8_t state;
inline void BUZZER_Start()
{
HAL_GPIO_WritePin(FM_K2_POWERC_GPIO_Port, FM_K2_POWERC_Pin, GPIO_PIN_RESET);
}
inline void BUZZER_Stop()
{
HAL_GPIO_WritePin(FM_K2_POWERC_GPIO_Port, FM_K2_POWERC_Pin, GPIO_PIN_SET);
}
void BUZZER_StartTimed(uint8_t time)
{
BUZZER_Start();
TIMER_AddLoopEvent(EVENT_BUZZER, BUZZER_Stop, time * 100);
}