Skip to content

Commit 3376195

Browse files
authored
Merge pull request #13 from Forairaaaaa/add-display-driver-label
update v0.3
2 parents 611f2d6 + 639d9cc commit 3376195

15 files changed

Lines changed: 934 additions & 388 deletions

File tree

app/apps/app_launcher/view/panel_lcd_backlight.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ using namespace smooth_ui_toolkit::lvgl_cpp;
1818

1919
static const std::string _tag = "panel-lcd-bl";
2020

21-
static constexpr int16_t _label_pos_x = 591;
22-
static constexpr int16_t _label_pos_y = 94;
23-
static constexpr int16_t _btn_up_pos_x = 499;
24-
static constexpr int16_t _btn_up_pos_y = 166;
25-
static constexpr int16_t _btn_down_pos_x = 593;
26-
static constexpr int16_t _btn_down_pos_y = 166;
21+
static constexpr int16_t _label_pos_x = 595;
22+
static constexpr int16_t _label_pos_y = 107;
23+
static constexpr int16_t _label_panel_ic_x = -7;
24+
static constexpr int16_t _label_panel_ic_y = 74;
25+
static constexpr int16_t _btn_up_pos_x = 505;
26+
static constexpr int16_t _btn_up_pos_y = 176;
27+
static constexpr int16_t _btn_down_pos_x = 599;
28+
static constexpr int16_t _btn_down_pos_y = 176;
2729

2830
static constexpr int16_t _midi_up = 64 + 24;
2931
static constexpr int16_t _midi_down = 60 + 24;
@@ -38,6 +40,12 @@ void PanelLcdBacklight::init()
3840
_label_brightness->setTextColor(lv_color_hex(0xFEFEFE));
3941
_label_brightness->setText(fmt::format("{}", GetHAL()->getDisplayBrightness()));
4042

43+
_label_panel_ic = std::make_unique<Label>(lv_screen_active());
44+
_label_panel_ic->align(LV_ALIGN_RIGHT_MID, _label_panel_ic_x, _label_panel_ic_y);
45+
_label_panel_ic->setTextFont(&lv_font_montserrat_16);
46+
_label_panel_ic->setTextColor(lv_color_hex(0x55866D));
47+
_label_panel_ic->setText(fmt::format("LCD IC: {}", GetHAL()->getDisplayPanelIc()));
48+
4149
_btn_up = std::make_unique<Container>(lv_screen_active());
4250
_btn_up->align(LV_ALIGN_CENTER, _btn_up_pos_x, _btn_up_pos_y);
4351
_btn_up->setSize(81, 85);

app/apps/app_launcher/view/panel_spk_volume.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ using namespace smooth_ui_toolkit::lvgl_cpp;
1818

1919
static const std::string _tag = "panel-spk-vol";
2020

21-
static constexpr int16_t _label_pos_x = 605;
22-
static constexpr int16_t _label_pos_y = 240;
23-
static constexpr int16_t _btn_up_pos_x = 499;
24-
static constexpr int16_t _btn_up_pos_y = 312;
25-
static constexpr int16_t _btn_down_pos_x = 593;
26-
static constexpr int16_t _btn_down_pos_y = 312;
21+
static constexpr int16_t _label_pos_x = 606;
22+
static constexpr int16_t _label_pos_y = 247;
23+
static constexpr int16_t _btn_up_pos_x = 505;
24+
static constexpr int16_t _btn_up_pos_y = 314;
25+
static constexpr int16_t _btn_down_pos_x = 599;
26+
static constexpr int16_t _btn_down_pos_y = 314;
2727

2828
static constexpr int16_t _midi_up = 64 + 24;
2929
static constexpr int16_t _midi_down = 60 + 24;

app/apps/app_launcher/view/view.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class PanelLcdBacklight : public PanelBase {
5656

5757
private:
5858
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Label> _label_brightness;
59+
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Label> _label_panel_ic;
5960
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Container> _btn_up;
6061
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Container> _btn_down;
6162
smooth_ui_toolkit::AnimateValue _label_y_anim;

app/apps/app_startup_anim/app_startup_anim.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using namespace mooncake;
1313
using namespace smooth_ui_toolkit;
1414
using namespace smooth_ui_toolkit::lvgl_cpp;
1515

16-
#define FIRMWARE_VERSION "V0.2"
16+
#define FIRMWARE_VERSION "V0.3"
1717

1818
AppStartupAnim::AppStartupAnim()
1919
{

app/assets/images/launcher_bg.c

Lines changed: 295 additions & 295 deletions
Large diffs are not rendered by default.

app/hal/hal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ class HalBase {
7373
{
7474
return 0;
7575
}
76+
virtual std::string getDisplayPanelIc()
77+
{
78+
return "ILI9881C";
79+
// return "ST7123";
80+
}
7681

7782
/* ---------------------------------- Lvgl ---------------------------------- */
7883
lv_indev_t* lvTouchpad = nullptr;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
idf_component_register(SRCS "esp_lcd_st7121.c"
2+
INCLUDE_DIRS "include"
3+
REQUIRES "esp_lcd")
4+
5+
include(package_manager)
6+
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ST7121

0 commit comments

Comments
 (0)