7
7
#include " AVI_parser.h"
8
8
#include " image.h"
9
9
10
- QSPIFBlockDevice block_device (PD_11, PD_12, PF_7, PD_13,
11
- PF_10, PG_6, QSPIF_POLARITY_MODE_0, MBED_CONF_QSPIF_QSPI_FREQ);
12
-
13
10
struct edid recognized_edid;
14
11
15
12
mbed::DigitalOut video_on (PK_2);
16
13
mbed::DigitalOut video_rst (PJ_3);
17
14
18
15
extern " C" uint32_t JPEG_Decode_DMA (JPEG_HandleTypeDef *hjpeg, uint32_t FrameSourceAddress , uint32_t FrameSize, uint32_t DestAddress);
19
16
20
- static uint32_t AVI_FILE_ADDRESS = 0 ; // ((uint32_t)(EnvieH7V1_0_4_avi)); // ((uint32_t)(0x90000000)); // start of qspi flash, correct me later
17
+ static uint32_t AVI_FILE_ADDRESS = ((uint32_t )(0x90000000 )); // start of qspi flash, correct me later
21
18
22
19
/* Private macro -------------------------------------------------------------*/
23
20
/* Private variables ---------------------------------------------------------*/
@@ -32,63 +29,74 @@ extern __IO uint32_t Jpeg_HWDecodingEnd;
32
29
33
30
AVI_CONTEXT AVI_Handel; /* AVI Parser Handle*/
34
31
35
- int KMP (char *x, int m, char *y, int n, int start= 0 );
32
+ int KMP (char *x, int m, char *y, int n, int start = 0 );
36
33
37
34
void setup () {
38
35
// put your setup code here, to run once:
39
- video_on = 1 ;
40
- delay (10 );
41
- video_rst = 1 ;
42
- delay (10 );
43
36
44
- delay (1000 );
37
+ int ret = -1 ;
38
+ while (ret < 0 ) {
45
39
46
- int ret = anx7625_init (0 );
40
+ video_on = 0 ;
41
+ delay (10 );
42
+ video_rst = 0 ;
43
+ delay (100 );
47
44
48
- if (ret < 0 ) {
49
- printf (" anx7625_init returned %d\n " , ret);
50
- while (1 ) {}
51
- }
45
+ video_on = 1 ;
46
+ delay (100 );
47
+ video_rst = 1 ;
52
48
49
+ ret = anx7625_init (0 );
50
+ printf (" after init\n " );
51
+
52
+ if (ret < 0 ) {
53
+ printf (" anx7625_init returned %d\n " , ret);
54
+
55
+ }
56
+ }
53
57
anx7625_dp_get_edid (0 , &recognized_edid);
54
58
// edid_set_framebuffer_bits_per_pixel(&recognized_edid, 16, 0);
55
59
// set_display_mode(&recognized_edid, EDID_MODE_720x480_60Hz);
56
60
// anx7625_dp_start(0, &recognized_edid, EDID_MODE_1280x720_60Hz);
57
61
anx7625_dp_start (0 , &recognized_edid);
58
62
59
- block_device.init ();
63
+ delay (1000 );
64
+
65
+ QSPIFBlockDevice* block_device = new QSPIFBlockDevice (PD_11, PD_12, PF_7, PD_13,
66
+ PF_10, PG_6, QSPIF_POLARITY_MODE_0, MBED_CONF_QSPIF_QSPI_FREQ);
67
+ block_device->init ();
60
68
61
- mbed::bd_size_t sector_size_at_address_0 = block_device. get_erase_size (0 );
69
+ mbed::bd_size_t sector_size_at_address_0 = block_device-> get_erase_size (0 );
62
70
63
- printf (" QSPIF BD size: %llu\n " , block_device. size ());
64
- printf (" QSPIF BD read size: %llu\n " , block_device. get_read_size ());
65
- printf (" QSPIF BD program size: %llu\n " , block_device. get_program_size ());
71
+ printf (" QSPIF BD size: %llu\n " , block_device-> size ());
72
+ printf (" QSPIF BD read size: %llu\n " , block_device-> get_read_size ());
73
+ printf (" QSPIF BD program size: %llu\n " , block_device-> get_program_size ());
66
74
67
75
printf (" QSPIF BD erase size (at address 0): %llu\n " , sector_size_at_address_0);
68
76
69
- /*
70
- char avi_header[] = {0x52, 0x49, 0x46, 0x46};
71
- char *buffer = (char *) malloc(sector_size_at_address_0);
72
- int i = 2048;
73
- int res = 0;
74
- while (sector_size_at_address_0 * i < block_device.size()) {
75
- block_device.read(buffer, sector_size_at_address_0 * i, sector_size_at_address_0);
76
- res = KMP(avi_header, 4, buffer, sector_size_at_address_0);
77
- if (res != -1) {
78
- break;
77
+ /*
78
+ char avi_header[] = {0x52, 0x49, 0x46, 0x46};
79
+ char *buffer = (char *) malloc(sector_size_at_address_0);
80
+ int i = 2048;
81
+ int res = 0;
82
+ while (sector_size_at_address_0 * i < block_device.size()) {
83
+ block_device.read(buffer, sector_size_at_address_0 * i, sector_size_at_address_0);
84
+ res = KMP(avi_header, 4, buffer, sector_size_at_address_0);
85
+ if (res != -1) {
86
+ break;
87
+ }
88
+ i++;
79
89
}
80
- i++;
81
- }
82
- */
90
+ */
83
91
char *buffer = (char *) malloc (sector_size_at_address_0);
84
- block_device. read (buffer, 2048 * 4096 , sector_size_at_address_0);
92
+ block_device-> read (buffer, 2048 * 4096 , sector_size_at_address_0);
85
93
86
- AVI_FILE_ADDRESS = (((uint32_t )(0x90000000 + (2048 * 4096 ))));
87
- DumpHex ((void *)AVI_FILE_ADDRESS, 40 );
94
+ AVI_FILE_ADDRESS = (((uint32_t )(EnvieH7V1_0_4_avi))); // + (2048 * 4096))));
95
+ // DumpHex((void*)AVI_FILE_ADDRESS, 40);
88
96
printf (" Address: %x\n " , AVI_FILE_ADDRESS);
89
97
90
98
// Deinitialize the device
91
- // block_device. deinit();
99
+ block_device-> deinit ();
92
100
93
101
LCD_X_Size = stm32_getXSize ();
94
102
LCD_Y_Size = stm32_getYSize ();
0 commit comments