The iLi9325 LCD chipset configuration for the emWin or STemWin, in GPIO mode

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • The iLi9325 LCD chipset configuration for the emWin or STemWin, in GPIO mode

      As you know we can connect a TFT LCD to the STM32 MCU by two mainmethods: FSMC or GPIO.


      The FSMC is for the MCUs which at least have 100Pins I think (we can use the CubeMX to initialize it), and for the smallerMCUs, we have to use the GPIO.

      I use the CubeMX and HALlibraries for the projects. I searched for many examples but I could not understand where the user should define or initialize the MCU GPIO Port for the LCD. PORTA or PORTB or whatever.


      I have the chipset driver from STM examples which includes ili9325.c and ili9325.h.


      examples are a bit confusing.
    • Hi,

      What exactly do you mean with "configure the emwin for GPIO"?

      To drive displays with a serial interface this is not that much of a problem to set up some GPIOs to work as e.g. an SPI interface. Problematic it is when you try to create a parallel RGB interface. Natively emWin does not support this and does generate any signals required for an RGB interface.

      Attached is an example for the GUIDRV_FlexColor 66708. That is the driver to be used with the ILI9325. It also shows how to set up a 8080 interface with 16 bit width using only GPIOs. Of course you have to adapt this to fit to your hardware.

      The important part are the functions for writing data and commands set in LCD_X_Config() (the PortAPI function pointers). Basically, emWin doesn't really care about the interface and how the data is getting send to the LCD controller. This means you could also use an SPI interface.

      Regards,
      Sven
      Files
      • LCDConfig.zip

        (4.65 kB, downloaded 94 times, last: )
    • Thank you very much.

      yes, I mean configuring the hardware connection between the LCD and a particular MCU. So it could be GPIO, FSMC, SPI or whatever. I don't know where should I config or where should write some codes for a particular LCD.

      The thing is it seems each developer has followed his own path to do this and there is no concrete step by step documentation to how to do this. it makes the first time developers disappointed.


      I attached what I got, in case of the STM.

      it seems the main file to modify is the LCDConf_FlexColor_Template . I attached the rest. Somebody told me what I should do is to complete these below functions:




      Source Code

      1. static void LcdWriteReg(U16 Data) {
      2. // ... TBD by user
      3. }
      4. /********************************************************************
      5. *
      6. * LcdWriteData
      7. *
      8. * Function description:
      9. * Writes a value to a display register
      10. */
      11. static void LcdWriteData(U16 Data) {
      12. // ... TBD by user
      13. }
      14. /********************************************************************
      15. *
      16. * LcdWriteDataMultiple
      17. *
      18. * Function description:
      19. * Writes multiple values to a display register.
      20. */
      21. static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
      22. while (NumItems--) {
      23. // ... TBD by user
      24. }
      25. }
      26. /********************************************************************
      27. *
      28. * LcdReadDataMultiple
      29. *
      30. * Function description:
      31. * Reads multiple values from a display register.
      32. */
      33. static void LcdReadDataMultiple(U16 * pData, int NumItems) {
      34. while (NumItems--) {
      35. // ... TBD by user
      36. }
      37. }
      Display All


      apart from this, I had found two driver files which are related to the ili9325 (attached).

      My problem is that I can not make connection between these sources (make the interface), for example GPIO, SPI or whatever. because I could not find any example of it.



      Files
      • ili9325.zip

        (5.99 kB, downloaded 95 times, last: )
      • Config.zip

        (18.25 kB, downloaded 78 times, last: )