cancel
Showing results for 
Search instead for 
Did you mean: 

Frame buffers

prathima
Associate II

Hello....

Am currently working on STM32L4R9AI-EVAL board and i have so many doubts about frame buffering....

1.when we have to use single frame buffer,when we use double frame buffer,and partial frame buffers and rendering time is less for single buffer or double.....

2.Can we access the frame buffer,if it is yes and how to do that i need a procedure to do that because i don't know anything about it....

3.Do the touchgfx supports vertical swipe and how to enable it...

Thank you in advance

27 REPLIES 27
Martin KJELDSEN
Chief III

Hi,

The L4R9AI-EVAL has a display with GRAM, so only one TouchGFX framebuffer is necessary. Partial framebuffers is for low cost solution MCUs like G0 that have little internal memory and when the project does not wish to rely on external SDRAM to fit a full framebuffer.

Yes, you can access the framebuffer and do anything you want to the content there. Use

HAL::getInstance()->lockFrameBuffer();

Signature:

/**
     * @fn virtual uint16_t* HAL::lockFrameBuffer();
     *
     * @brief Waits for the frame buffer to become available for use.
     *
     *        Waits for the frame buffer to become available for use (i.e. not used by DMA
     *        transfers).
     *
     * @note Function blocks until frame buffer is available. Client code MUST call
     *       unlockFrameBuffer() when frame buffer operation has completed.
     *
     * @return A pointer to the beginning of the currently used frame buffer.
     */
    virtual uint16_t* lockFrameBuffer();

Yes, TouchGFX supports vertical swipe.

/**
     * @typedef enum GestureType
     *
     * @brief The gesture event types.
     */
    typedef enum
    {
        SWIPE_HORIZONTAL, ///< An enum constant representing a horizontal swipe
        SWIPE_VERTICAL    ///< An enum constant representing a vertical swipe
    } GestureType;

If you override the following method in your view, you'll get an event for either horizontal or vertical swipe:

/**
     * @fn virtual void Drawable::handleGestureEvent(const GestureEvent& evt)
     *
     * @brief Defines the event handler interface for GestureEvents.
     *
     *        Defines the event handler interface for GestureEvents. The default implementation
     *        ignores the event. The event is only received if the drawable is touchable.
     *
     * @param evt The GestureEvent received from the HAL.
     */
    virtual void handleGestureEvent(const GestureEvent& evt) { }

/Martin

This is good information...martin

1.But i have a project which will be running fine ....initially where this project data will store either in single buffer or double buffer if it is stores in any of those how do we find it is storing in single or double buffer means in the program in which file can we find....

2.the same project lets say, i want to store in a single buffer directly(manually with using the respective instructions) how do we write that(means processor)....and how do e confirm that it is storing in single buffer..

3.I have a project with horizontal swipe but i want to so do vertical swiping...

means whenever i swipe vertically the pages should go either from top to bottom or vice versa just like horizontal swipe(left to right and vice versa)....

4.in case i want to do the the swiping rather than vertical and horizontal like my display is of round 390 x 390 resolution i want to do swiping in some angle 15 degrees like that can we do that...

Thank you in advance:) .....

prathima
Associate II

1.one more thing you said to use lockframebuffer() function and can you tell me in which program file i can use that...

and what will happens if we write that instruction....

thank you ...

prathima
Associate II

hello Martin....

i want do scrolling but in a arc manner...not vertically means vertically only but some with arc(angle)

thank you

prathima
Associate II

like....in the image0690X00000DC1XbQAL.png

Romain DIELEMAN
ST Employee

Hi prathima, what you wish to do in that image is what is done in Tutorial 4 using a scrollWheel and modifying its Y value. You can compare the result and see the code here. Hope this helps,

/Romain

prathima
Associate II

yeah,,,but is this location y location

y=y + getheight ( )/2-390/2;

your talking about romain Dieleman

Romain DIELEMAN
ST Employee

I meant X value my bad. But just do the same code as in the tutorial and you will get this nice arc.

prathima
Associate II

yes ..i got it:) thank you so much...

And what about the vertical swipe... Suppose i have a swipe container which is having 3 screen in between i want do horizontal swipe...

lets say....

screen1:analog clock

screen2:digital clock

Screen3:one imge

and these screens are side by side same way i have two more screen

one is upside(animation screen) of analog screen and one more is down side analog screen...

so my requirement is i want to do horizontal swipe i will get digital screen ..but in the case vertical swipe i can get animation screen(upside)

and same way down side screen....

how do i do the entire things..

thank you so much