STM32LTDC: Rename ALLOW_2ND_LAYER to LTDC_USE_2ND_LAYER

This commit is contained in:
Joel Bodenmann 2021-08-17 13:26:54 +02:00
parent a9cf2bdfe2
commit 94fd096fdd
7 changed files with 33 additions and 22 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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.