Logic_library
Library for Logic board by RoboticsBrno.
Loading...
Searching...
No Matches
Buzzer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Platform.hpp"
4#include "driver/ledc.h"
5#include <driver/gpio.h>
6
7#include <cstdint>
8#include <mutex>
9
10class Buzzer {
11 friend class Logic;
12
13private:
14 Buzzer();
15
16 bool m_on = false;
17 std::uint32_t m_frequency = 440;
18
19 std::mutex m_mutex;
20
21public:
22 Buzzer(Buzzer&) = delete;
23 Buzzer& operator=(Buzzer&) = delete;
24
30 void setFrequency(std::uint32_t frequency);
31
38 bool isOn() const;
39
44 void on();
45
51 void on(std::uint32_t frequency);
52
57 void off();
58
63 void nastavitFrekvenci(std::uint32_t frekvence);
64
71 bool jeZapnuty() const;
72
77 void zapnout();
78
84 void zapnout(std::uint32_t frekvence);
85
90 void vypnout();
91};
Definition: Buzzer.hpp:10
Buzzer & operator=(Buzzer &)=delete
bool jeZapnuty() const
Vrátí aktuální stav bzučáku.
Definition: Buzzer.cpp:82
void vypnout()
Vypne bzučák.
Definition: Buzzer.cpp:94
void off()
Turn buzzer off.
Definition: Buzzer.cpp:71
Buzzer(Buzzer &)=delete
bool isOn() const
Get state of buzzer.
Definition: Buzzer.cpp:49
void on()
Turn buzzer on.
Definition: Buzzer.cpp:53
void nastavitFrekvenci(std::uint32_t frekvence)
Nastaví frekvenci bzučáku.
Definition: Buzzer.cpp:98
void setFrequency(std::uint32_t frequency)
Set frequency of buzzer.
Definition: Buzzer.cpp:37
void zapnout()
Zapne bzučák.
Definition: Buzzer.cpp:86
Definition: Logic.hpp:14