/*********************************************************************************
|
* Copyright: (C) 2018 LingYun IoT System Studio
|
* All rights reserved.
|
*
|
* Filename: beep.h
|
* Description: This file is used to control Passive buzzer or Active buzzer
|
*
|
* pi@raspberrypi:~ $ gpio readall show BCM and wPi pinmap
|
*
|
* VCC ---- 5V/3.3V
|
* GND ---- GND
|
* I/O ---- GPIO.18 ---- GPIO.1
|
* BCM wPi
|
*
|
* Version: 1.0.0(2018/10/14)
|
* Author: Guo Wenxue <guowenxue@gmail.com>
|
* ChangeLog: 1, Release initial version on "2018/10/14 12:13:26"
|
*
|
********************************************************************************/
|
|
#ifndef __BEEP_H
|
#define __BEEP_H
|
|
#define OFF 0
|
#define ON 1
|
|
//#define CONFIG_ACTV_BEEP
|
|
#define BEEP_FREQ 2400
|
|
/* Use Pin12 == GPIO18(BCM) == GPIO.1(wPi) */
|
#define PWM_PIN 1
|
|
int turn_passive_beep(int cmd, int freq);
|
|
int turn_active_beep(int cmd);
|
|
/* Only passive buzzer can play tone */
|
#ifndef CONFIG_ACTV_BEEP
|
void play_little_star(void);
|
#endif
|
|
#endif
|