cancel
Showing results for 
Search instead for 
Did you mean: 

I want to use a double buffer with an RGB parallel interface

Mna.1
Associate II

Thank you for your help.

I'm a beginner.

The following function is called by the line interrupt, but swapFrameBuffers () seems to be empty.

Specifically, what kind of code should I write?

What should I refer to and how should I switch between the two addresses?

Is there any good example?

Thank you.

void HAL_LTDC_LineEventCallback (LTDC_HandleTypeDef * hltdc)

{

  if (LTDC-> LIPCR == lcd_int_active_line)

  {

    // entering active area

    HAL_LTDC_ProgramLineEvent (hltdc, lcd_int_porch_line);

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

    OSWrappers :: signalVSync ();

    // Swap frame buffers immediately instead of waiting for the task to be scheduled in.

    // Note: task will also swap when it wakes up, but that operation is guarded and will not have

    // any effect if already swapped.

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

    GPIO :: set (GPIO :: VSYNC_FREQ);

  }

  else else

  {

    // exiting active area

    HAL_LTDC_ProgramLineEvent (hltdc, lcd_int_active_line);

    GPIO :: clear (GPIO :: VSYNC_FREQ);

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

  }

}

2 REPLIES 2
Romain DIELEMAN
ST Employee

Hi,

Are you working on a custom board or a ST dev kit ? Are you using CubeMX ? If yes have you set the framebuffer strategy to "double buffer" in the additional software - > TouchGFX section ?

Otherwise you can set the framebuffer addresses and strategy in TouchGFXHAL.cpp in the folder TouchGFX/target of your project (look at TouchGFXGeneratedHal.cpp to understand how to set the startFramebufferAddresses() function).

/Romain

Mna.1
Associate II

Hi Romain

Thank you for your reply.

I made a custom board, opened the ioc file with Cube IDE, and set the double buffer with GUI.

Will the TouchGFX system take care of the rest just by setting it?

Inside the HAL_LTDC_LineEventCallback () function

Why is there no content in HAL :: getInstance ()-> swapFrameBuffers ()?

Do you need to implement it in this function?