LCD-TFT Driver Controller (LTDC)

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm

LCD-TFT Driver Controller (LTDC)

Post by TexZK »

Hi! This weekend I've been working on a handy LTDC driver for new STM32 devices like the 'F429. It is still unfinished, but at least it compiles successfully for now :D I still have to add RCC initialization, interrupt/error handling, and test it on my 'F429i board.

The basic idea is to add a HAL-like driver to the STM32 family. Currently, it is deployed the following way:
  • os/
    • hal/
      • platforms/
        • STM32/
          • LTDCv1/
            • stm32_ltdc_lld.h ~ LLD header
            • stm32_ltdc_lld.c ~ LLD source (underscore)
          • stm32_ltdc.h ~ HAL-like header
          • stm32_ltdc.c ~ HAL-like source (camel case)
        • STM32F4xx/
          • platform.mk ~ Added STM32/ and STM32F4xx/ sources and directories
          • hal_lld.h ~ Added STM32_* auto-defines, and inclusion of stm32_ltdc.h
          • hal_lld.c ~ Added ltdcInit() HAL-like initialization to hal_lld_init()
  • demos/


I will keep you up to date. Next stop will be the DMA2D hardware accelerator... but I still have to finish this LTDC driver :roll:
If you just want to give a look to the current source code, you can find it in the attachment (please don't judge hard, it's my first attempt :oops: )
Attachments
ltdc_wip.zip
Modified and added files [Work In Progress]
(29.21 KiB) Downloaded 2011 times
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: LCD-TFT Driver Controller (LTDC)

Post by Giovanni »

I suggest making it independent from the HAL for initialization. The initialization could be performed from boardInit() if the board has an LCD so there is not even need for enable/disable switches.

The driver does not need a high/low level driver structure because I imagine it would be very STM32-specific, just name the files stm32_ltdc.c/.h and the internal functions as ltdcName() not ltdc_lld_name(), this is the convention for others platform-specific drivers like the DMA or RCC.

Giovanni
User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm

Re: LCD-TFT Driver Controller (LTDC)

Post by TexZK »

Thanks for the suggestions, which will also make its architecture simpler :)
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: LCD-TFT Driver Controller (LTDC)

Post by mobyfab »

Hey,

You might want to take a look at ugfx to integrate your lcd driver :)
User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm

Re: LCD-TFT Driver Controller (LTDC)

Post by TexZK »

Well, I'm just making my contribution to ChibiOS, to learn how to write a driver for it. As for now, I can't get anything on the screen, on one hand because I'm trying to add a temporary SPI5 support (Giovanni added SPI4/5/6 support to his todo-list) which might be broken, and on the other hand because the demo code by ST is horrible spaghetti code, and I'm trying to figure out how to replicate/improve everything by myself, as a n00b.
As I'm struggling to learn ChibiOS, LTDC, DMA2D, DMA, SPI, the demo board (with mixed bidi/unidir-SPI), and that ugly ST demo code, I don't want to add even more troubles for your project I actually don't need for now (I want to put my hands on the bare frame buffer, with 2D acceleration if possible). That's why I'm not going to add support for uGFX, which also doesn't look like Free Software. Once done (if ever), I'm sure you'll be able to write your wrappers for it in no time.

Cheers
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: LCD-TFT Driver Controller (LTDC)

Post by Tectu »

TexZK wrote:...uGFX, which also doesn't look like Free Software.

As long as you don't build anything that you'll sell, it's totally free.


~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: LCD-TFT Driver Controller (LTDC)

Post by Giovanni »

Tectu wrote:
TexZK wrote:...uGFX, which also doesn't look like Free Software.

As long as you don't build anything that you'll sell, it's totally free.


~ Tectu


Note, that makes it not compatible with GPL.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: LCD-TFT Driver Controller (LTDC)

Post by Tectu »

Giovanni wrote:Note, that makes it not compatible with GPL.

That is correct and that's why we don't say we use GPL ;)
Our current license can be retrieved from here.


~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: LCD-TFT Driver Controller (LTDC)

Post by Giovanni »

Tectu wrote:
Giovanni wrote:Note, that makes it not compatible with GPL.

That is correct and that's why we don't say we use GPL ;)
Our current license can be retrieved from here.


That is fine, you can license your code in any way you like.

The point is that if somebody wants to link that code with something that is GPL then the end result, as a whole, must be covered by the GPL or that somebody would be in violation of the GPL.

Basically, if you want to use GPL software you cannot put restrictions on top of it.

This means that end users cannot link ugfx with anything GPL, commercial or not commercial, and that includes ChibiOS and other RTOSes.

Giovanni
jscott
Posts: 129
Joined: Tue Jul 03, 2012 3:50 pm

Re: LCD-TFT Driver Controller (LTDC)

Post by jscott »

Woops!.....
Post Reply