mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 19:47:44 +08:00
init commit
This commit is contained in:
13
bsp/bsp_buzzer.c
Normal file
13
bsp/bsp_buzzer.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "bsp_buzzer.h"
|
||||
#include "main.h"
|
||||
extern TIM_HandleTypeDef htim4;
|
||||
void buzzer_on(uint16_t psc, uint16_t pwm)
|
||||
{
|
||||
__HAL_TIM_PRESCALER(&htim4, psc);
|
||||
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_3, pwm);
|
||||
|
||||
}
|
||||
void buzzer_off(void)
|
||||
{
|
||||
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_3, 0);
|
||||
}
|
||||
Reference in New Issue
Block a user