cancel
Showing results for 
Search instead for 
Did you mean: 

How to use TouchGFX on SPI TFT Sreen?

Jack li1
Associate III

Hi:

I have an spi TFT screen,and how to port the TouchGFX on this Sreen?

Thanks!!

1 ACCEPTED SOLUTION

Accepted Solutions

DMA2D is only used for graphics (by TouchGFX). I don't know how you want to implement your driver or if you have one already, but here you'd use one of the "regular" DMA channels to do your transfer to the screen. Are you trying to develop a driver from scratch?

/Martin

View solution in original post

13 REPLIES 13
Martin KJELDSEN
Chief III

https://touchgfx.zendesk.com/hc/en-us/articles/203642951-MCUs-without-TFT-controller

You'll find that, when you don't have an LTDC to clock out pixels for you, you'll implement a transfer of the framebuffer (or parts of it) to your SPI display in a particular method called after a frame has been rendered.

void HAL::flushFrameBuffer();
void HAL::flushFrameBuffer(Rect& r);

/Martin

Martin KJELDSEN
Chief III

So the port will consist of you creating your own HAL that overrides flushFrameBuffer. E.g.

void MyHAL::flushFrameBuffer(Rect& r)
{
     HAL::flushFrameBuffer(r);
 
     //Use own drivers to transfer data
    ...
 
    //If using DMA to transfer data you'll need an additional semaphore released by your DMA 
    // TX completed handler. This overrided flush method should try to take that semaphore so it doesn't return 
    // before DMA transfer has been completed. 
  
}

Give the article a read and let me know.

Jack li1
Associate III

Hi Martin:

Thank you so much.l am tring to use it in my program.

Best regards!

Jack li

Hi Martin:

Thank you so much.l am tring to use it in my program.

Best regards!

Jack li

No problem! Looking forward to hearing about it :)

/Martin

Hi Martin@Martin KJELDSEN​ :

How to use it without DMA2D?And I can't understand how to use HAL::flushFrameBuffer(r); in my project.@Martin KJELDSEN​ 

#define HAL_CLASS_TYPE    MyHAL
HAL& hal = touchgfx_generic_init<HAL_CLASS_TYPE>(dma, display, tc, GUI_DISPLAY_WIDTH, GUI_DISPLAY_HEIGHT, (uint16_t*)dynBitmapsBuffer, DYN_SIZE, MAX_DYN_COVERS);

Is this the right way to use it?I use HAL_SPI_Transmit_DMA(&hspi1, (uint8_t *)pimage, 240*240) to send image,so can I use thisway to send farmbuffer

to screen?

Best regards!

Jack li

Hi Martin@Martin KJELDSEN (ST Employee)​ :

How should I solve it?????Thanks very much !!!!!!

0690X00000AQsgwQAD.png

Best regards!

Jack li

DMA2D is only used for graphics (by TouchGFX). I don't know how you want to implement your driver or if you have one already, but here you'd use one of the "regular" DMA channels to do your transfer to the screen. Are you trying to develop a driver from scratch?

/Martin

Jack li1
Associate III

Hi Martin:

Thanks your help! It can display on TFT by touchgfx.

Best regards!

Jack li