Name

CYGPKG_DEVS_FRAMEBUF_STM32_LTDC — eCos Support for the STM32 LTDC controller

Description

The CYGPKG_DEVS_FRAMEBUF_STM32_LTDC package provides an eCos framebuffer device driver for LCD-TFT panels on suitable STM32 platforms. The target platform is expected to set CDL requires as appropriate for the colour-depth and shape of the display in use.

The driver is a hardware package and is loaded automatically when configuring eCos for a suitable STM32 target. By default the package does not add any code size or data overheads unless it is referenced. To activate the driver the generic framebuffer package CYGPKG_IO_FRAMEBUF can be added to the configuration. The driver functionality is then accessible via the API defined by the generic framebuffer package.

When using the eCos I/O framebuffer API the driver supports a single framebuffer device, driving the LCD-TFT panel as defined by the package CDL options. The cyg_fb structure for this is cyg_fb_LTDC, and the identifier for use with the framebuffer macro API is LTDC. The ioctl operations supported are CYG_FB_IOCTL_BLANK_GET, CYG_FB_IOCTL_BLANK_SET, CYG_FB_IOCTL_BACKLIGHT_GET and CYG_FB_IOCTL_BACKLIGHT_SET. The backlight supports the target (ARCH/VAR/PLF) supplied number of intensity levels.

Alternatively the driver can be referenced directly via a simple API to provide an initialised framebuffer for direct access outside of the generic eCos CYGPKG_IO_FRAMEBUF world. This allows the LTDC driver to be used without including the CYGPKG_IO_FRAMEBUF package in the configuration. Simply include:

#include <cyg/io/framebufs/stm32_ltdc.h>

The functions exported are:

void cyg_st_ltdc_init_io(void);

This function allows an application to initialise the LTDC controller, with platform supplied (if required) pre- and post-init callbacks used for any target specific initialisation.

CYG_ADDRWORD cyg_st_ltdc_framebuffer_get(cyg_uint32 layer);

This function allows an application to obtain the current framebuffer location for the specified LTDC layer. The driver internally manages an allocation for the initial framebuffer configuration and for most applications this is sufficient. If the layer is not supported by the configuration then 0x00000000 will be returned since that is never expected to be a valid frame buffer location for STM32 devices.

void cyg_st_ltdc_framebuffer_set(cyg_uint32 layer, CYG_ADDRWORD cfbar);

This function allows an application to specify a specific framebuffer location for the specified LTDC layer, replacing the current setting for that LTDC layer. It is required that the referenced location is large enough to accomodate a buffer with the (width x height x colourdepth) dimensions of the configured LTDC display.