-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSAB_readings_rear.h
40 lines (32 loc) · 1.32 KB
/
SAB_readings_rear.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
#pragma once
#include <string.h>
#include <stdint.h>
#pragma pack(push,1)
// @Parseclass
class SAB_readings_rear {
public:
SAB_readings_rear() = default;
SAB_readings_rear(const uint8_t buf[8]) { load(buf); }
inline void load(const uint8_t buf[8]) { memcpy(this, buf, sizeof(*this)); }
inline void write(uint8_t buf[8]) const { memcpy(buf, this, sizeof(*this)); }
// Getters
inline uint16_t get_sensor_1() const { return sensor_1; }
inline uint16_t get_sensor_2() const { return sensor_2; }
inline uint16_t get_sensor_3() const { return sensor_3; }
inline uint16_t get_sensor_4() const { return sensor_4; }
// Setters
inline void set_sensor_1(uint16_t reading) { sensor_1 = reading; }
inline void set_sensor_2(uint16_t reading) { sensor_2 = reading; }
inline void set_sensor_3(uint16_t reading) { sensor_3 = reading; }
inline void set_sensor_4(uint16_t reading) { sensor_4 = reading; }
private:
// @Parse @Name(cooling_loop_fluid_temp) @Unit(C) @Scale(1000)
uint16_t sensor_1;
// @Parse @Name(amb_air_temp) @Unit(C) @Scale(1000)
uint16_t sensor_2;
// @Parse @Name(bl_susp_lin_pot) @Unit(mm) @Scale(1000)
uint16_t sensor_3;
// @Parse @Name(br_susp_lin_pot) @Unit(mm) @Scale(1000)
uint16_t sensor_4;
};
#pragma pack(pop)