Library 51- Chrom-ART Accelerator (DMA2D) graphic library on STM32F429-Discovery

ST’s Chrom-ARTTM Accelerator function or DMA2D is supported in this library. This is powerful tool in STM32F429/39 or STM32F427/29 devices. It is based on DMA transmission from graphic to memory in top possible speed. This can be used to draw moving objects, rectangles, circles very fast without a lot of work.

My DMA2D GRAPHIC library was designed in a way that can support any LCD. Because anything that DMA2D knows is writing “data” (color) in memory at some locations. You still need some way to transmit data from memory to LCD. So library was designed that you can custom set start memory address, LCD width, LCD height and LCD orientation. Then the magic to writing in memory can start.

In case of STM32F429-Discovery, external SD-RAM is connected to MCU. In this case, SD-RAM has some logical address, in our case is 0xD0000000. DMA2D just knows that there is starting address and that LCD is 240px width and 320px height. When you want rectangle on x = 10, y = 10 location, library will calculate memory location where to transmit data for you.

Also, you need separate driver to transmit your data from memory to LCD. In case of STM32F429-Discovery board, LTDC periperal is in use. Again, LTDC peripheral knows start address of LCD memory (0xD0000000) and it can start work.

These 2 settings (LCD width, LCD height, memory start address) are by default set for STM32F429-Discovery compatibility, but you can set it to your needs any time. More below.

Library

Features

  • LCD independent
  • LCD orientation supported
  • Easy to port to another application with just 3 settings
  • Writing to memory with DMA2D fastest speed
  • Supported on STM32F429-Discovery board
  • Draw rectangles, lines, circles, triangles, rounded rectangles with fastest speed
  • Unlimited layers if they are supported by your peripheral to transmit data to LCD
    • In case of STM32F429-Discovery, LTDC can use 2 layers
    • Memory offset is used for new address

Dependencies

  • CMSIS
    • STM32F4xx
    • STM32F4xx RCC
    • STM32F4xx DMA2D
  • TM
    • defines.h

If you want to use this powerfull DMA2D tool on your custom application to work with memory, you need to specify some defines.

Functions and enumerations

Example

In example, DMA2D graphic library was used with connection to ILI9341 LCD via LTDC transfer from memory to LCD. DMA2D is used to draw graphic to memory.

Project available on Github, download library below.

tilz0R

Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...