One Framework 0.1.0
RoboMaster嵌入式框架“一键”解决方案,为你的“创意”服务。
载入中...
搜索中...
未找到
buzzer.h
浏览该文件的文档.
1#ifndef PWM_BUZZER_H
2#define PWM_BUZZER_H
3
4#include <zephyr/device.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
18int pwm_buzzer_play_tone(const struct device *dev, uint32_t frequency_hz, uint8_t volume);
19
26int pwm_buzzer_stop(const struct device *dev);
27
35int pwm_buzzer_set_volume(const struct device *dev, uint8_t volume);
36
44int pwm_buzzer_get_volume(const struct device *dev, uint8_t *volume);
45
54int pwm_buzzer_play_note(const struct device *dev, float note_multiplier, uint8_t volume);
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif // PWM_BUZZER_H
int pwm_buzzer_play_note(const struct device *dev, float note_multiplier, uint8_t volume)
播放音符(基于基础频率的倍数)
定义 pwm_buzzer.c:104
int pwm_buzzer_set_volume(const struct device *dev, uint8_t volume)
设置蜂鸣器音量
定义 pwm_buzzer.c:70
int pwm_buzzer_play_tone(const struct device *dev, uint32_t frequency_hz, uint8_t volume)
播放指定频率的声音
定义 pwm_buzzer.c:28
int pwm_buzzer_stop(const struct device *dev)
停止播放声音
定义 pwm_buzzer.c:65
int pwm_buzzer_get_volume(const struct device *dev, uint8_t *volume)
获取当前音量
定义 pwm_buzzer.c:91