Logic_library
Library for Logic board by RoboticsBrno.
Loading...
Searching...
No Matches
Logic.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "Buttons.hpp"
5#include "Buzzer.hpp"
6#include "Display.hpp"
7#include "Nvs.hpp"
8#include "Platform.hpp"
9#include "StatusBar.hpp"
10#include <bitset>
11#include <eventpp/callbacklist.h>
12#include <functional>
13
14class Logic {
15 friend class Buttons;
16 friend void trampoline(void*);
17
18private:
19 const char* m_tag = "Logic";
20
21 Display m_display;
22 StatusBar m_statusBar;
23 Buttons m_buttons;
24 Buzzer m_buzzer;
25
26 Logic();
27
28public:
29 Logic(Logic&) = delete;
30 Logic(Logic&&) = delete;
31 Logic& operator=(Logic&) = delete;
32 Logic& operator=(Logic&&) = delete;
33
34 static Logic& IRAM_ATTR singleton();
35
36 void init();
37 void turnOnLeds();
38 void turnOffLeds();
39
40 ~Logic() = default;
41
45 Buzzer& buzzer();
46 Nvs& nvs();
47};
48
49void logicMain();
50
51extern Logic& logic;
52extern Display& display;
53extern StatusBar& statusBar;
54extern Buttons& buttons;
55extern Buzzer& buzzer;
Logic & logic
Definition: Logic.cpp:62
StatusBar & statusBar
Definition: Logic.cpp:64
Display & display
Definition: Logic.cpp:63
Buzzer & buzzer
Definition: Logic.cpp:66
void logicMain()
Buttons & buttons
Definition: Logic.cpp:65
Definition: Buttons.hpp:17
Definition: Buzzer.hpp:10
Definition: Display.hpp:28
Definition: Logic.hpp:14
Nvs & nvs()
Definition: Logic.cpp:57
Buzzer & buzzer()
Definition: Logic.cpp:53
~Logic()=default
Display & display()
Definition: Logic.cpp:45
Logic & operator=(Logic &)=delete
Logic(Logic &)=delete
Buttons & buttons()
Definition: Logic.cpp:49
Logic(Logic &&)=delete
StatusBar & statusBar()
Definition: Logic.cpp:41
void turnOffLeds()
Definition: Logic.cpp:37
friend void trampoline(void *)
Logic & operator=(Logic &&)=delete
void turnOnLeds()
Definition: Logic.cpp:33
static Logic &IRAM_ATTR singleton()
Definition: Logic.cpp:16
void init()
Definition: Logic.cpp:21
Definition: Nvs.hpp:9
Definition: StatusBar.hpp:18