-
Notifications
You must be signed in to change notification settings - Fork 25
/
davega_screen.h
70 lines (59 loc) · 1.93 KB
/
davega_screen.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
/*
Copyright 2018 Jan Pomikalek <jan.pomikalek@gmail.com>
This file is part of the DAVEga firmware.
DAVEga firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAVEga firmware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DAVEga firmware. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef DAVEGA_SCREEN_H
#define DAVEGA_SCREEN_H
#include "davega_data.h"
typedef enum {
SCR_FW_VERSION = 0,
SCR_MOSFET_TEMPERATURE,
SCR_MOTOR_TEMPERATURE,
SCR_MOTOR_CURRENT,
SCR_BATTERY_CURRENT,
SCR_DUTY_CYCLE,
SCR_TOTAL_VOLTAGE,
SCR_MIN_TOTAL_VOLTAGE,
SCR_AVG_CELL_VOLTAGE,
SCR_BATTERY_CAPACITY_MAH,
SCR_BATTERY_CAPACITY_PERCENT,
SCR_TRIP_DISTANCE,
SCR_TOTAL_DISTANCE,
SCR_SPEED,
SCR_MAX_SPEED,
SCR_AVG_SPEED,
SCR_TIME_ELAPSED,
SCR_TIME_RIDING,
SCR_FAULT_CODE
} t_screen_item;
typedef struct {
const char* fw_version;
bool imperial_units;
bool use_fahrenheit;
bool per_cell_voltage;
uint8_t battery_cells;
bool big_font;
t_screen_item* text_screen_items;
uint8_t text_screen_items_count;
uint8_t orientation;
} t_davega_screen_config;
class DavegaScreen {
public:
virtual void init(t_davega_screen_config* config) { _config = config; };
virtual void reset() = 0;
virtual void update(t_davega_data* data) = 0;
virtual void heartbeat(uint32_t duration_ms, bool successful_vesc_read) = 0;
protected:
t_davega_screen_config* _config;
};
#endif //DAVEGA_SCREEN_H