資源簡介
普中科技stm32開發(fā)板幾十個開發(fā)應用程序?qū)嵗?led,按鍵,時鐘,中斷,各種通信方式等等
代碼片段和文件信息
#include?“beep.h“
/*******************************************************************************
*?函?數(shù)?名?????????:?BEEP_Init
*?函數(shù)功能 ???:?蜂鳴器端口初始化函數(shù) ???通過改變頻率控制聲音變化
*?輸????入?????????:?無
*?輸????出?????????:?無
*******************************************************************************/
void?BEEP_Init() ??//端口初始化
{
GPIO_InitTypeDef?GPIO_InitStructure; //聲明一個結(jié)構(gòu)體變量,用來初始化GPIO
SystemInit();
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOBENABLE);???/*?開啟GPIO時鐘?*/
/*??配置GPIO的模式和IO口?*/
GPIO_InitStructure.GPIO_Pin=BZ; //選擇你要設置的IO口
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP; ??//設置推挽輸出模式
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz; ??//設置傳輸速率
GPIO_Init(GPIOB&GPIO_InitStructure);? ?/*?初始化GPIO?*/
}
/*******************************************************************************
*?函?數(shù)?名?????????:?sound1
*?函數(shù)功能 ???:?蜂鳴器報警函數(shù)
*?輸????入?????????:?無
*?輸????出?????????:?無
*******************************************************************************/
void?sound1()??//救護車報警
{
u32?i=5000;
while(i--) ???//產(chǎn)生一段時間的PWM波,使蜂鳴器發(fā)聲
{
GPIO_SetBits(GPIOBBZ); ?//IO口輸出高電平
delay(i);
GPIO_ResetBits(GPIOBBZ); ??//IO口輸出低電平
delay(i--);
}
}
/*******************************************************************************
*?函?數(shù)?名?????????:?sound2
*?函數(shù)功能 ???:?蜂鳴器報警函數(shù) ??通過改變頻率控制聲音變化
*?輸????入?????????:?無
*?輸????出?????????:?無
*******************************************************************************/
void?sound2()??//電動車報警
{
u32?i=1000;
while(i--) //產(chǎn)生一段時間的PWM波,使蜂鳴器發(fā)聲
{
GPIO_SetBits(GPIOBBZ); ???//IO口輸出高電平
delay(i);
GPIO_ResetBits(GPIOBBZ); //IO口輸出低電平
delay(i--);
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A.SH.???????162??2015-06-05?09:59??庫函數(shù)版\實驗10:232串口通信\~$實驗5:按鍵.doc
????..A.SH.????315392??2015-06-05?09:44??庫函數(shù)版\實驗10:232串口通信\~WRL0001.tmp
?????文件?????109107??2015-06-05?09:55??庫函數(shù)版\實驗10:232串口通信\串口設置.png
?????文件?????399111??2015-06-16?14:55??庫函數(shù)版\實驗10:232串口通信\實驗10:232串口通信.pdf
?????文件????????514??2015-06-05?11:02??庫函數(shù)版\實驗10:232串口通信\實驗說明.txt
?????文件??????59715??2014-12-09?16:24??庫函數(shù)版\實驗10:232串口通信\工程模板\1.uvopt
?????文件???????1879??2015-05-28?11:07??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\beep\beep.c
?????文件????????194??2015-05-28?11:02??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\beep\beep.h
?????文件???????1065??2015-05-28?11:37??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\key\key.c
?????文件????????451??2014-12-09?17:01??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\key\key.h
?????文件???????2342??2015-05-28?11:15??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\LED\led.c
?????文件????????182??2015-05-28?10:40??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\LED\led.h
?????文件???????1314??2015-05-28?11:25??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\SysTick\systick.c
?????文件????????121??2014-12-09?16:09??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\SysTick\systick.h
?????文件???????2301??2015-05-29?10:39??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\usart\usart.c
?????文件????????102??2014-12-11?16:57??庫函數(shù)版\實驗10:232串口通信\工程模板\APP\usart\usart.h
?????文件????????497??2015-06-05?10:54??庫函數(shù)版\實驗10:232串口通信\工程模板\Jli
?????文件????????285??2014-12-11?16:01??庫函數(shù)版\實驗10:232串口通信\工程模板\Jli
?????文件????????399??2011-04-23?10:24??庫函數(shù)版\實驗10:232串口通信\工程模板\keilkilll.bat
?????文件??????17273??2010-06-07?10:25??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\CoreSupport\core_cm3.c
?????文件??????85714??2011-02-09?14:59??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h
?????文件??????26297??2011-03-14?12:31??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\Release_Notes.html
?????文件??????15766??2011-03-10?10:52??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_cl.s
?????文件??????15503??2011-03-10?10:52??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_hd.s
?????文件??????15692??2011-03-10?10:52??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_hd_vl.s
?????文件??????12376??2011-03-10?10:52??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_ld.s
?????文件??????13656??2011-03-10?10:52??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_ld_vl.s
?????文件??????12765??2011-03-10?10:52??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_md.s
?????文件??????14073??2011-03-10?10:51??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_md_vl.s
?????文件??????15955??2011-03-10?10:51??庫函數(shù)版\實驗10:232串口通信\工程模板\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_xl.s
............此處省略8501個文件信息
- 上一篇:瑞芯微固件解包打包工具V11.zip
- 下一篇:最新b站后端源碼,學習使用
評論
共有 條評論