diff --git a/Power_Pico/BSP/BEEP/beep.c b/Power_Pico/BSP/BEEP/beep.c new file mode 100644 index 0000000..8b647bd --- /dev/null +++ b/Power_Pico/BSP/BEEP/beep.c @@ -0,0 +1,10 @@ +#include "beep.h" +#include "tim.h" + +void beep_open(void) { + HAL_TIM_PWM_Start(&htim4, TIM_CHANNEL_4); // 启动PWM通道4用于蜂鸣器 +} + +void beep_close(void) { + HAL_TIM_PWM_Stop(&htim4, TIM_CHANNEL_4); // 停止PWM通道4 +} diff --git a/Power_Pico/BSP/BEEP/beep.h b/Power_Pico/BSP/BEEP/beep.h new file mode 100644 index 0000000..67a4a4e --- /dev/null +++ b/Power_Pico/BSP/BEEP/beep.h @@ -0,0 +1,18 @@ +#ifndef __BEEP_H__ +#define __BEEP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "main.h" + +void beep_open(void); +void beep_close(void); + + +#ifdef __cplusplus +} +#endif +#endif +