Car/Peripheral/Src/buzzer.c
2024-07-18 11:38:07 +08:00

21 lines
410 B
C

#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);
}