Browse Source

STM32LTDC: Rename ALLOW_2ND_LAYER to LTDC_USE_2ND_LAYER

develop
Joel Bodenmann 1 year ago
parent
commit
94fd096fdd
  1. 4
      boards/base/STM32F429i-Discovery/chibios/board_STM32LTDC.h
  2. 4
      boards/base/STM32F439i-Eval/CubeHal/board_STM32LTDC.h
  3. 4
      boards/base/STM32F746-Discovery/board_STM32LTDC.h
  4. 4
      drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h
  5. 3
      drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
  6. 25
      drivers/gdisp/STM32LTDC/readme.md
  7. 11
      drivers/gdisp/STM32LTDC/readme.txt

4
boards/base/STM32F429i-Discovery/chibios/board_STM32LTDC.h

@ -23,7 +23,7 @@ static const SPIConfig spi_cfg = {
((1 << 3) & SPI_CR1_BR) | SPI_CR1_SSM | SPI_CR1_SSI | SPI_CR1_MSTR
};
#define ALLOW_2ND_LAYER GFXON
#define LTDC_USE_2ND_LAYER GFXON
static const ltdcConfig driverCfg = {
240, 320,
@ -47,7 +47,7 @@ static const ltdcConfig driverCfg = {
0xFF, // alpha
LTDC_LEF_ENABLE // flags
},
#if ALLOW_2ND_LAYER
#if LTDC_USE_2ND_LAYER
{ // Foreground layer config (if turned on)
(LLDCOLOR_TYPE *)(SDRAM_BANK_ADDR+(240 * 320 * LTDC_PIXELBYTES)), // Frame buffer address
240, 320, // width, height

4
boards/base/STM32F439i-Eval/CubeHal/board_STM32LTDC.h

@ -19,7 +19,7 @@
#include "stm32f4xx_hal.h"
#include "stm324x9i_eval_sdram.h"
#define ALLOW_2ND_LAYER GFXON
#define LTDC_USE_2ND_LAYER GFXON
// Panel parameters
// This panel is a AMPIRE640480 panel.
@ -48,7 +48,7 @@ static const ltdcConfig driverCfg = {
LTDC_LEF_ENABLE // Layer configuration flags
},
#if ALLOW_2ND_LAYER
#if LTDC_USE_2ND_LAYER
{ // Foreground layer config (if turned on)
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(640 * 480 * LTDC_PIXELBYTES)), // Frame buffer address
640, 480, // Width, Height (pixels)

4
boards/base/STM32F746-Discovery/board_STM32LTDC.h

@ -36,7 +36,7 @@
#define AFRH AFR[1]
#endif
#define ALLOW_2ND_LAYER GFXON
#define LTDC_USE_2ND_LAYER GFXON
static const ltdcConfig driverCfg = {
480, 272, // Width, Height (pixels)
@ -62,7 +62,7 @@ static const ltdcConfig driverCfg = {
LTDC_LEF_ENABLE // Layer configuration flags
},
#if ALLOW_2ND_LAYER
#if LTDC_USE_2ND_LAYER
{ // Foreground layer config (if turned on)
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(480 * 272 * LTDC_PIXELBYTES)), // Frame buffer address
480, 272, // Width, Height (pixels)

4
drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h

@ -8,7 +8,7 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
#define ALLOW_2ND_LAYER GFXON
#define LTDC_USE_2ND_LAYER GFXON
static const ltdcConfig driverCfg = {
480, 272, // Width, Height (pixels)
@ -34,7 +34,7 @@ static const ltdcConfig driverCfg = {
LTDC_LEF_ENABLE // Layer configuration flags
},
#if ALLOW_2ND_LAYER
#if LTDC_USE_2ND_LAYER
{ // Foreground layer config (if turned on)
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(480 * 272 * LTDC_PIXELBYTES)), // Frame buffer address
480, 272, // Width, Height (pixels)

3
drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c

@ -23,9 +23,6 @@
#undef GDISP_SCREEN_HEIGHT
#endif
#ifndef LTDC_USE_DOUBLE_BUFFERING
#define LTDC_USE_DOUBLE_BUFFERING GFXOFF
#endif
#ifndef LTDC_USE_DMA2D
#define LTDC_USE_DMA2D GFXOFF
#endif

25
drivers/gdisp/STM32LTDC/readme.md

@ -0,0 +1,25 @@
# Usage
To use this driver:
1. Add in your `gfxconf.h`:
a) `#define GFX_USE_GDISP GFXON`
2. To your makefile add the following lines:
```
include $(GFXLIB)/gfx.mk
include $(GFXLIB)/drivers/gdisp/STM32LTDC/driver.mk
```
3. Add a `board_STM32LTDC.h` to you project directory (or board directory)
based on one of the templates.
# 2nd layer
Two things need to happen in order to use the 2nd LTDC layer:
- Set `LTDC_USE_2ND_LAYER` to `GFXON` in the board file.
- Set `GDISP_TOTAL_DISPLAYS` to `2` in `gfxconf.h`.
The 2nd layer is exposed as a separate display. Use `gdispGetDisplay()` to retrieve the individual layers.
For more information, see:
- https://wiki.ugfx.io/index.php/Multiple_displays#Example_-_Same_controller
- https://wiki.ugfx.io/index.php/Multiple_displays#Access_the_displays

11
drivers/gdisp/STM32LTDC/readme.txt

@ -1,11 +0,0 @@
To use this driver:
1. Add in your gfxconf.h:
a) #define GFX_USE_GDISP GFXON
2. To your makefile add the following lines:
include $(GFXLIB)/gfx.mk
include $(GFXLIB)/drivers/gdisp/STM32LTDC/driver.mk
3. Add a board_STM32LTDC.h to you project directory (or board directory)
based on one of the templates.
Loading…
Cancel
Save