2
2
// #include "stm32h747i_eval_lcd.h"
3
3
// #include "defs.h"
4
4
#include " image_320x240_argb8888.h"
5
+ #include " SDRAM.h"
5
6
6
7
struct edid recognized_edid;
7
8
8
9
mbed::DigitalOut video_on (PK_2);
9
10
mbed::DigitalOut video_rst (PJ_3);
10
11
11
- #define LAYER0_ADDRESS 0xC0000000
12
-
13
12
void setup () {
14
13
// put your setup code here, to run once:
15
14
delay (1000 );
@@ -18,74 +17,41 @@ void setup() {
18
17
video_rst = 1 ;
19
18
delay (10 );
20
19
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 ) {
40
26
41
- // BSP_LCD_DrawRect(100, 100, 100, 100);
27
+ video_on = 0 ;
28
+ delay (10 );
29
+ video_rst = 0 ;
30
+ delay (100 );
42
31
43
- /*
32
+ video_on = 1 ;
33
+ delay (100 );
34
+ video_rst = 1 ;
44
35
45
- for (int i=0; i<640; i++) {
46
- *(uint8_t*)(LAYER0_ADDRESS + (i)) = 0;
36
+ ret = anx7625_init (0 );
47
37
}
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);
53
40
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);
60
45
}
61
- */
62
46
}
63
47
64
48
int i = 0 ;
65
49
66
50
void loop () {
67
-
68
-
69
51
delay (1000 );
70
52
71
53
i = random (0 , 0xFFFFFF );
72
54
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
- */
88
55
89
- /* Wait some time before switching to next stage */
90
56
delay (1000 );
91
57
}
0 commit comments