temporary saving and restoring a region of a TFT screen ?

Status
Not open for further replies.

fff

Member
hello all,

I am using the recommend ILI9341_t3 with a SPI TFT a Teensy 3.2
And basically I have some pop-up message coming over user generated complex screens.
My question is after the popup .... how to come back to previous screen that has been partially overwritten ?

so I imagine:
- save temporally into memory a small region of the screen, say the rectangle between the two opposite corners (x1,y1) and (x2,y2)
- then print my temporary text in that area (that, I know how to do)
- and after popup, redraw the saved region ?

Any idea for #1 and #3 ?
(or better way to do the initial goal?)

Thanks,
Fabrice
 
Some SPI TFT screens don't have MISO so you can't read data back - in this case you'll need to work on a local framebuffer
to do this. Have the popup bypass the framebuffer and write direct to screen, then to close popup re-write from the framebuffer.
All the non-popup related graphics have to go via the framebuffer of course, meaning parameterizing graphics primitives with
a flag or mode for using framebuffer or not.
 
The ILI9341_t3n has the ability to do a frame buffer for the ILI9341 display,

But the issue is: The display is 320*240*2 bytes = 153600 bytes, Which won't fit into memory of the T3.2...

if you have MISO setup, you can try the tft.readRect call to read in an area of memory. But of course may depend on size of the region of the screen you are trying to save.
 
Thanks you both MarkT and KurtE for pointing me in right direction
In fact your answers were complementary

So I did a sketch with a buffer array used by readRect() and writeRect()
But all I achieve is to write some black rectangles :(
writeRect() seems to work, as when I manually fill the array with random values, it does have colors inside the rectangle
But when array is filled by readRect .... nothing

....Looks like i can not read from it although my MISO is connected
 
....Looks like i can not read from it although my MISO is connected
Its pretty uncommon for MISO to be connected in display modules, as its the only output pin and
would need its own level shifter.
 
Most of the ILI9341 displays I have played with do have MISO pins connected. But you have to use a slower SPI speed when you are doing read operations. The ILI9341_t3n library for example has two SPI speeds defined. One for reads and one for writes. Note: I have seen these be flaky at times.
 
Thanks both again
In both cases, it's not really an option then: as my project handles a lot, slowing down is not really an option (and for this project, I need to stay with the T3.2, althought I have the other Teensys 3.6-4-4.1)
It means I have to temporary print on a dedicated area where no background or a known background. No so ergonomic, not so nice, but ...
The only good aspect .... I can have one more pin available on the Teensy for something else !
Thanks again
 
Status
Not open for further replies.
Back
Top