Skip to content

Commit f17ad04

Browse files
committed
more UI elements added into DASH, such as HV state and voltage from lvpdb
1 parent c1eeb69 commit f17ad04

15 files changed

Lines changed: 43 additions & 12 deletions

File tree

BMS/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.1
1+
1.5.2

DART/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.1
1+
1.5.2

DASH/Core/User/Inc/FEB_CAN_BMS.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ typedef enum
3333

3434
void FEB_CAN_BMS_Init(void);
3535
BMS_State_t FEB_CAN_BMS_GetLastState(void);
36+
bool FEB_CAN_BMS_GetLastHVState(void);
3637
int16_t FEB_CAN_BMS_GetLastCellMaxTemperature(void);
3738
uint16_t FEB_CAN_BMS_GetLastAccumulatorTotalVoltage(void);
3839
bool FEB_CAN_BMS_IsDataFresh(uint32_t timeout_ms);

DASH/Core/User/Src/FEB_CAN_BMS.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ void FEB_CAN_BMS_Init(void)
121121
FEB_CAN_RX_Register(&rx_params_bms_voltage);
122122
}
123123

124+
bool FEB_CAN_BMS_GetLastHVState()
125+
{
126+
return ((bms_data.state == BMS_STATE_DRIVE) || (bms_data.state == BMS_STATE_ENERGIZED) ||
127+
(bms_data.state == BMS_STATE_PRECHARGE) || (bms_data.state == BMS_STATE_CHARGER_PRECHARGE) ||
128+
(bms_data.state == BMS_STATE_CHARGING) || (bms_data.state == BMS_STATE_BALANCE));
129+
}
130+
124131
BMS_State_t FEB_CAN_BMS_GetLastState(void)
125132
{
126133
return bms_data.state;

DASH/Core/User/Src/UI_Elements/FEB_UI_BMS_State.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "FEB_CAN_BMS.h"
22
#include "FEB_CAN_PCU.h"
3+
#include "FEB_CAN_LVPDB.h"
34
#include "lvgl.h"
45
#include "src/core/lv_obj.h"
56
#include "src/core/lv_obj_style.h"
@@ -13,23 +14,31 @@
1314
static lv_obj_t *ui_BMS_State_String;
1415
static lv_obj_t *ui_BMS_Cell_Max_Temperature;
1516
static lv_obj_t *ui_BMS_Accumulator_Total_Voltage;
17+
static lv_obj_t *ui_BMS_HV_State_String;
18+
static lv_obj_t *ui_LVPDB_low_voltage;
1619

1720
int16_t cell_max_temperature = 67;
1821
uint16_t accumulator_total_voltage = 67;
22+
uint16_t low_voltage = 67;
1923

2024
char buf[16];
2125

2226
void FEB_UI_Update_BMS_State()
2327
{
2428
BMS_State_t state = FEB_CAN_BMS_GetLastState();
2529
lv_label_set_text(ui_BMS_State_String, to_BMS_state_string(state));
30+
lv_label_set_text(ui_BMS_HV_State_String, (FEB_CAN_BMS_GetLastHVState() ? "HV_ON" : "HV_OFF"));
2631

2732
cell_max_temperature = FEB_CAN_BMS_GetLastCellMaxTemperature();
2833
accumulator_total_voltage = FEB_CAN_BMS_GetLastAccumulatorTotalVoltage();
34+
low_voltage = FEB_CAN_LVPDB_GetLast24VVoltage();
2935

3036
snprintf(buf, sizeof(buf), "%d.%d °C", cell_max_temperature / 10, cell_max_temperature % 10);
3137
lv_label_set_text(ui_BMS_Cell_Max_Temperature, buf);
3238

39+
snprintf(buf, sizeof(buf), "%d.%d V", low_voltage / 10, low_voltage % 10);
40+
lv_label_set_text(ui_LVPDB_low_voltage, buf);
41+
3342
snprintf(buf, sizeof(buf), "%d.%d V", accumulator_total_voltage / 10, accumulator_total_voltage % 10);
3443
lv_label_set_text(ui_BMS_Accumulator_Total_Voltage, buf);
3544
}
@@ -42,6 +51,12 @@ void FEB_UI_Init_BMS_State(lv_obj_t *ui_Screen)
4251
lv_obj_set_style_text_font(ui_BMS_State_String, &lv_font_montserrat_40, 0);
4352
lv_obj_set_style_text_color(ui_BMS_State_String, lv_color_hex(0xFFFFFF), 0);
4453

54+
ui_BMS_HV_State_String = lv_label_create(ui_Screen);
55+
lv_obj_align(ui_BMS_HV_State_String, LV_ALIGN_BOTTOM_RIGHT, -15, -35);
56+
lv_label_set_text(ui_BMS_HV_State_String, "---");
57+
lv_obj_set_style_text_font(ui_BMS_HV_State_String, &lv_font_montserrat_40, 0);
58+
lv_obj_set_style_text_color(ui_BMS_HV_State_String, lv_color_hex(0xFFFFFF), 0);
59+
4560
ui_BMS_Cell_Max_Temperature = lv_label_create(ui_Screen);
4661
lv_obj_align(ui_BMS_Cell_Max_Temperature, LV_ALIGN_TOP_LEFT, 15, 60);
4762
lv_label_set_text(ui_BMS_Cell_Max_Temperature, "--.- °C");
@@ -53,13 +68,21 @@ void FEB_UI_Init_BMS_State(lv_obj_t *ui_Screen)
5368
lv_label_set_text(ui_BMS_Accumulator_Total_Voltage, "---.- V");
5469
lv_obj_set_style_text_font(ui_BMS_Accumulator_Total_Voltage, &lv_font_montserrat_40, 0);
5570
lv_obj_set_style_text_color(ui_BMS_Accumulator_Total_Voltage, lv_color_hex(0xFFFFFF), 0);
71+
72+
ui_LVPDB_low_voltage = lv_label_create(ui_Screen);
73+
lv_obj_align(ui_LVPDB_low_voltage, LV_ALIGN_TOP_RIGHT, -15, 40);
74+
lv_label_set_text(ui_LVPDB_low_voltage, "--.- V");
75+
lv_obj_set_style_text_font(ui_LVPDB_low_voltage, &lv_font_montserrat_40, 0);
76+
lv_obj_set_style_text_color(ui_LVPDB_low_voltage, lv_color_hex(0xFFFFFF), 0);
5677
}
5778

5879
void FEB_UI_Destroy_BMS_State(void)
5980
{
6081
ui_BMS_State_String = NULL;
82+
ui_BMS_HV_State_String = NULL;
6183
ui_BMS_Cell_Max_Temperature = NULL;
6284
ui_BMS_Accumulator_Total_Voltage = NULL;
85+
ui_LVPDB_low_voltage = NULL;
6386
}
6487

6588
char *to_BMS_state_string(BMS_State_t state)

DASH/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.1
1+
1.5.2

DCU/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.1
1+
1.5.2

LVPDB/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.1
1+
1.5.2

PCU/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.1
1+
1.5.2

Sensor_Nodes/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.1
1+
1.5.2

0 commit comments

Comments
 (0)