@@ -37,50 +37,50 @@ int H7_Video::begin(bool landscape) {
37
37
38
38
#if defined(ARDUINO_PORTENTA_H7_M7)
39
39
if (_shield == NONE_SHIELD) {
40
- struct edid recognized_edid;
41
- int err_code = 0 ;
40
+ struct edid recognized_edid;
41
+ int err_code = 0 ;
42
42
43
- // Initialization of ANX7625
44
- err_code = anx7625_init (0 );
45
- if (err_code < 0 ) {
46
- return err_code;
47
- }
43
+ // Initialization of ANX7625
44
+ err_code = anx7625_init (0 );
45
+ if (err_code < 0 ) {
46
+ return err_code;
47
+ }
48
48
49
- // Checking HDMI plug event
50
- anx7625_wait_hpd_event (0 );
49
+ // Checking HDMI plug event
50
+ anx7625_wait_hpd_event (0 );
51
51
52
- // Read EDID
53
- anx7625_dp_get_edid (0 , &recognized_edid);
52
+ // Read EDID
53
+ anx7625_dp_get_edid (0 , &recognized_edid);
54
54
55
- // DSI Configuration
56
- anx7625_dp_start (0 , &recognized_edid, EDID_MODE_720x480_60Hz);
55
+ // DSI Configuration
56
+ anx7625_dp_start (0 , &recognized_edid, EDID_MODE_720x480_60Hz);
57
57
58
- // Configure SDRAM
59
- SDRAM.begin (getFramebufferEnd ());
58
+ // Configure SDRAM
59
+ SDRAM.begin (dsi_getFramebufferEnd ());
60
60
} else if (_shield == GIGA_DISPLAY_SHIELD) {
61
- #define EDID_MODE_SELECTED EDID_MODE_480x800_60Hz
62
- struct edid _edid;
63
- struct display_timing dt;
64
-
65
- // DSI Configuration
66
- dt.pixelclock = envie_known_modes[EDID_MODE_SELECTED].pixel_clock ;
67
- dt.hactive = envie_known_modes[EDID_MODE_SELECTED].hactive ;
68
- dt.hsync_len = envie_known_modes[EDID_MODE_SELECTED].hsync_len ;
69
- dt.hback_porch = envie_known_modes[EDID_MODE_SELECTED].hback_porch ;
70
- dt.hfront_porch = envie_known_modes[EDID_MODE_SELECTED].hfront_porch ;
71
- dt.vactive = envie_known_modes[EDID_MODE_SELECTED].vactive ;
72
- dt.vsync_len = envie_known_modes[EDID_MODE_SELECTED].vsync_len ;
73
- dt.vback_porch = envie_known_modes[EDID_MODE_SELECTED].vback_porch ;
74
- dt.vfront_porch = envie_known_modes[EDID_MODE_SELECTED].vfront_porch ;
75
- dt.hpol = envie_known_modes[EDID_MODE_SELECTED].hpol ;
76
- dt.vpol = envie_known_modes[EDID_MODE_SELECTED].vpol ;
77
- stm32_dsi_config (0 , &_edid, &dt);
78
-
79
- // Configure SDRAM
80
- SDRAM.begin ();
81
-
82
- // Init LCD Controller
83
- st7701_init ();
61
+ #define EDID_MODE_SELECTED EDID_MODE_480x800_60Hz
62
+ struct edid _edid;
63
+ struct display_timing dt;
64
+
65
+ // DSI Configuration
66
+ dt.pixelclock = envie_known_modes[EDID_MODE_SELECTED].pixel_clock ;
67
+ dt.hactive = envie_known_modes[EDID_MODE_SELECTED].hactive ;
68
+ dt.hsync_len = envie_known_modes[EDID_MODE_SELECTED].hsync_len ;
69
+ dt.hback_porch = envie_known_modes[EDID_MODE_SELECTED].hback_porch ;
70
+ dt.hfront_porch = envie_known_modes[EDID_MODE_SELECTED].hfront_porch ;
71
+ dt.vactive = envie_known_modes[EDID_MODE_SELECTED].vactive ;
72
+ dt.vsync_len = envie_known_modes[EDID_MODE_SELECTED].vsync_len ;
73
+ dt.vback_porch = envie_known_modes[EDID_MODE_SELECTED].vback_porch ;
74
+ dt.vfront_porch = envie_known_modes[EDID_MODE_SELECTED].vfront_porch ;
75
+ dt.hpol = envie_known_modes[EDID_MODE_SELECTED].hpol ;
76
+ dt.vpol = envie_known_modes[EDID_MODE_SELECTED].vpol ;
77
+ dsi_init (0 , &_edid, &dt);
78
+
79
+ // Configure SDRAM
80
+ SDRAM.begin ();
81
+
82
+ // Init LCD Controller
83
+ st7701_init ();
84
84
}
85
85
#elif defined(ARDUINO_GIGA)
86
86
#define EDID_MODE_SELECTED EDID_MODE_480x800_60Hz
@@ -99,7 +99,7 @@ int H7_Video::begin(bool landscape) {
99
99
dt.vfront_porch = envie_known_modes[EDID_MODE_SELECTED].vfront_porch ;
100
100
dt.hpol = envie_known_modes[EDID_MODE_SELECTED].hpol ;
101
101
dt.vpol = envie_known_modes[EDID_MODE_SELECTED].vpol ;
102
- stm32_dsi_config (0 , &_edid, &dt);
102
+ dsi_init (0 , &_edid, &dt);
103
103
104
104
// Configure SDRAM
105
105
SDRAM.begin ();
@@ -112,10 +112,10 @@ int H7_Video::begin(bool landscape) {
112
112
113
113
_landscape = landscape;
114
114
115
- stm32_LCD_Clear (0 );
115
+ dsi_lcdClear (0 );
116
116
117
117
#if __has_include("lvgl.h")
118
- getNextFrameBuffer ();
118
+ dsi_getNextFrameBuffer ();
119
119
120
120
/* Initiliaze LVGL library */
121
121
lv_init ();
@@ -149,21 +149,21 @@ void H7_Video::beginDraw() {
149
149
ArduinoGraphics::beginDraw ();
150
150
151
151
#if __has_include("lvgl.h")
152
- getNextFrameBuffer ();
152
+ dsi_getNextFrameBuffer ();
153
153
#endif
154
154
155
- stm32_LCD_Clear (0 );
155
+ dsi_lcdClear (0 );
156
156
}
157
157
158
158
void H7_Video::endDraw () {
159
159
ArduinoGraphics::endDraw ();
160
160
161
- getNextFrameBuffer ();
161
+ dsi_getNextFrameBuffer ();
162
162
}
163
163
164
164
void H7_Video::clear (){
165
165
uint32_t bg = ArduinoGraphics::background ();
166
- stm32_LCD_Clear (bg);
166
+ dsi_lcdClear (bg);
167
167
}
168
168
169
169
void H7_Video::set (int x, int y, uint8_t r, uint8_t g, uint8_t b) {
@@ -178,7 +178,7 @@ void H7_Video::set(int x, int y, uint8_t r, uint8_t g, uint8_t b) {
178
178
}
179
179
180
180
uint32_t color = (uint32_t )((uint32_t )(r << 16 ) | (uint32_t )(g << 8 ) | (uint32_t )(b << 0 ));
181
- stm32_LCD_FillArea ((void *)(getCurrentFrameBuffer () + ((x_rot + (width () * y_rot)) * sizeof (uint16_t ))), 1 , 1 , color);
181
+ dsi_lcdFillArea ((void *)(dsi_getCurrentFrameBuffer () + ((x_rot + (width () * y_rot)) * sizeof (uint16_t ))), 1 , 1 , color);
182
182
}
183
183
184
184
#if __has_include("lvgl.h")
@@ -187,7 +187,7 @@ void lvgl_displayFlushing(lv_disp_drv_t * disp, const lv_area_t * area, lv_color
187
187
uint32_t height = lv_area_get_height (area);
188
188
uint32_t offsetPos = (area->x1 + (disp->hor_res * area->y1 )) * sizeof (uint16_t );
189
189
190
- stm32_LCD_DrawImage ((void *) color_p, (void *)(getCurrentFrameBuffer () + offsetPos), width, height, DMA2D_INPUT_RGB565);
190
+ dsi_lcdDrawImage ((void *) color_p, (void *)(dsi_getCurrentFrameBuffer () + offsetPos), width, height, DMA2D_INPUT_RGB565);
191
191
lv_disp_flush_ready (disp); /* Indicate you are ready with the flushing*/
192
192
}
193
193
0 commit comments