22// #include "stm32h747i_eval_lcd.h"
33// #include "defs.h"
44#include " image_320x240_argb8888.h"
5+ #include " SDRAM.h"
56
67struct edid recognized_edid;
78
89mbed::DigitalOut video_on (PK_2);
910mbed::DigitalOut video_rst (PJ_3);
1011
11- #define LAYER0_ADDRESS 0xC0000000
12-
1312void setup () {
1413 // put your setup code here, to run once:
1514 delay (1000 );
@@ -18,74 +17,41 @@ void setup() {
1817 video_rst = 1 ;
1918 delay (10 );
2019
21- /*
22- BSP_LCD_Init();
23- BSP_LCD_LayerDefaultInit(0, LAYER0_ADDRESS);
24- BSP_LCD_SelectLayer(0);
25- */
26-
27- int ret = anx7625_init (0 );
28- printf (" anx7625_init returned %d\n " , ret);
29- anx7625_dp_get_edid (0 , &recognized_edid);
30- // edid_set_framebuffer_bits_per_pixel(&recognized_edid, 16, 0);
31- set_display_mode (&recognized_edid, EDID_MODE_720x480_60Hz);
32- anx7625_dp_start (0 , &recognized_edid);
33-
34- stm32_LCD_DrawImage ((void *)texture_raw, (void *)(LAYER0_ADDRESS), 300 , 300 , DMA2D_INPUT_RGB565);
35-
36- // stm32_LCD_DrawImage((void*)image_320x240_argb8888, NULL, 320, 240, DMA2D_INPUT_ARGB8888);
37-
38- /* Display example brief */
39- // LCD_BriefDisplay();
20+ int ret = -1 ;
21+ video_on = 0 ;
22+ delay (10 );
23+ video_rst = 0 ;
24+ delay (100 );
25+ while (ret < 0 ) {
4026
41- // BSP_LCD_DrawRect(100, 100, 100, 100);
27+ video_on = 0 ;
28+ delay (10 );
29+ video_rst = 0 ;
30+ delay (100 );
4231
43- /*
32+ video_on = 1 ;
33+ delay (100 );
34+ video_rst = 1 ;
4435
45- for (int i=0; i<640; i++) {
46- *(uint8_t*)(LAYER0_ADDRESS + (i)) = 0;
36+ ret = anx7625_init (0 );
4737 }
48- for (int i=0; i<320; i++) {
49- *(uint8_t*)(LAYER0_ADDRESS + (i*720*2) + 64) = 0;
50- *(uint8_t*)(LAYER0_ADDRESS + (i*720*2) + 65) = 0;
51- }
52- */
38+ anx7625_dp_get_edid (0 , &recognized_edid);
39+ anx7625_dp_start (0 , &recognized_edid, EDID_MODE_640x480_60Hz);
5340
54- /*
55- int i = 0;
56- while (i < texture_raw_len) {
57- *(uint8_t*)(LAYER0_ADDRESS + (i*2)) = texture_raw[i];
58- *(uint8_t*)(LAYER0_ADDRESS + (i*2) +1) = texture_raw[i];
59- i++;
41+ SDRAM.begin (getFramebufferEnd ());
42+ while (1 ) {
43+ stm32_LCD_DrawImage ((void *)texture_raw, (void *)getNextFrameBuffer (), 300 , 300 , DMA2D_INPUT_RGB565);
44+ stm32_LCD_DrawImage ((void *)texture_raw, (void *)getNextFrameBuffer (), 300 , 300 , DMA2D_INPUT_RGB565);
6045 }
61- */
6246}
6347
6448int i = 0 ;
6549
6650void loop () {
67-
68-
6951 delay (1000 );
7052
7153 i = random (0 , 0xFFFFFF );
7254 printf (" now: %d\n " , millis ());
73- // stm32_LCD_Clear(i);
74-
75- /*
76- uint8_t data[10];
77- uint8_t data2[10] = {1,2,3,4,5,6,7,8,9,10};
78- memcpy((void*)LAYER0_ADDRESS, data2, 10);
79- memcpy(data, (void*)LAYER0_ADDRESS, 10);
80- for (int i=0; i<10; i++) {
81- printf("%x", data[i]);
82- }
83- printf("\n");
84-
85- // put your main code here, to run repeatedly:
86- CopyBuffer((uint32_t *)Images[0], (uint32_t *)LAYER0_ADDRESS, (BSP_LCD_GetXSize() - 320) / 2, 160, 320, 240);
87- */
8855
89- /* Wait some time before switching to next stage */
9056 delay (1000 );
9157}
0 commit comments