1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| #include "spif.h"
uint8_t testwrite[2096]={0};
uint8_t testRead[2096]={0};
SPIF_HandleTypeDef spif;
void
app_init (void)
{
mstimer_init ();
volatile int a = 100000;
while (a--)
;
SPIF_Init (NULL, 0);
for (int i = 0; i < 2096; i++)
{
testwrite[I] = i + 16;
}
// SPIF_EraseSector (&spif, 0);
// SPIF_EraseChip(&spif);
// a = millis();
// while (millis()-a < 5000);
//
// SPIF_WritePage (&spif, 0, testwrite, 256, 0);
// a = millis();
// while (millis()-a < 500);
//
// while (1)
// ;
//SPIF_ReadPage (&spif, 0, testRead, 256, 0);
}
/*****************************************************************************
* App ticking function.
******************************************************************************/
void
app_process_action (void)
{
SPIF_EraseBlock(&spif, 0);
SPIF_WriteBlock(&spif, 0, testwrite, 2096, 0);
SPIF_ReadBlock(&spif, 0, testRead, 2096, 0);
} |