Demo entry 6731004

s

   

Submitted by anonymous on Apr 10, 2018 at 05:55
Language: C. Code size: 642 Bytes.

/*
文件名:Beeper.h
说  明:蜂鸣器基础驱动头文件
*/
#include "stm32f1xx_hal.h"

#ifndef _BEEPER_H_
#define _BEEPER_H_

#define BEEPER_PORT GPIOA
#define BEEPER_PIN GPIO_PIN_12
#define BEEPER_CLOCK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()

typedef enum
{
	BEEPER_ON  = 0,
	BEEPER_OFF = 1
} Beep_StateType;//蜂鸣器状态枚举

#define IS_BEEPER_STATE(BEEPER_STATE) (BEEP_STATE == BEEPER_ON || BEEPER_STATE ==BEEPER_OFF)

void Beeper_Init();
Beep_StateType Beeper_StateGet();
void Beeper_StateSet(Beep_StateType Beep_State);

#define BEEPER_ON() Beeper_StateSet(BEEPER_ON);//开蜂鸣器
#define BEEPER_OFF() Beeper_StateSet(BEEPER_OFF);//关蜂鸣器


#endif

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).