AnsweredAssumed Answered

SPI Flash

Question asked by Kilohercas on May 31, 2012
Latest reply on Jun 2, 2012 by Kilohercas
Hello
I am working on LCD project (Fractals) and i need large buffer for storing iteration values, so i can calculate fractal and when paint it.
I need to store 8b number, total of 130560. so what would be around 1Mb.
I have W25Q16 flash below my lcd, i remade code from ST SPI sampl, but don't know how to write individual numbers and then read them.
i guess i have to use this function:
    /* Write Tx_Buffer data to SPI FLASH memory */
    sFLASH_WriteBuffer(Tx_Buffer, FLASH_WRITE_ADDRESS, BufferSize);

    /* Read data from SPI FLASH memory */
    sFLASH_ReadBuffer(Rx_Buffer, FLASH_READ_ADDRESS, BufferSize);
But what kind of C syntax that would be?
code is like this
int h=0;
u32 i =0;
while(i<(480*272))
{  
h=fractal iteration number ;//0-255
sFLASH_WriteBuffer(h, i, 1);
i++;
}
i=0;
int x=,y=0;
while(x<480)
{
while(y<272)

sFLASH_ReadBuffer(&h, i, 1);
LCD_Pixel(x,y,asemble_rgb(h)):
y++;
i++;
}
y=0;
x++;
}
Help is highly appreciated

Outcomes