Jump to content

ILI9341 + LM4F120 Cortex-M4


rexnanet

Recommended Posts

Hi all,

I'm currently developing a project using a 2.4" TFT with an ILI9341 controller and a Stellaris Launchpad board with a Texas LM4F120 Cortex M4 micro.

There's no such board on the project files.

Which are the first steps to create a "driver" for this microcontroller?

Can I port the code from another board in an easy manner?

Thanks

Link to comment
Share on other sites

Hello rexnanet and welcome to the community!

There are three things you need in order to run uGFX:

  • A display driver
  • A board file
  • The OS abstraction

The display driver

The display driver is the piece of software between the uGFX logic and the microcontroller peripherals (the hardware interface). You're using an ILI9341 display controller and uGFX already comes with a driver for this controller. Hence you don't have to do anything here.

The board file

The board file is a simple file through which uGFX communicates with your hardware. For each display driver there is a board file template located under the display driver directory (eg. /drivers/gdisp/ILI9341/board_ILI9341_template.h). You have to copy that file to your project and fill in the empty routines. As you will see it's just a matter of an init routine to initialize your peripherals and different other very simple routines to control the reset pin and actually send data to your display controller.

As you already have a working project you can simply take your current code and fill it into the board file.

The OS abstraction

uGFX internally uses some memory management algorithms and other things. Some people are using an operating system (eg. an RTOS susch as FreeRTOS) on which they want to run uGFX. The GOS module is the module which implements all these things. Assuming that you're not using any special OS you can simply use the existing RAW32 port. This port of uGFX implements everything to run uGFX on a bare metal system without any underlying OS. The only thing you have to do is to implement two functions which convert ticks to delays as described by the documentation. This is usually straight forward as it is just a matter of dividing your system tick by a number to retrieve a value in milliseconds.

As you can see all the heavy lifting is already done in your case and it's just a matter of gluing things together. Please let us know should you have any questions or should you run into any problems. We're happy to help wherever we can.

~ Tectu

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...