Jul 04, 2021
10:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 04, 2021
10:16 AM
Hi,
Flash N25Q03.
I need to save and read an struct to the flash.
example of the struct:
typedef struct TparDiv
{
uint32_t SsTime; //minutos
double SsTmax;
double SsPot;
double StByTemp;
uint32_t zCF;
uint32_t SisOp;
} TparDiv_t;
Declaration of the struct
TparDiv_t TparDiv;
code
if(DIGITAL_IO_GetInput(&BT_1))
{
N25Q03_WriteEnable();
st=N25Q03_StatusRead();
N25Q03_SectorErase( 0x00000000);
do
{
st = N25Q03_StatusRead();
} while (st & 0x0001); /* wait until busy=0 */
TparDiv.SsPot=40.0;
TparDiv.SisOp=2;
N25Q03_ProgrammPage( 0x00000000,(uint8_t *)&TparDiv,sizeof(TparDiv));
N25Q03_ReadPage(0,(uint8_t *)&readval,sizeof(readval));
Can any one help me with that?
i am trying using the N25Q03_ProgrammPage and the read page as well fuction but it´s not working
thanks in advance
Flash N25Q03.
I need to save and read an struct to the flash.
example of the struct:
typedef struct TparDiv
{
uint32_t SsTime; //minutos
double SsTmax;
double SsPot;
double StByTemp;
uint32_t zCF;
uint32_t SisOp;
} TparDiv_t;
Declaration of the struct
TparDiv_t TparDiv;
code
if(DIGITAL_IO_GetInput(&BT_1))
{
N25Q03_WriteEnable();
st=N25Q03_StatusRead();
N25Q03_SectorErase( 0x00000000);
do
{
st = N25Q03_StatusRead();
} while (st & 0x0001); /* wait until busy=0 */
TparDiv.SsPot=40.0;
TparDiv.SisOp=2;
N25Q03_ProgrammPage( 0x00000000,(uint8_t *)&TparDiv,sizeof(TparDiv));
N25Q03_ReadPage(0,(uint8_t *)&readval,sizeof(readval));
Can any one help me with that?
i am trying using the N25Q03_ProgrammPage and the read page as well fuction but it´s not working
thanks in advance
Labels
- Labels:
-
Technical Center
- Tags:
- IFX
0 Replies