資源簡介
STM32驅動蜂鳴器,實現播放歌曲功能,蜂鳴器數據接收端接GPIOC.5即可直接使用。

代碼片段和文件信息
#include?“stm32f10x.h“
#include?“stm32lib.h“
/********************************************************************************************************
**函數信息?:void?GPIOInit(void)?????????????????????????//?WAN.CG?//?2010.12.8?
**功能描述?:GPIO初始化函數,初始化實驗用到的所有GPIO口
**輸入參數?:無
**輸出參數?:無
**調用提示?:RCC_APB2PeriphClockCmd();GPIO_Init()
********************************************************************************************************/
void?GPIOInit(void)
{
GPIO_InitTypeDef??GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB?|?RCC_APB2Periph_AFIO?ENABLE);??//開啟GPIOB端口以及復用功能
/* //PB3配置為輸出;LED
GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_3; ???????//選擇第端口3
GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_Out_PP; ???//開漏輸出
GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_50MHz; ???//50M時鐘速度
GPIO_Init(GPIOB?&GPIO_InitStructure); ???????//GPIO配置函數?*/
GPIO_PinRemapConfig(GPIO_PartialRemap_TIM3?ENABLE);?//部分映射,將TIM3_CH1映射到PB5
GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_5; ? ?//選擇引腳5 ?
GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_50MHz;? ?//輸出頻率最大50MHz
? GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_AF_PP; ? ?//復用推挽輸出 ? ?
GPIO_Init(GPIOB&GPIO_InitStructure);
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3578??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\core_cm3.crf
?????文件????????129??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\core_cm3.d
?????文件??????10412??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\core_cm3.o
?????文件?????????19??2012-12-02?15:34??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\ExtDll.iex
?????文件?????337056??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\GPIO.axf
?????文件?????345897??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\gpio.crf
?????文件???????1895??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\gpio.d
?????文件??????20616??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\GPIO.hex
?????文件??????55177??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\GPIO.htm
?????文件???????1425??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\GPIO.lnp
?????文件?????377280??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\gpio.o
?????文件???????3555??2018-10-12?16:35??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\GPIO.plg
?????文件????????479??2012-11-28?16:55??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\GPIO.sct
?????文件???????4115??2012-12-02?15:44??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\GPIO.tra
?????文件????????479??2012-10-21?12:55??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\GPIO_sct.Bak
?????文件?????347226??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\main.crf
?????文件???????1984??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\main.d
?????文件?????382840??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\main.o
?????文件?????222247??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\misc.crf
?????文件????????341??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\misc.d
?????文件?????234612??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\misc.o
?????文件?????????53??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\os_cpu_a.d
?????文件???????1776??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\os_cpu_a.o
?????文件?????????51??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\startup.d
?????文件???????5908??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\startup.o
?????文件?????245549??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\stm32f10x_adc.crf
?????文件????????490??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\stm32f10x_adc.d
?????文件?????265400??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\stm32f10x_adc.o
?????文件?????232727??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\stm32f10x_bkp.crf
?????文件????????490??2018-10-12?16:30??STM32--music\STM32驅動蜂鳴器播放歌曲\debug\DebugInFlash\stm32f10x_bkp.d
............此處省略159個文件信息
- 上一篇:機器學習那些事.pdf
- 下一篇:phdhe_3988422.zip
評論
共有 條評論