What is the maximum image size you desire to cache?
Note: The PSoC5 has limited RAM memory.
I'm assuming you are trying to implement a video-like function. What is your desired frame-rate?
Thank you for your response.
Maximum image size is 4KB. I will make sure not to cross the limit when I cache. Any idea as to how it can be done?
Note: I have different screens and different set of images for each screen. Every time I try to navigate between the screens I would like to retrieve respective images from cache.
Appreciate any help!
4KB is not too bad.
The simplest but not always the most flexible architecture is a single-task structure. In this case you pre-allocate your image buffer (4KB) at design/compile time. For example:
If you need to use a dual image buffer strategy which will double your RAM pre-allocated:
uint8_t imagebuff0; uint8_t imagebuff1;
With the dual buffer strategy you can switch between buffers as you are displaying one buffer, you can fill the other buffer. Then switch the buffer being displayed and filled.
If you are dumping to an intelligent display, some display internally use a double-buffering schemes. This means you might be able to dump the data directly from a SPI connected SD card to the display then instruct the display to switch to the new buffer at the proper switch time.
A more complicated architecture approach is to use a RTOS (Real-Time Operating System). It takes a bit of setup and learning but may be more real-time responsive to a deterministic system such as audio or video.