-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.h
78 lines (59 loc) · 1.22 KB
/
app.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* app.h
*
* Created on: Oct 11, 2022
* Author: bhat
*/
#ifndef SRC_APP_H_
#define SRC_APP_H_
#include "event.h"
#include <stdlib.h>
#include "io/timer.h"
#include "io/mic.h"
#include "io/button.h"
#include "io/encoder.h"
#include "virtio/encoder.h"
#include "virtio/button.h"
#include "io/lcd.h"
#include "virtio/tone.h"
#include "virtio/periodic.h"
#include "virtio/prompt.h"
#include "main_page.h"
#include "chroma.h"
#include "hist.h"
struct App;
void app_initialize(struct App* self);
void app_main_loop(struct App* self);
void app_open_chroma(struct App* self);
enum AppState {
App_Main,
App_Chroma,
};
struct App {
// Main event loop
struct EventLoop event_loop;
// States
float f_s;
enum AppState state;
// Sensors
struct Timer timer;
struct Mic mic;
struct Encoder encoder;
struct Button btn;
// Virtual sensors
struct VirtEncoder virt_encoder;
struct VirtButton encoder_btn;
struct VirtButton btn_left;
struct VirtButton btn_right;
struct VirtButton btn_top;
struct VirtButton btn_bottom;
// Actuators
struct Lcd lcd;
// Virtual actuators
struct MainPage* main_page;
struct Chroma* chroma;
struct Hist* hist;
// Signals
};
struct App app_new(unsigned int tick);
#endif /* SRC_APP_H_ */