Skip to content

Commit 8087b23

Browse files
facchinmpennam
authored andcommitted
giga: display: add landscape configuration
1 parent ffc84c8 commit 8087b23

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#include <lvgl.h>
22

33
void portenta_init_video();
4-
void giga_init_video();
4+
void giga_init_video(bool landscape = true);

libraries/Portenta_lvgl/src/lv_conf.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#define LV_VER_RES_MAX (800)
2929
#endif
3030

31+
//#define CONFIG_LV_USE_GPU_STM32_DMA2D 1
32+
//#define CONFIG_LV_GPU_DMA2D_CMSIS_INCLUDE "stm32h747xx.h"
33+
3134
/* Color depth:
3235
* - 1: 1 byte per pixel
3336
* - 8: RGB233

libraries/Portenta_lvgl/src/porting.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void portenta_init_video() {
188188
#include "Portenta_Video.h"
189189
#include "video_modes.h"
190190

191-
void giga_init_video() {
191+
void giga_init_video(bool landscape) {
192192
// put your setup code here, to run once:
193193
int ret = -1;
194194

@@ -236,6 +236,10 @@ void giga_init_video() {
236236
disp_drv.draw_buf = &disp_buf;
237237
disp_drv.hor_res = lcd_x_size;
238238
disp_drv.ver_res = lcd_y_size;
239+
if (landscape) {
240+
disp_drv.rotated = LV_DISP_ROT_90;
241+
disp_drv.sw_rotate = 1;
242+
}
239243

240244
lv_disp_drv_register(&disp_drv);
241245

0 commit comments

Comments
 (0)