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
#[derive(Debug)]
pub struct FwVersion {
pub major: u8,
pub minor: u8,
pub hw: [u8; 10],
pub uuid: [u8; 12],
}
#[derive(Debug)]
pub struct Values {
pub temp_fet: f32,
pub temp_motor: f32,
pub motor_current: f32,
pub input_current: f32,
pub id: f32,
pub iq: f32,
pub duty_cycle: f32,
pub rpm: f32,
pub input_voltage: f32,
pub amp_hours: f32,
pub amp_hours_charged: f32,
pub watt_hours: f32,
pub watt_hours_charged: f32,
pub tachometer: u32,
pub tachometer_abs: u32,
pub fault: Fault,
pub pid_pos: f32,
pub controller_id: u8,
}
#[derive(Debug)]
pub enum Fault {
None,
OverVoltage,
UnderVoltage,
Drv,
AbsOverCurrent,
OverTempFet,
OverTempMotor,
}