Veethree D7 SDK
Loading...
Searching...
No Matches
buzzer_impl.h
1#ifndef BUZZER_IMPL_H
2#define BUZZER_IMPL_H
3
4#include "buzzer_impl_interface.h"
5#include "vsdk_config.h"
6
7#include <liblog/log.h>
8#include <utils/fmt_wrapper.h>
9
10#include <array>
11#include <fstream>
12#include <gpiod.hpp>
13#include <map>
14#include <string>
15#include <thread>
16#include <tuple>
17
18namespace vsdk::sys {
22struct buzzer_impl : public buzzer_impl_interface {
23 buzzer_impl();
24
29 void set_boost_level(buzzer_boost level) override;
30
35 void enable_boost(bool enable) override;
41 void buzzer_enable(bool enable, const buzzer_config& cfg) override;
42
43private:
44 buzzer_boost _current_level{};
45 std::map<buzzer_boost, gpiod::line> _booster_lines;
46 gpiod::line _booster_enable;
47};
48}; // namespace vsdk::sys
49
50#endif /* BUZZER_IMPL_H */
Include this file to your file so you have access to fmtlib header-only implementation.
Logging interface.
Any entities that belong to the system library.
buzzer_boost
Define how loud the buzzer will be, the default value is the quietest no_boost while boost5 is the lo...
Definition buzzer_common.h:14
The config class In case the buzzer requires customisation, period and duty cycle can be modified,...
Definition buzzer_common.h:36
void buzzer_enable(bool enable, const buzzer_config &cfg) override
Enable or disable the buzzer by taking a custom buzzer setup. See buzzer_config.
void enable_boost(bool enable) override
Enable or disable boost.
void set_boost_level(buzzer_boost level) override
Set the boost level.