/**********************************************************************
|
* Copyright: (C)2024 LingYun IoT System Studio
|
* Author: GuoWenxue<guowenxue@gmail.com>
|
* Description: ISKBoard buzzer/beeper driver and music play
|
*
|
* ChangeLog:
|
* Version Date Author Description
|
* V1.0.0 2024.08.29 GuoWenxue Release initial version
|
***********************************************************************/
|
|
#ifndef __BUZZER_H
|
#define __BUZZER_H
|
|
typedef struct
|
{
|
uint32_t freq; /* 音符频率,0表示休止 */
|
uint32_t duration; /* 持续时间(ms) */
|
} Note_t;
|
|
/**
|
* @brief 让蜂鸣器响 $times 次,每次间隔 $interval 毫秒
|
*/
|
extern void beep_start(uint16_t times, uint16_t interval);
|
|
/**
|
* @brief 播放歌曲
|
*/
|
extern void Play_Song(const Note_t *song, uint32_t note_count);
|
|
extern const Note_t twinkle[];
|
extern const uint32_t twinkle_count;
|
extern const Note_t happy_birthday[];
|
extern const uint32_t happy_birthday_count;
|
extern const Note_t jingle_bells[];
|
extern const uint32_t jingle_bells_count;
|
|
#endif
|