|
4 | 4 |
|
5 | 5 | namespace GENERAL_CONSTANTS
|
6 | 6 | {
|
7 |
| - static const int32_t VACUUM = 0; |
8 |
| - static const int32_t ATMOSPHERE = 15; |
| 7 | + static const uint32_t VACUUM = 0; |
| 8 | + static const uint32_t ATMOSPHERE = 15; |
9 | 9 |
|
10 |
| - static const int32_t CLOSED = 0; |
11 |
| - static const int32_t OPEN = 1; |
| 10 | + static const uint32_t CLOSED = 0; |
| 11 | + static const uint32_t OPEN = 1; |
12 | 12 |
|
13 | 13 | static const int32_t FLAGS_GOOD = -1;
|
14 | 14 |
|
15 | 15 | static const float REAR_WHEEL_CIRCUMFRENCE = 0.933619f;
|
16 | 16 | static const float STRIP_DISTANCE = 30.48;
|
17 | 17 |
|
18 |
| - static const int32_t NAV_SERIAL_MESSAGE_SIZE = 10; |
| 18 | + static const uint32_t NAV_SERIAL_MESSAGE_SIZE = 7; |
19 | 19 | };
|
20 | 20 |
|
21 | 21 | namespace CONNECTION_FLAGS
|
22 | 22 | {
|
23 |
| - static const int32_t TOTAL_CONNECTION_COUNT = 6; // update if you add |
24 |
| - static const int32_t BRAKE_NODE_HEARTBEAT_INDEX = 0; |
25 |
| - static const int32_t LVDC_NODE_HEARTBEAT_INDEX = 1; |
26 |
| - static const int32_t BMS_HEARTBEAT_INDEX = 2; |
27 |
| - static const int32_t INTERFACE_HEARTBEAT_INDEX = 3; |
28 |
| - static const int32_t ENCLOSURE_HEARTBEAT_INDEX = 4; |
29 |
| - static const int32_t NAVIGATION_HEARTBEAT_INDEX = 5; |
| 23 | + static const uint32_t TOTAL_CONNECTION_COUNT = 6; // update if you add |
| 24 | + static const uint32_t BRAKE_NODE_HEARTBEAT_INDEX = 0; |
| 25 | + static const uint32_t LVDC_NODE_HEARTBEAT_INDEX = 1; |
| 26 | + static const uint32_t BMS_HEARTBEAT_INDEX = 2; |
| 27 | + static const uint32_t INTERFACE_HEARTBEAT_INDEX = 3; |
| 28 | + static const uint32_t ENCLOSURE_HEARTBEAT_INDEX = 4; |
| 29 | + static const uint32_t NAVIGATION_HEARTBEAT_INDEX = 5; |
30 | 30 | };
|
31 | 31 |
|
32 | 32 | // Inverter Sensor Flag Indices
|
33 |
| - namespace INVERTER_FLAGS |
| 33 | +namespace INVERTER_FLAGS |
34 | 34 | {
|
35 |
| - static const int32_t INVERTER_SENSOR_COUNT = 5; // update if you add |
36 |
| - static const int32_t MOTOR_TEMPERATURE_INDEX = 0; |
37 |
| - static const int32_t BUS_VOLTAGE_INDEX = 1; |
38 |
| - static const int32_t GATE_DRIVER_TEMP_INDEX = 2; |
39 |
| - static const int32_t CONTROL_BOARD_TEMP_INDEX = 3; |
40 |
| - static const int32_t MAX_IGBT_INDEX = 4; |
41 |
| - |
| 35 | + static const uint32_t INVERTER_SENSOR_COUNT = 5; // update if you add |
| 36 | + static const uint32_t MOTOR_TEMPERATURE_INDEX = 0; |
| 37 | + static const uint32_t BUS_VOLTAGE_INDEX = 1; |
| 38 | + static const uint32_t GATE_DRIVER_TEMP_INDEX = 2; |
| 39 | + static const uint32_t CONTROL_BOARD_TEMP_INDEX = 3; |
| 40 | + static const uint32_t MAX_IGBT_INDEX = 4; |
42 | 41 |
|
43 | 42 | static const int32_t INVERTER_FAULT_COUNT = 4;
|
44 | 43 | static const int32_t POST_FAULT_LO_INDEX = 0;
|
45 | 44 | static const int32_t POST_FAULT_HI_INDEX = 1;
|
46 | 45 | static const int32_t RUN_FAULT_LO_INDEX = 2;
|
47 | 46 | static const int32_t RUN_FAULT_HI_INDEX = 3;
|
48 |
| - |
49 | 47 | };
|
50 | 48 |
|
| 49 | +// Inverter Hi Fault mapping |
| 50 | +namespace INVERTER_RUN_FAULT_HI |
| 51 | +{ |
| 52 | + static const uint32_t RESOLVER_NOT_CONNECTED = 0x4000; |
| 53 | +} |
| 54 | + |
51 | 55 | // BMS Sensor Flag Indices
|
52 |
| - namespace BMS_FLAGS |
| 56 | +namespace BMS_FLAGS |
53 | 57 | {
|
54 |
| - static const int32_t BMS_SENSOR_COUNT = 9; // update if you add |
55 |
| - static const int32_t HV_PACK_VOLTAGE_INDEX = 0; |
56 |
| - static const int32_t HV_MAX_CELL_TEMP_INDEX = 1; |
57 |
| - static const int32_t HV_SOC_INDEX = 2; |
58 |
| - |
59 |
| - static const int32_t LV1_PACK_VOLTAGE_INDEX = 3; |
60 |
| - static const int32_t LV1_CELL_TEMP_INDEX = 4; |
61 |
| - static const int32_t LV1_SOC_INDEX = 5; |
62 |
| - |
63 |
| - static const int32_t LV2_PACK_VOLTAGE_INDEX = 6; |
64 |
| - static const int32_t LV2_CELL_TEMP_INDEX = 7; |
65 |
| - static const int32_t LV2_SOC_INDEX = 8; |
| 58 | + static const uint32_t BMS_SENSOR_COUNT = 9; // update if you add |
| 59 | + static const uint32_t HV_PACK_VOLTAGE_INDEX = 0; |
| 60 | + static const uint32_t HV_MAX_CELL_TEMP_INDEX = 1; |
| 61 | + static const uint32_t HV_SOC_INDEX = 2; |
| 62 | + |
| 63 | + static const uint32_t LV1_PACK_VOLTAGE_INDEX = 3; |
| 64 | + static const uint32_t LV1_CELL_TEMP_INDEX = 4; |
| 65 | + static const uint32_t LV1_SOC_INDEX = 5; |
| 66 | + |
| 67 | + static const uint32_t LV2_PACK_VOLTAGE_INDEX = 6; |
| 68 | + static const uint32_t LV2_CELL_TEMP_INDEX = 7; |
| 69 | + static const uint32_t LV2_SOC_INDEX = 8; |
66 | 70 | };
|
67 | 71 |
|
68 | 72 | // Node Sensor Flag indices
|
69 |
| - namespace NODE_FLAGS |
| 73 | +namespace NODE_FLAGS |
70 | 74 | {
|
71 |
| - static const int32_t NODE_SENSOR_COUNT = 10; // update if you add |
72 |
| - static const int32_t LP1_INDEX = 0; |
73 |
| - static const int32_t LP2_INDEX = 1; |
74 |
| - static const int32_t LP3_INDEX = 2; |
75 |
| - static const int32_t LP4_INDEX = 3; |
76 |
| - static const int32_t HP_INDEX = 4; |
77 |
| - static const int32_t HP_TEMP_INDEX = 5; |
78 |
| - static const int32_t ENCLOSURE_PRESSURE_INDEX = 6; |
79 |
| - static const int32_t ENCLOSURE_TEMPERATURE_INDEX = 7; |
80 |
| - static const int32_t COOLING_PRESSURE_INDEX = 8; |
81 |
| - static const int32_t COOLING_TEMPERATURE_INDEX = 9; |
| 75 | + static const uint32_t NODE_SENSOR_COUNT = 10; // update if you add |
| 76 | + static const uint32_t LP1_INDEX = 0; |
| 77 | + static const uint32_t LP2_INDEX = 1; |
| 78 | + static const uint32_t LP3_INDEX = 2; |
| 79 | + static const uint32_t LP4_INDEX = 3; |
| 80 | + static const uint32_t HP_INDEX = 4; |
| 81 | + static const uint32_t HP_TEMP_INDEX = 5; |
| 82 | + static const uint32_t ENCLOSURE_PRESSURE_INDEX = 6; |
| 83 | + static const uint32_t ENCLOSURE_TEMPERATURE_INDEX = 7; |
| 84 | + static const uint32_t COOLING_PRESSURE_INDEX = 8; |
| 85 | + static const uint32_t COOLING_TEMPERATURE_INDEX = 9; |
82 | 86 | };
|
83 | 87 |
|
84 | 88 | // Solenoid Status indices
|
85 |
| - namespace SOLENOID_INDEX |
| 89 | +namespace SOLENOID_INDEX |
86 | 90 | {
|
87 |
| - static const int32_t SOL1 = 0; // update if you add |
88 |
| - static const int32_t SOL2 = 1; |
89 |
| - static const int32_t SOL3 = 2; |
90 |
| - static const int32_t SOL4 = 3; |
| 91 | + static const uint32_t SOL1 = 0; // update if you add |
| 92 | + static const uint32_t SOL2 = 1; |
| 93 | + static const uint32_t SOL3 = 2; |
| 94 | + static const uint32_t SOL4 = 3; |
91 | 95 | };
|
92 | 96 |
|
| 97 | +namespace CAN_IDS |
| 98 | +{ |
| 99 | + static const uint32_t TEMP1_10HZ = 0x0A0; |
| 100 | + static const uint32_t TEMP2_10HZ = 0x0A1; |
| 101 | + static const uint32_t TEMP3_10HZ = 0x0A2; |
| 102 | + static const uint32_t MOTOR_POS_100HZ = 0x0A5; |
| 103 | + static const uint32_t CURRENT_100HZ = 0x0A6; |
| 104 | + static const uint32_t VOLTAGE_100HZ = 0x0A7; |
| 105 | + |
| 106 | +}; |
93 | 107 |
|
94 | 108 | namespace NetworkConstants
|
95 | 109 | {
|
96 |
| - static const int32_t iCONFIG_SERVER_PORT = 3001; |
| 110 | + static const uint32_t iCONFIG_SERVER_PORT = 3001; |
97 | 111 | }
|
98 | 112 |
|
99 | 113 | #endif //FLIGHTCOMPUTER_CONSTANTS_H
|
0 commit comments