STM32LTDC: Rename ALLOW_2ND_LAYER to LTDC_USE_2ND_LAYER
This commit is contained in:
parent
a9cf2bdfe2
commit
94fd096fdd
@ -23,7 +23,7 @@ static const SPIConfig spi_cfg = {
|
|||||||
((1 << 3) & SPI_CR1_BR) | SPI_CR1_SSM | SPI_CR1_SSI | SPI_CR1_MSTR
|
((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 = {
|
static const ltdcConfig driverCfg = {
|
||||||
240, 320,
|
240, 320,
|
||||||
@ -47,7 +47,7 @@ static const ltdcConfig driverCfg = {
|
|||||||
0xFF, // alpha
|
0xFF, // alpha
|
||||||
LTDC_LEF_ENABLE // flags
|
LTDC_LEF_ENABLE // flags
|
||||||
},
|
},
|
||||||
#if ALLOW_2ND_LAYER
|
#if LTDC_USE_2ND_LAYER
|
||||||
{ // Foreground layer config (if turned on)
|
{ // Foreground layer config (if turned on)
|
||||||
(LLDCOLOR_TYPE *)(SDRAM_BANK_ADDR+(240 * 320 * LTDC_PIXELBYTES)), // Frame buffer address
|
(LLDCOLOR_TYPE *)(SDRAM_BANK_ADDR+(240 * 320 * LTDC_PIXELBYTES)), // Frame buffer address
|
||||||
240, 320, // width, height
|
240, 320, // width, height
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "stm32f4xx_hal.h"
|
#include "stm32f4xx_hal.h"
|
||||||
#include "stm324x9i_eval_sdram.h"
|
#include "stm324x9i_eval_sdram.h"
|
||||||
|
|
||||||
#define ALLOW_2ND_LAYER GFXON
|
#define LTDC_USE_2ND_LAYER GFXON
|
||||||
|
|
||||||
// Panel parameters
|
// Panel parameters
|
||||||
// This panel is a AMPIRE640480 panel.
|
// This panel is a AMPIRE640480 panel.
|
||||||
@ -48,7 +48,7 @@ static const ltdcConfig driverCfg = {
|
|||||||
LTDC_LEF_ENABLE // Layer configuration flags
|
LTDC_LEF_ENABLE // Layer configuration flags
|
||||||
},
|
},
|
||||||
|
|
||||||
#if ALLOW_2ND_LAYER
|
#if LTDC_USE_2ND_LAYER
|
||||||
{ // Foreground layer config (if turned on)
|
{ // Foreground layer config (if turned on)
|
||||||
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(640 * 480 * LTDC_PIXELBYTES)), // Frame buffer address
|
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(640 * 480 * LTDC_PIXELBYTES)), // Frame buffer address
|
||||||
640, 480, // Width, Height (pixels)
|
640, 480, // Width, Height (pixels)
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#define AFRH AFR[1]
|
#define AFRH AFR[1]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ALLOW_2ND_LAYER GFXON
|
#define LTDC_USE_2ND_LAYER GFXON
|
||||||
|
|
||||||
static const ltdcConfig driverCfg = {
|
static const ltdcConfig driverCfg = {
|
||||||
480, 272, // Width, Height (pixels)
|
480, 272, // Width, Height (pixels)
|
||||||
@ -62,7 +62,7 @@ static const ltdcConfig driverCfg = {
|
|||||||
LTDC_LEF_ENABLE // Layer configuration flags
|
LTDC_LEF_ENABLE // Layer configuration flags
|
||||||
},
|
},
|
||||||
|
|
||||||
#if ALLOW_2ND_LAYER
|
#if LTDC_USE_2ND_LAYER
|
||||||
{ // Foreground layer config (if turned on)
|
{ // Foreground layer config (if turned on)
|
||||||
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(480 * 272 * LTDC_PIXELBYTES)), // Frame buffer address
|
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(480 * 272 * LTDC_PIXELBYTES)), // Frame buffer address
|
||||||
480, 272, // Width, Height (pixels)
|
480, 272, // Width, Height (pixels)
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#ifndef _GDISP_LLD_BOARD_H
|
#ifndef _GDISP_LLD_BOARD_H
|
||||||
#define _GDISP_LLD_BOARD_H
|
#define _GDISP_LLD_BOARD_H
|
||||||
|
|
||||||
#define ALLOW_2ND_LAYER GFXON
|
#define LTDC_USE_2ND_LAYER GFXON
|
||||||
|
|
||||||
static const ltdcConfig driverCfg = {
|
static const ltdcConfig driverCfg = {
|
||||||
480, 272, // Width, Height (pixels)
|
480, 272, // Width, Height (pixels)
|
||||||
@ -34,7 +34,7 @@ static const ltdcConfig driverCfg = {
|
|||||||
LTDC_LEF_ENABLE // Layer configuration flags
|
LTDC_LEF_ENABLE // Layer configuration flags
|
||||||
},
|
},
|
||||||
|
|
||||||
#if ALLOW_2ND_LAYER
|
#if LTDC_USE_2ND_LAYER
|
||||||
{ // Foreground layer config (if turned on)
|
{ // Foreground layer config (if turned on)
|
||||||
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(480 * 272 * LTDC_PIXELBYTES)), // Frame buffer address
|
(LLDCOLOR_TYPE *)(SDRAM_DEVICE_ADDR+(480 * 272 * LTDC_PIXELBYTES)), // Frame buffer address
|
||||||
480, 272, // Width, Height (pixels)
|
480, 272, // Width, Height (pixels)
|
||||||
|
@ -23,9 +23,6 @@
|
|||||||
#undef GDISP_SCREEN_HEIGHT
|
#undef GDISP_SCREEN_HEIGHT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LTDC_USE_DOUBLE_BUFFERING
|
|
||||||
#define LTDC_USE_DOUBLE_BUFFERING GFXOFF
|
|
||||||
#endif
|
|
||||||
#ifndef LTDC_USE_DMA2D
|
#ifndef LTDC_USE_DMA2D
|
||||||
#define LTDC_USE_DMA2D GFXOFF
|
#define LTDC_USE_DMA2D GFXOFF
|
||||||
#endif
|
#endif
|
||||||
|
25
drivers/gdisp/STM32LTDC/readme.md
Normal file
25
drivers/gdisp/STM32LTDC/readme.md
Normal 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
|
@ -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…
Reference in New Issue
Block a user