Skip to main content
prathima
Associate III
March 5, 2020
Question

Single framebuffer

  • March 5, 2020
  • 12 replies
  • 2802 views

Hello..

How to use single frame buffer in STM32L4R9AI-EVAL board

This topic has been closed for replies.

12 replies

Martin KJELDSEN
Principal III
March 5, 2020

Have you checked the Application template from the TouchGFX designer? It should be single framebuffer. Usually, all DSI ATs we have are single framebuffer because of the GRAM on the display.

prathima
prathimaAuthor
Associate III
March 5, 2020

HELLO...

Bydefault the designer using singel frame buffer?

I want to access that frame buffer means i want to write some data into that frame buffer...How can i do that?

and Can i make the whole frame buffer empty means i want to write all pixel values are zeros...can i do that?how can i?

Thank you...

prathima
prathimaAuthor
Associate III
March 5, 2020

HELLO...

Bydefault the designer using singel frame buffer?

I want to access that frame buffer means i want to write some data into that frame buffer...How can i do that?

and Can i make the whole frame buffer empty means i want to write all pixel values are zeros...can i do that?how can i?

Thank you...

gfxfloro
Associate III
March 5, 2020

You can access the framebuffer like this:

uint16_t* fb;
fb = (uint16_t*) touchgfx::HAL::getInstance()->lockFrameBuffer();

lockFrameBuffer() returns a 16-bit pointer to the used framebuffer.

That way you can also set all pixels to zero.

Don't forget to call:

touchgfx::HAL::getInstance()->unlockFrameBuffer();

after finishing your write operation otherwise the display freezes

prathima
prathimaAuthor
Associate III
March 5, 2020

how can set all pixels to zero.......in this case

thank you

prathima
prathimaAuthor
Associate III
March 5, 2020

and where i have to write this process in screenview.cpp or else some where

gfxfloro
Associate III
March 5, 2020

You put it whereever it makes sense for your application, if you want to set black pixels e.g. on entering the screen, you put it there. Setting the pixels black is just writing the values.

You treat your framebuffer as an array, so

fb[0] = 0x0000U

sets the first pixel to black. Repeat for your screen width and height.

 Edit: of course by doing this you let the MCU do all the work. Setting whole areas to one color is a good job for DMA2D.

Look up the blitOp functions for this

prathima
prathimaAuthor
Associate III
March 5, 2020

my display is of 390x390x3=framebuffer size

if am writing like this:

1. uint16_t* fb;

2.  fb = (uint16_t*)touchgfx::HAL::getInstance()->lockFrameBuffer();

3.  fb[456300] = { 0X000 };  

4.  touchgfx::HAL::getInstance()->unlockFrameBuffer();

Am not getting it...

actually i have a widget called box in my screen...

i want to make it black(all pixels zero)...by writing zeros into frame buffer...but am not getting it and also at line 4 am getting error that exception thrown what it means?why am getting it?

Alexandre RENOUX
Visitor II
March 5, 2020

If you want a framebuffer with only 0x00s, you can also use TouchGFX Designer, add a black box widget, and change the color according to you needs

box1.setColor(touchgfx::Color::getColorFrom24BitRGB(255, 255, 255)); white
box1.invalidate();
box1.setColor(touchgfx::Color::getColorFrom24BitRGB(0, 0, 0)); black
box1.invalidate();

This way you use TouchGFX to fill the framebuffer. If the box covering the whole screen is black, then TouchGFX will fill the framebuffer with zeros. On the other hand if the box is white, then TouchGFX will fill the framebuffer with 0xff.

/Alexandre

prathima
prathimaAuthor
Associate III
March 6, 2020

NO ,i don't want to use box..what you said about box that i know....but i want make it directly all pixels to zero of frame buffer...that box just i have taken it for example to write the data into frame buffer....i don't want to use designer...i don't want to use...

  1. box1.setColor(touchgfx::Color::getColorFrom24BitRGB(0, 0, 0)); black
  2. box1.invalidate();

above instruction my intention..is i want to directly communicate with the frame buffer,,,,so to know am i communicating with frame buffer so i want write some data into it...this is what i want exactly...please can you help me

Thank you so much....