硬件介绍 一般stm32开发板上通过io口来连接蜂鸣器的使用,因此可以直接类比点亮led灯的使用开发
## 软件设计beep.h
- #ifndef _beep_H
- #define _beep_H
-
-
- #include "system.h"
- #define BEEP_PORT_RCC RCC_APB2Periph_GPIOB
- #define BEEP_PIN GPIO_Pin_8
- #define BEEP_PORT GPIOB
- void BEEP_Init();
- #define BEEP PBout(8)
-
-
- #endif
- #ifndef _beep_H
- #define _beep_H
-
-
- #include "system.h"
- #define BEEP_PORT_RCC RCC_APB2Periph_GPIOB
- #define BEEP_PIN GPIO_Pin_8
- #define BEEP_PORT GPIOB
- void BEEP_Init();
- #define BEEP PBout(8)
-
-
- #endif
|