Browse Source

STM32LTDC: Expose more options to board file

develop
Joel Bodenmann 3 months ago
parent
commit
91247717a0
  1. 2
      boards/base/STM32F429i-Discovery/chibios/board_STM32LTDC.h
  2. 2
      boards/base/STM32F439i-Eval/CubeHal/board_STM32LTDC.h
  3. 4
      boards/base/STM32F469i-Discovery/CubeHAL/board_STM32LTDC.h
  4. 2
      boards/base/STM32F746-Discovery/board_STM32LTDC.h
  5. 4
      drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h
  6. 37
      drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c

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

@ -23,7 +23,9 @@ static const SPIConfig spi_cfg = {
((1 << 3) & SPI_CR1_BR) | SPI_CR1_SSM | SPI_CR1_SSI | SPI_CR1_MSTR
};
#define LTDC_USE_DMA2D GFXON
#define LTDC_USE_2ND_LAYER GFXON
#define LTDC_DMA_CACHE_FLUSH GFXOFF // This will be turned on automatically on certain systems/platforms
static const ltdcConfig driverCfg = {
240, 320,

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

@ -19,7 +19,9 @@
#include "stm32f4xx_hal.h"
#include "stm324x9i_eval_sdram.h"
#define LTDC_USE_DMA2D GFXON
#define LTDC_USE_2ND_LAYER GFXON
#define LTDC_DMA_CACHE_FLUSH GFXOFF // This will be turned on automatically on certain systems/platforms
// Panel parameters
// This panel is a AMPIRE640480 panel.

4
boards/base/STM32F469i-Discovery/CubeHAL/board_STM32LTDC.h

@ -8,6 +8,10 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
#define LTDC_USE_DMA2D GFXON
#define LTDC_USE_2ND_LAYER GFXON
#define LTDC_DMA_CACHE_FLUSH GFXOFF // This will be turned on automatically on certain systems/platforms
/* Avoid naming collisions with CubeHAL. */
#if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Red

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

@ -36,7 +36,9 @@
#define AFRH AFR[1]
#endif
#define LTDC_USE_DMA2D GFXON
#define LTDC_USE_2ND_LAYER GFXON
#define LTDC_DMA_CACHE_FLUSH GFXOFF // This will be turned on automatically on certain systems/platforms
static const ltdcConfig driverCfg = {
480, 272, // Width, Height (pixels)

4
drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h

@ -8,7 +8,9 @@
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H
#define LTDC_USE_2ND_LAYER GFXON
#define LTDC_USE_DMA2D GFXON
#define LTDC_USE_2ND_LAYER GFXOFF
#define LTDC_DMA_CACHE_FLUSH GFXOFF // This will be turned on automatically on certain systems/platforms
static const ltdcConfig driverCfg = {
480, 272, // Width, Height (pixels)

37
drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c

@ -12,6 +12,10 @@
#define GDISP_DRIVER_VMT GDISPVMT_STM32LTDC
#include "gdisp_lld_config.h"
#include "../../../src/gdisp/gdisp_driver.h"
#include "stm32_ltdc.h"
#if LTDC_USE_DMA2D
#include "stm32_dma2d.h"
#endif
#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
@ -23,25 +27,6 @@
#undef GDISP_SCREEN_HEIGHT
#endif
#ifndef LTDC_USE_DMA2D
#define LTDC_USE_DMA2D GFXOFF
#endif
#ifndef LTDC_DMA_CACHE_FLUSH
#define LTDC_DMA_CACHE_FLUSH GFXOFF
#endif
#include "stm32_ltdc.h"
#if LTDC_USE_DMA2D
#include "stm32_dma2d.h"
#if defined(STM32F7) || defined(STM32H7) || defined(STM32F746xx)
#undef LTDC_DMA_CACHE_FLUSH
#define LTDC_DMA_CACHE_FLUSH GFXON
#endif
#endif
typedef struct ltdcLayerConfig {
// Frame
LLDCOLOR_TYPE* frame; // Frame buffer address
@ -90,6 +75,20 @@ typedef struct ltdcConfig {
#include "board_STM32LTDC.h"
#ifndef LTDC_USE_DMA2D
#define LTDC_USE_DMA2D GFXOFF
#endif
#ifndef LTDC_DMA_CACHE_FLUSH
#define LTDC_DMA_CACHE_FLUSH GFXOFF
#endif
#if LTDC_USE_DMA2D
#if defined(STM32F7) || defined(STM32H7) || defined(STM32F746xx)
#undef LTDC_DMA_CACHE_FLUSH
#define LTDC_DMA_CACHE_FLUSH GFXON
#endif
#endif
/*===========================================================================*/
/* Driver local definitions. */
/*===========================================================================*/

Loading…
Cancel
Save