guanjiao ren
2018-05-27 8bb8fdc8ea89e54ee0cfea17377b33d61d5940fa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "beep.h"
 
void Beep_Init(void)
{
    GPIO_InitTypeDef GPIO_InitStructure;
        
    /* Enable GPIO clock */
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
 
    // Enable GPIO used for beep
    GPIO_InitStructure.GPIO_Pin = BEEP_PIN | BEEP2_PIN;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(BEEP_GPIO, &GPIO_InitStructure);
}