-
Notifications
You must be signed in to change notification settings - Fork 2
/
vanny-hub.h
43 lines (34 loc) · 826 Bytes
/
vanny-hub.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
#include <stdio.h>
#include <math.h>
#include <pico/stdlib.h>
#include <hardware/irq.h>
#include "display/display.h"
#define _VERBOSE
#define LED_PIN 25
#define BTN_PIN 21
//#define EPD_UPDATE_PARTIAL
#define EPD_FULL_REFRESH_AFTER 3
#define EPD_REFRESH_RATE_MS 60000
#define RS485_DCC50S_ADDRESS 0x01
#define RS485_LFP100S_ADDRESS 0xf7
#define RS232_RVR40_ADDRESS 0x01
#define STATS_MAX_HISTORY 168
#define STATS_UPDATE_ROLLING_MS 10000 // (secondly)
#define STATS_UPDATE_HISTORIC_MS 3600000 // (hourly)
typedef enum {
Overview,
Solar,
Alternator,
Statistics,
PageContentsCount,
} PageContents_t;
typedef struct {
uint16_t index;
float bat_soc;
float bat_v;
float load_w;
uint16_t sol_w;
uint16_t alt_w;
uint16_t charged_ah;
uint16_t discharged_ah;
} Statshot_t;