Page 1 of 3

LCD-TFT Driver Controller (LTDC)

Posted: Mon Nov 18, 2013 12:27 am
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: )

Re: LCD-TFT Driver Controller (LTDC)

Posted: Mon Nov 18, 2013 9:19 am
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

Re: LCD-TFT Driver Controller (LTDC)

Posted: Mon Nov 18, 2013 12:21 pm
by TexZK
Thanks for the suggestions, which will also make its architecture simpler :)

Re: LCD-TFT Driver Controller (LTDC)

Posted: Thu Nov 21, 2013 3:22 pm
by mobyfab
Hey,

You might want to take a look at ugfx to integrate your lcd driver :)

Re: LCD-TFT Driver Controller (LTDC)

Posted: Fri Nov 22, 2013 11:09 pm
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

Re: LCD-TFT Driver Controller (LTDC)

Posted: Sat Nov 23, 2013 5:19 pm
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

Re: LCD-TFT Driver Controller (LTDC)

Posted: Sat Nov 23, 2013 6:45 pm
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.

Re: LCD-TFT Driver Controller (LTDC)

Posted: Sat Nov 23, 2013 7:06 pm
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

Re: LCD-TFT Driver Controller (LTDC)

Posted: Sat Nov 23, 2013 9:56 pm
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

Re: LCD-TFT Driver Controller (LTDC)

Posted: Sat Nov 23, 2013 10:27 pm
by jscott
Woops!.....