Skip to content

Commit

Permalink
add disp offsets for 170x320px st7789 displays
Browse files Browse the repository at this point in the history
  • Loading branch information
hiruna committed May 30, 2023
1 parent f22026c commit 16f9f93
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lvgl_tft/st7789.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,17 @@ void st7789_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * colo
offsety1 += 40;
offsety2 += 40;
#endif
#elif (LV_HOR_RES_MAX == 320) && (LV_VER_RES_MAX == 170) // 1.9 inch 170×320 LCD, physically landscape
#if (CONFIG_LV_DISPLAY_ORIENTATION_PORTRAIT) || (CONFIG_LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
offsety1 += 35;
offsety2 += 35;
#endif
#elif (LV_HOR_RES_MAX == 170) && (LV_VER_RES_MAX == 320) // 1.9 inch 170×320 LCD, physically vertical
#if (CONFIG_LV_DISPLAY_ORIENTATION_LANDSCAPE) || (CONFIG_LV_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
offsetx1 += 35;
offsetx2 += 35;
#endif
#endif

/*Column addresses*/
st7789_send_cmd(ST7789_CASET);
data[0] = (offsetx1 >> 8) & 0xFF;
Expand Down

0 comments on commit 16f9f93

Please sign in to comment.